mirror of
https://github.com/a-nyx/maputnik-with-pmtiles.git
synced 2024-12-27 10:25:27 +01:00
Updated to new webdriverio config api, and fixed failing tests.
This commit is contained in:
parent
ba9d21c045
commit
2cc7c63bb1
2 changed files with 12 additions and 5 deletions
|
@ -97,7 +97,7 @@ exports.config = {
|
||||||
//
|
//
|
||||||
screenshotPath: SCREENSHOT_PATH,
|
screenshotPath: SCREENSHOT_PATH,
|
||||||
// Note: This is here because @orangemug currently runs Maputnik inside a docker container.
|
// Note: This is here because @orangemug currently runs Maputnik inside a docker container.
|
||||||
host: process.env.DOCKER_HOST || "0.0.0.0",
|
hostname: process.env.DOCKER_HOST || "0.0.0.0",
|
||||||
// Set a base URL in order to shorten url command calls. If your `url` parameter starts
|
// Set a base URL in order to shorten url command calls. If your `url` parameter starts
|
||||||
// with `/`, the base url gets prepended, not including the path portion of your baseUrl.
|
// with `/`, the base url gets prepended, not including the path portion of your baseUrl.
|
||||||
// If your `url` parameter starts without a scheme or `/` (like `some/path`), the base url
|
// If your `url` parameter starts without a scheme or `/` (like `some/path`), the base url
|
||||||
|
@ -147,12 +147,16 @@ exports.config = {
|
||||||
onPrepare: function (config, capabilities) {
|
onPrepare: function (config, capabilities) {
|
||||||
return new Promise(function(resolve, reject) {
|
return new Promise(function(resolve, reject) {
|
||||||
var compiler = webpack(webpackConfig);
|
var compiler = webpack(webpackConfig);
|
||||||
|
const serverHost = isDocker() ? "0.0.0.0" : "localhost";
|
||||||
|
|
||||||
server = new WebpackDevServer(compiler, {
|
server = new WebpackDevServer(compiler, {
|
||||||
|
host: serverHost,
|
||||||
stats: {
|
stats: {
|
||||||
colors: true
|
colors: true
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
server.listen(testConfig.port, (isDocker() ? "0.0.0.0" : "localhost"), function(err) {
|
|
||||||
|
server.listen(testConfig.port, serverHost, function(err) {
|
||||||
if(err) {
|
if(err) {
|
||||||
reject(err);
|
reject(err);
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,8 +6,10 @@ var helper = require("../helper");
|
||||||
|
|
||||||
|
|
||||||
function closeModal(wdKey) {
|
function closeModal(wdKey) {
|
||||||
|
const selector = wd.$(wdKey);
|
||||||
|
|
||||||
browser.waitUntil(function() {
|
browser.waitUntil(function() {
|
||||||
const elem = $(wdKey);
|
const elem = $(selector);
|
||||||
return elem.isDisplayedInViewport();
|
return elem.isDisplayedInViewport();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -15,8 +17,9 @@ function closeModal(wdKey) {
|
||||||
closeBtnSelector.click();
|
closeBtnSelector.click();
|
||||||
|
|
||||||
browser.waitUntil(function() {
|
browser.waitUntil(function() {
|
||||||
const elem = $(wdKey);
|
return browser.execute((selector) => {
|
||||||
return !elem.isDisplayed();
|
return !document.querySelector(selector);
|
||||||
|
}, selector);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue