17266: Avoids reloading the app on cypress tests by using search.
[arvados-workbench2.git] / cypress / integration / collection-panel.spec.js
index 424c2bad07bc7ff878be02cb44e7f9ba6e67f860..0669b313c6c10d2cb92b45f859b9ee7d55e42d94 100644 (file)
@@ -28,7 +28,7 @@ describe('Collection panel tests', function() {
         cy.clearLocalStorage();
     });
 
-    it.only('shows collection by URL', function() {
+    it('shows collection by URL', function() {
         cy.loginAs(activeUser);
         [true, false].map(function(isWritable) {
             cy.createGroup(adminUser.token, {
@@ -50,10 +50,7 @@ describe('Collection panel tests', function() {
                         head_uuid: this.sharedGroup.uuid,
                         tail_uuid: activeUser.user.uuid
                     })
-                    cy.visit(`/collections/${this.testCollection.uuid}`);
-
-                    cy.get('[data-cy=linear-progress]').should('exist');
-                    cy.get('[data-cy=linear-progress]').should('not.exist');
+                    cy.doSearch(`${this.testCollection.uuid}`);
 
                     // Check that name & uuid are correct.
                     cy.get('[data-cy=collection-info-panel]')
@@ -143,10 +140,7 @@ describe('Collection panel tests', function() {
             manifest_text: ". 37b51d194a7513e45b56f6524f2d51f2+3 0:3:bar\n"})
         .as('testCollection').then(function() {
             cy.loginAs(activeUser);
-            cy.visit(`/collections/${this.testCollection.uuid}`);
-
-            cy.get('[data-cy=linear-progress]').should('exist');
-            cy.get('[data-cy=linear-progress]').should('not.exist');
+            cy.doSearch(`${this.testCollection.uuid}`);
 
             const nameTransitions = [
                 ['bar', '&'],
@@ -183,10 +177,7 @@ describe('Collection panel tests', function() {
             manifest_text: ". 37b51d194a7513e45b56f6524f2d51f2+3 0:3:bar\n"})
         .as('testCollection').then(function() {
             cy.loginAs(activeUser);
-            cy.visit(`/collections/${this.testCollection.uuid}`);
-
-            cy.get('[data-cy=linear-progress]').should('exist');
-            cy.get('[data-cy=linear-progress]').should('not.exist');
+            cy.doSearch(`${this.testCollection.uuid}`);
 
             // Rename 'bar' to 'subdir/foo'
             cy.get('[data-cy=collection-files-panel]')
@@ -234,10 +225,7 @@ describe('Collection panel tests', function() {
             manifest_text: ". 37b51d194a7513e45b56f6524f2d51f2+3 0:3:bar\n"})
         .as('testCollection').then(function() {
             cy.loginAs(activeUser);
-            cy.visit(`/collections/${this.testCollection.uuid}`);
-
-            cy.get('[data-cy=linear-progress]').should('exist');
-            cy.get('[data-cy=linear-progress]').should('not.exist');
+            cy.doSearch(`${this.testCollection.uuid}`);
 
             const illegalNamesFromUI = [
                 ['.', "Name cannot be '.' or '..'"],
@@ -312,10 +300,7 @@ describe('Collection panel tests', function() {
             });
             // Check the old version displays as what it is.
             cy.loginAs(activeUser)
-            cy.visit(`/collections/${oldVersionUuid}`);
-
-            cy.get('[data-cy=linear-progress]').should('exist');
-            cy.get('[data-cy=linear-progress]').should('not.exist');
+            cy.doSearch(`${oldVersionUuid}`);
 
             cy.get('[data-cy=collection-info-panel]').should('contain', 'This is an old version');
             cy.get('[data-cy=read-only-icon]').should('exist');
@@ -337,10 +322,7 @@ describe('Collection panel tests', function() {
         .as('collection').then(function() {
             // Visit collection, check basic information
             cy.loginAs(activeUser)
-            cy.visit(`/collections/${this.collection.uuid}`);
-
-            cy.get('[data-cy=linear-progress]').should('exist');
-            cy.get('[data-cy=linear-progress]').should('not.exist');
+            cy.doSearch(`${this.collection.uuid}`);
 
             cy.get('[data-cy=collection-info-panel]').should('not.contain', 'This is an old version');
             cy.get('[data-cy=read-only-icon]').should('not.exist');