Commit c065f5bf authored by Sam Saccone's avatar Sam Saccone

tests: Ensure app is visible before testing.

Fixes #1289
parent fd4d3b68
......@@ -104,6 +104,16 @@ module.exports = function Page(browser) {
};
// ----------------- page actions
this.ensureAppIsVisible = function () {
return browser.findElements(webdriver.By.css('#todoapp'))
.then(function (elms) {
if (elms.length > 0) {
return true;
} else {
throw new Error('Unable to find application root, did you start your local server?');
}
});
};
this.clickMarkAllCompletedCheckBox = function () {
return this.getMarkAllCompletedCheckBox().then(function (checkbox) {
......
......@@ -84,6 +84,7 @@ module.exports.todoMVCTest = function (frameworkName, baseUrl, speedMode, laxMod
} else {
test.beforeEach(function () {
launchBrowser();
page.ensureAppIsVisible();
});
test.afterEach(function () {
closeBrowser();
......
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