Use driver pattern for e2e tests (#2)

* Initial commit

* Fix spec

* Move driver

* Fix config location

* Fix helper location

* More usage of driver

* Add click

* Fix click

* Migrate more tests

* Add setValue to driver

* Move more code to driver

* add isExisting to driver

* Change modal tests to use driver

* Fix tests

* Fix test

* Fix invalid alert wait

* Fix missing wd

* Fix tests

* Fix missing fs

* Fix test

* Fix path

* Move screenshort to driver

* Migrate keyboard

* Migrate skiplinks to driver

* Fix tests

* Try fix skip-links

* add config

* Add helper

* Fix driver?

* remove helper

* remove wd-helper

* Remove redundant file

* Remove webdriver extsions
This commit is contained in:
Harel M
2023-12-14 18:14:06 +02:00
committed by GitHub
parent b7838ad6e1
commit 73f7798a1d
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 --------