Skip to content

Commit 43b8ef6

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 43b8ef6

File tree

3 files changed

+29
-20
lines changed

3 files changed

+29
-20
lines changed

dist/scripts/vendor.js

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -26578,35 +26578,35 @@ function o(t) {
2657826578
var n = t.settings()[0]._select.selector;
2657926579
e(t.table().container()).off("mousedown.dtSelect", n).off("mouseup.dtSelect", n).off("click.dtSelect", n), e("body").off("click.dtSelect" + t.table().node().id);
2658026580
}
26581-
function a(i) {
26582-
var r = e(i.table().container()), o = i.settings()[0], a = o._select.selector;
26583-
r.on("mousedown.dtSelect", a, function(e) {
26584-
(e.shiftKey || e.metaKey || e.ctrlKey) && r.css("-moz-user-select", "none").one("selectstart.dtSelect", a, function() {
26581+
function a(n) {
26582+
var i = e(n.table().container()), r = n.settings()[0], o = r._select.selector;
26583+
i.on("mousedown.dtSelect", o, function(e) {
26584+
(e.shiftKey || e.metaKey || e.ctrlKey) && i.css("-moz-user-select", "none").one("selectstart.dtSelect", o, function() {
2658526585
return !1;
2658626586
});
26587-
}).on("mouseup.dtSelect", a, function() {
26588-
r.css("-moz-user-select", "");
26589-
}).on("click.dtSelect", a, function(n) {
26590-
var r, o = i.select.items();
26587+
}).on("mouseup.dtSelect", o, function() {
26588+
i.css("-moz-user-select", "");
26589+
}).on("click.dtSelect", o, function(i) {
26590+
var r, o = n.select.items();
2659126591
if (!t.getSelection || !e.trim(t.getSelection().toString())) {
26592-
var a = i.settings()[0];
26593-
if (e(n.target).closest("div.dataTables_wrapper")[0] == i.table().container()) {
26594-
var l = i.cell(e(n.target).closest("td, th"));
26592+
var a = n.settings()[0];
26593+
if (e(i.target).closest("div.dataTables_wrapper")[0] == n.table().container()) {
26594+
var l = n.cell(e(i.target).closest("td, th"));
2659526595
if (l.any()) {
2659626596
var c = e.Event("user-select.dt");
26597-
if (s(i, c, [ o, l, n ]), !c.isDefaultPrevented()) {
26597+
if (s(n, c, [ o, l, i ]), !c.isDefaultPrevented()) {
2659826598
var u = l.index();
26599-
"row" === o ? (r = u.row, h(n, i, a, "row", r)) : "column" === o ? (r = l.index().column, h(n, i, a, "column", r)) : "cell" === o && (r = l.index(), h(n, i, a, "cell", r)), a._select_lastCell = u;
26599+
"row" === o ? (r = u.row, h(i, n, a, "row", r)) : "column" === o ? (r = l.index().column, h(i, n, a, "column", r)) : "cell" === o && (r = l.index(), h(i, n, a, "cell", r)), a._select_lastCell = u;
2660026600
}
2660126601
}
2660226602
}
2660326603
}
26604-
}), e("body").on("click.dtSelect" + i.table().node().id, function(t) {
26605-
if (o._select.blurable) {
26606-
if (e(t.target).parents().filter(i.table().container()).length) return;
26607-
if (t.target.getRootNode() !== n) return;
26604+
}), e("body").on("click.dtSelect" + n.table().node().id, function(t) {
26605+
if (r._select.blurable) {
26606+
if (e(t.target).parents().filter(n.table().container()).length) return;
26607+
if (0 === e(t.target).parents("html").length) return;
2660826608
if (e(t.target).parents("div.DTE").length) return;
26609-
d(o, !0);
26609+
d(r, !0);
2661026610
}
2661126611
});
2661226612
}
@@ -26615,7 +26615,7 @@ r && !t.flatten().length || ("string" == typeof n && (n += ".dt"), i.unshift(t),
2661526615
}
2661626616
function l(t) {
2661726617
var n = t.settings()[0];
26618-
if (n._select.info && n.aanFeatures.i) {
26618+
if (n._select.info && n.aanFeatures.i && "api" !== t.select.style()) {
2661926619
var i = t.rows({
2662026620
selected: !0
2662126621
}).flatten().length, r = t.columns({
@@ -26723,7 +26723,7 @@ var t = e._eventNamespace;
2672326723
return "draw.dt.DT" + t + " select.dt.DT" + t + " deselect.dt.DT" + t;
2672426724
}
2672526725
var g = e.fn.dataTable;
26726-
g.select = {}, g.select.version = "1.2.2", g.select.init = function(t) {
26726+
g.select = {}, g.select.version = "1.2.3", g.select.init = function(t) {
2672726727
var n = t.settings()[0], r = n.oInit.select, o = g.defaults.select, a = r === i ? o : r, s = "row", l = "api", c = !1, u = !0, d = "td, th", h = "selected", f = !1;
2672826728
n._select = {}, !0 === a ? (l = "os", f = !0) : "string" == typeof a ? (l = a, f = !0) : e.isPlainObject(a) && (a.blurable !== i && (c = a.blurable), a.info !== i && (u = a.info), a.items !== i && (s = a.items), a.style !== i && (l = a.style, f = !0), a.selector !== i && (d = a.selector), a.className !== i && (h = a.className)), t.select.selector(d), t.select.items(s), t.select.style(l), t.select.blurable(c), t.select.info(u), n._select.className = h, e.fn.dataTable.ext.order["select-checkbox"] = function(t, n) {
2672926729
return this.api().column(n, {

test/integration/helpers.js

Lines changed: 6 additions & 0 deletions
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);

test/integration/page-objects/overview.js

Lines changed: 3 additions & 0 deletions
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)