[arvados] created: 2.7.0-5830-g3108805fdc

git repository hosting git at public.arvados.org
Mon Jan 15 21:03:09 UTC 2024


        at  3108805fdc1984c90e3d69670d5911758eb64a1f (commit)


commit 3108805fdc1984c90e3d69670d5911758eb64a1f
Author: Stephen Smith <stephen at curii.com>
Date:   Mon Jan 15 16:02:16 2024 -0500

    21353: Add cypress-wait-until to prevent cy.url before window.location is
    defined in loginAs, fixes flaky test
    
    Arvados-DCO-1.1-Signed-off-by: Stephen Smith <stephen at curii.com>

diff --git a/services/workbench2/cypress/support/commands.js b/services/workbench2/cypress/support/commands.js
index 135f9cfd6d..e5a56e9de0 100644
--- a/services/workbench2/cypress/support/commands.js
+++ b/services/workbench2/cypress/support/commands.js
@@ -28,6 +28,7 @@
 // -- This will overwrite an existing command --
 // Cypress.Commands.overwrite("visit", (originalFn, url, options) => { ... })
 
+import 'cypress-wait-until';
 import { extractFilesData } from "services/collection-service/collection-service-files-response";
 
 const controllerURL = Cypress.env("controller_url");
@@ -352,6 +353,8 @@ Cypress.Commands.add("loginAs", user => {
     cy.clearCookies();
     cy.clearLocalStorage();
     cy.visit(`/token/?api_token=${user.token}`);
+    // Wait for window.location to not be undefined
+    cy.waitUntil(() => cy.window().then(win => win?.location?.href));
     cy.url({ timeout: 15000 }).should("contain", "/projects/");
     cy.get("div#root").should("contain", "Arvados Workbench (zzzzz)");
     cy.get("div#root").should("not.contain", "Your account is inactive");
diff --git a/services/workbench2/package.json b/services/workbench2/package.json
index abb204907b..c6e2d6bcda 100644
--- a/services/workbench2/package.json
+++ b/services/workbench2/package.json
@@ -114,6 +114,7 @@
     "@types/uuid": "3.4.4",
     "axios-mock-adapter": "1.17.0",
     "cypress": "6.3.0",
+    "cypress-wait-until": "^3.0.1",
     "enzyme": "3.11.0",
     "enzyme-adapter-react-16": "1.15.6",
     "jest-localstorage-mock": "2.2.0",
diff --git a/services/workbench2/yarn.lock b/services/workbench2/yarn.lock
index 18934f24c7..bb3ca955a0 100644
--- a/services/workbench2/yarn.lock
+++ b/services/workbench2/yarn.lock
@@ -3870,6 +3870,7 @@ __metadata:
     classnames: 2.2.6
     cwlts: 1.15.29
     cypress: 6.3.0
+    cypress-wait-until: ^3.0.1
     date-fns: ^2.28.0
     debounce: 1.2.0
     dompurify: ^3.0.6
@@ -6359,6 +6360,13 @@ __metadata:
   languageName: node
   linkType: hard
 
+"cypress-wait-until at npm:^3.0.1":
+  version: 3.0.1
+  resolution: "cypress-wait-until at npm:3.0.1"
+  checksum: 487626011bf260b2e6cda68f1ced6cb4bb09013e479cd12681eeb577f788d5fd46c95040add9849d4ee1109c8e553330aadb42f2a252e8656bb8c3dbf776a087
+  languageName: node
+  linkType: hard
+
 "cypress at npm:6.3.0":
   version: 6.3.0
   resolution: "cypress at npm:6.3.0"

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list