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) { ...@@ -104,6 +104,16 @@ module.exports = function Page(browser) {
}; };
// ----------------- page actions // ----------------- 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 () { this.clickMarkAllCompletedCheckBox = function () {
return this.getMarkAllCompletedCheckBox().then(function (checkbox) { return this.getMarkAllCompletedCheckBox().then(function (checkbox) {
......
...@@ -84,6 +84,7 @@ module.exports.todoMVCTest = function (frameworkName, baseUrl, speedMode, laxMod ...@@ -84,6 +84,7 @@ module.exports.todoMVCTest = function (frameworkName, baseUrl, speedMode, laxMod
} else { } else {
test.beforeEach(function () { test.beforeEach(function () {
launchBrowser(); launchBrowser();
page.ensureAppIsVisible();
}); });
test.afterEach(function () { test.afterEach(function () {
closeBrowser(); 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