Skip to content

Commit

Permalink
tests: Allow dynamic app discovery
Browse files Browse the repository at this point in the history
  • Loading branch information
samccone committed Jun 17, 2015
1 parent 1dd17f9 commit 45b15b5
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion tests/page.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

var webdriver = require('selenium-webdriver');

var idSelectors = false;
module.exports = function Page(browser) {

// ----------------- utility methods
Expand Down Expand Up @@ -110,8 +111,20 @@ module.exports = function Page(browser) {
if (elms.length > 0) {
return true;
} 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?');
});
};

Expand Down

0 comments on commit 45b15b5

Please sign in to comment.