Skip to content

Commit e293e81

Browse files
committed
Wait for project bar visibility
Wait for the project bar to become visible before trying to click the "Add to Project" dropdown. It uses `ng-show` instead of `ng-if`.
1 parent 5647d19 commit e293e81

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

Diff for: test/integration/helpers.js

+6
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,12 @@ exports.waitForPresence = function(selector, elementText, timeout, callback) {
9393
});
9494
};
9595

96+
var waitForVisibility = function(elem, timeout) {
97+
return browser.wait(EC.visibilityOf(elem), timeout || 5000, 'Element not visible: ' + elem.locator().toString());
98+
};
99+
exports.waitForVisibility = waitForVisibility;
100+
101+
96102
exports.goToPage = function(uri) {
97103
return browser.get(uri).then(() => {
98104
return waitForUri(uri);

Diff for: test/integration/page-objects/overview.js

+3
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ class OverviewPage extends Page {
1111
return 'project/' + this.project.name + '/overview';
1212
}
1313
clickAddToProject() {
14+
// The project bar uses `ng-show` instead of `ng-if,` so make sure it's
15+
// visible before continuing.
16+
h.waitForVisibility(element(by.css('.project-bar')));
1417
let button = element(by.cssContainingText('.add-to-project .dropdown-toggle', 'Add to Project'));
1518
h.waitForElem(button);
1619
button.click();

0 commit comments

Comments
 (0)