Updated to new webdriverio config api, and fixed failing tests.

This commit is contained in:
orangemug 2020-02-18 21:39:11 +00:00
parent ba9d21c045
commit 2cc7c63bb1
2 changed files with 12 additions and 5 deletions

View file

@ -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);
} }

View file

@ -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);
}); });
} }