21461: Removes unnecessary session clearing code. Cypress already does it.
authorLucas Di Pentima <lucas.dipentima@curii.com>
Fri, 23 Feb 2024 20:59:25 +0000 (17:59 -0300)
committerLucas Di Pentima <lucas.dipentima@curii.com>
Fri, 23 Feb 2024 20:59:25 +0000 (17:59 -0300)
Arvados-DCO-1.1-Signed-off-by: Lucas Di Pentima <lucas.dipentima@curii.com>

14 files changed:
services/workbench2/cypress/e2e/banner-tooltip.cy.js
services/workbench2/cypress/e2e/collection.cy.js
services/workbench2/cypress/e2e/create-workflow.cy.js
services/workbench2/cypress/e2e/delete-multiple-files.cy.js
services/workbench2/cypress/e2e/favorites.cy.js
services/workbench2/cypress/e2e/login.cy.js
services/workbench2/cypress/e2e/multiselect-toolbar.cy.js
services/workbench2/cypress/e2e/page-not-found.cy.js
services/workbench2/cypress/e2e/process.cy.js
services/workbench2/cypress/e2e/project.cy.js
services/workbench2/cypress/e2e/search.cy.js
services/workbench2/cypress/e2e/sharing.cy.js
services/workbench2/cypress/e2e/side-panel.cy.js
services/workbench2/cypress/support/commands.js

index 3fbaba9e381413230d3fbe2a8063108674780192..0a434ec9e86034c10e6baa64938551cb089bce4f 100644 (file)
@@ -23,9 +23,6 @@ describe('Banner / tooltip tests', function () {
     });
 
     beforeEach(function () {
-        cy.clearCookies();
-        cy.clearLocalStorage();
-
         cy.on('uncaught:exception', (err, runnable, promise) => {
             Cypress.log({ message: `Application Error: ${err}`});
             if (promise) {
index f4ffaebf5e7ab05f0a2d830f02f6863df8c831ac..c5edf0e4f2d64edadbcab474ed747e9d54380b48 100644 (file)
@@ -27,11 +27,6 @@ describe("Collection panel tests", function () {
         downloadsFolder = Cypress.config("downloadsFolder");
     });
 
-    beforeEach(function () {
-        cy.clearCookies();
-        cy.clearLocalStorage();
-    });
-
     it('shows the appropriate buttons in the toolbar', () => {
 
         const msButtonTooltips = [
index e6469039348338873aef4df1337556ffe3397cd5..c8acc6734888a41da01a1fe4c21e3680a8bb0944 100644 (file)
@@ -19,11 +19,6 @@ describe('Create workflow tests', function () {
             );
     });
 
-    beforeEach(function () {
-        cy.clearCookies();
-        cy.clearLocalStorage();
-    });
-
     it('can create project with nested data', function () {
         cy.createGroup(adminUser.token, {
             group_class: "project",
index b506fb3d6874b25e9fd16085d5da090e22b48be1..8086dd125dc70d798cf9d3f2cf594a0fa971541b 100644 (file)
@@ -19,11 +19,6 @@ describe('Multi-file deletion tests', function () {
             );
     });
 
-    beforeEach(function () {
-        cy.clearCookies();
-        cy.clearLocalStorage();
-    });
-
     it('deletes all files from root dir', function () {
         cy.createCollection(adminUser.token, {
             name: `Test collection ${Math.floor(Math.random() * 999999)}`,
index db9a0d5f394072736dbff8c1af730182eacc6ee4..2898c22cba2c354080c5daa9226ddab61def0671 100644 (file)
@@ -21,11 +21,6 @@ describe('Favorites tests', function () {
             });
     });
 
-    beforeEach(function () {
-        cy.clearCookies()
-        cy.clearLocalStorage()
-    });
-
     it('creates and removes a public favorite', function () {
         cy.loginAs(adminUser);
 
index 79f73670a34b055141974ba7da8bec0eef1ea22c..6f2c91c37e27c82b91e5e6d2311e04efa26d0c19 100644 (file)
@@ -33,11 +33,6 @@ describe('Login tests', function() {
         randomUser.password = 'topsecret';
     })
 
-    beforeEach(function() {
-        cy.clearCookies()
-        cy.clearLocalStorage()
-    })
-
     it('shows login page on first visit', function() {
         cy.visit('/')
         cy.get('div#root').should('contain', 'Please log in')
index ef503f7ef628874af301821f23a1ffc1385e39e0..ce3551bbd1e49936074e6166c734eadc1b38d5d9 100644 (file)
@@ -23,11 +23,6 @@ describe('Multiselect Toolbar Tests', () => {
             });
     });
 
-    beforeEach(function () {
-        cy.clearCookies();
-        cy.clearLocalStorage();
-    });
-
     it('exists in DOM in neutral state', () => {
         cy.loginAs(activeUser);
         cy.get('[data-cy=multiselect-toolbar]').should('exist');
index 6eab27c827dc3b1d0ffbc6b4cd22ce0f79e9b6fb..e147d740d3697b6c0d70efeaee57e39dc3e2d7d2 100644 (file)
@@ -13,11 +13,6 @@ describe('Page not found tests', function() {
         );
     });
 
-    beforeEach(function() {
-        cy.clearCookies()
-        cy.clearLocalStorage()
-    });
-
     it('shows not found page', function() {
         // when
         cy.loginAs(adminUser);
index 4687a2577e6cefac576598bb9b331248b2b272a4..ca13e9f9e0b380313e849b5ee9560aa9526554ba 100644 (file)
@@ -25,11 +25,6 @@ describe("Process tests", function () {
             });
     });
 
-    beforeEach(function () {
-        cy.clearCookies();
-        cy.clearLocalStorage();
-    });
-
     function setupDockerImage(image_name) {
         // Create a collection that will be used as a docker image for the tests.
         cy.createCollection(adminUser.token, {
index c03aa8dcd5f898cdbfd8c5380bbbb607a4d5049c..a7e70027595ed89bcb2389c39298667fe38e16b4 100644 (file)
@@ -23,11 +23,6 @@ describe("Project tests", function () {
             });
     });
 
-    beforeEach(function () {
-        cy.clearCookies();
-        cy.clearLocalStorage();
-    });
-
     it("creates a new project with multiple properties", function () {
         const projName = `Test project (${Math.floor(999999 * Math.random())})`;
         cy.loginAs(activeUser);
index d8aa35d3d2d4b6398282350f9d68e88ccb5a2030..4411c9ffb45c18af78f627ca5fd61435603c7d87 100644 (file)
@@ -23,11 +23,6 @@ describe("Search tests", function () {
             });
     });
 
-    beforeEach(function () {
-        cy.clearCookies();
-        cy.clearLocalStorage();
-    });
-
     it("can search for old collection versions", function () {
         const colName = `Versioned Collection ${Math.floor(Math.random() * Math.floor(999999))}`;
         let colUuid = "";
index f742d09062a4f0b95fe8be8946fb20464a0b8ef7..05a7d470bf6e1b1d7ed048dc27c46c60d27cd9aa 100644 (file)
@@ -21,11 +21,6 @@ describe('Sharing tests', function () {
             });
     })
 
-    beforeEach(function () {
-        cy.clearCookies()
-        cy.clearLocalStorage()
-    });
-
     it('can create and delete sharing URLs on collections', () => {
         const collName = 'shared-collection ' + new Date().getTime();
         cy.createCollection(adminUser.token, {
index d6ac754d0a4d0da815b51c7ee4ef7564b43b1e9d..6d6b19bfab2dd523bbfb5d2198f10950c1c57f24 100644 (file)
@@ -23,11 +23,6 @@ describe('Side panel tests', function() {
         );
     })
 
-    beforeEach(function() {
-        cy.clearCookies()
-        cy.clearLocalStorage()
-    })
-
     it('enables the +NEW side panel button on users home project', function() {
         cy.loginAs(activeUser);
         cy.get('[data-cy=side-panel-button]')
index 8fe0b06aafebb6adb3aca33f94e701b3b515213c..da7300a43014cbefde2f3edd2842fb61d9aa8c87 100644 (file)
@@ -350,8 +350,11 @@ Cypress.Commands.add("updateResource", (token, suffix, uuid, data) => {
 });
 
 Cypress.Commands.add("loginAs", user => {
+    // This shouldn't be necessary unless we need to call loginAs multiple times
+    // in the same test.
     cy.clearCookies();
-    cy.clearLocalStorage();
+    cy.clearAllLocalStorage();
+    cy.clearAllSessionStorage();
     cy.visit(`/token/?api_token=${user.token}`);
     // Use waitUntil to avoid permafail race conditions with window.location being undefined
     cy.waitUntil(() => cy.window().then(win =>