diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml index 99e17c5d3..c3584dae0 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e.yml @@ -181,4 +181,4 @@ jobs: sudo cat /etc/apache2/conf.d/wsgi_ermrest.conf sudo cat /var/log/apache2/error.log sudo cat /var/log/apache2/access.log - sudo -H -u webauthn psql -c 'select * from webauthn2_db.session' webauthn + sudo -H -u webauthn psql -c 'select * from webauthn2_db.session' webauthn \ No newline at end of file diff --git a/test/e2e/specs/default-config/recordset/add.spec.js b/test/e2e/specs/default-config/recordset/add.spec.js index cdd93eaf9..06cec8e5f 100644 --- a/test/e2e/specs/default-config/recordset/add.spec.js +++ b/test/e2e/specs/default-config/recordset/add.spec.js @@ -141,10 +141,20 @@ describe('Recordset add record,', function() { it("go back to recordset should refresh the table with the new record", function() { // ... before closing this new tab and switching back to the original Record app's tab so that the next it spec can run properly - browser.close(); + /** + * we noticed this test case started failing on saucelabs, + * that's why we're switching tabs twice to ensure the onfocus is getting called. + */ browser.switchTo().window(allWindows[0]).then(function() { + return browser.switchTo().window(allWindows[1]); + }).then(function () { + return browser.switchTo().window(allWindows[0]); + }).then(function () { return chaisePage.waitForElementInverse(element(by.id("spinner"))); }).then(function() { + return chaisePage.recordsetPage.getPageTitleElement().click(); + }).then(function () { + browser.wait(function() { return chaisePage.recordsetPage.getRows().count().then(function(ct) { return (ct == rowCount+1);