diff --git a/config/wdio.conf.js b/config/wdio.conf.js index 91b4c6e..484467c 100644 --- a/config/wdio.conf.js +++ b/config/wdio.conf.js @@ -97,7 +97,7 @@ exports.config = { // screenshotPath: SCREENSHOT_PATH, // 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 // 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 @@ -147,12 +147,16 @@ exports.config = { onPrepare: function (config, capabilities) { return new Promise(function(resolve, reject) { var compiler = webpack(webpackConfig); + const serverHost = isDocker() ? "0.0.0.0" : "localhost"; + server = new WebpackDevServer(compiler, { + host: serverHost, stats: { colors: true } }); - server.listen(testConfig.port, (isDocker() ? "0.0.0.0" : "localhost"), function(err) { + + server.listen(testConfig.port, serverHost, function(err) { if(err) { reject(err); } diff --git a/test/functional/modals/index.js b/test/functional/modals/index.js index bb9477b..fd94558 100644 --- a/test/functional/modals/index.js +++ b/test/functional/modals/index.js @@ -6,8 +6,10 @@ var helper = require("../helper"); function closeModal(wdKey) { + const selector = wd.$(wdKey); + browser.waitUntil(function() { - const elem = $(wdKey); + const elem = $(selector); return elem.isDisplayedInViewport(); }); @@ -15,8 +17,9 @@ function closeModal(wdKey) { closeBtnSelector.click(); browser.waitUntil(function() { - const elem = $(wdKey); - return !elem.isDisplayed(); + return browser.execute((selector) => { + return !document.querySelector(selector); + }, selector); }); }