Commit 45b15b54 authored by Sam Saccone's avatar Sam Saccone

tests: Allow dynamic app discovery

parent 1dd17f9c
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
var webdriver = require('selenium-webdriver'); var webdriver = require('selenium-webdriver');
var idSelectors = false;
module.exports = function Page(browser) { module.exports = function Page(browser) {
// ----------------- utility methods // ----------------- utility methods
...@@ -110,8 +111,20 @@ module.exports = function Page(browser) { ...@@ -110,8 +111,20 @@ module.exports = function Page(browser) {
if (elms.length > 0) { if (elms.length > 0) {
return true; return true;
} else { } else {
throw new Error('Unable to find application root, did you start your local server?'); return browser.findElements(webdriver.By.css('.todoapp'));
} }
})
.then(function (elms) {
if (elms === true) {
return true;
}
if (elms.length) {
idSelectors = true;
return true;
}
throw new Error('Unable to find application root, did you start your local server?');
}); });
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment