Use driver pattern for e2e tests (#829)

I've moved all the logic relevant to WBIO into a single file in order to
be able to replace it.
I have tried to upgrade WDIO in order to use the latest version and it
got stuck on my computer.
Furthermore, I was not able to run it locally which made this whole
cycle very long.
After this will be merged I will replace WDIO with cypress.
This doesn't change anything, only moves some code in the tests to a
single file, removes unneeded files and uses the driver pattern, which
will later allow switching the underline WDIO with Cypress.

cc: @nyurik
This commit is contained in:
Harel M
2023-12-17 08:14:23 +02:00
committed by GitHub
parent 31d56c9fae
commit 18f45e932b
15 changed files with 490 additions and 605 deletions

View File

@@ -1,31 +1,20 @@
var config = require("../config/specs");
var helper = require("./helper");
var extendWebdriverIO = require("./util/webdriverio-ext");
var driver = require("./driver");
describe('maputnik', function() {
before(async function(done) {
await extendWebdriverIO();
helper.startGeoserver(done);
await browser.setTimeout({ 'script': 20 * 1000 });
await browser.setTimeout({ 'implicit': 20 * 1000 });
driver.geoserver.start(done);
});
after(function(done) {
helper.stopGeoserver(done);
driver.geoserver.stop(done);
});
beforeEach(async function() {
await browser.url(config.baseUrl+"?debug&style="+helper.getStyleUrl([
"geojson:example",
"raster:raster"
]));
await browser.acceptAlert();
await browser.execute(function() {
localStorage.setItem("survey", true);
});
const elem = await $(".maputnik-toolbar-link");
await elem.waitForExist();
await browser.flushReactUpdates();
await driver.setStyle(["geojson:example","raster:raster"]);
await driver.setSurvey();
});
// -------- setup --------