From: Lucas Di Pentima Date: Tue, 12 Jan 2021 23:32:30 +0000 (-0300) Subject: 17109: Hopefully fixes several integration test flakyness issues. X-Git-Tag: 2.1.2~13^2 X-Git-Url: https://git.arvados.org/arvados-workbench2.git/commitdiff_plain/10dcb97234c4dc088ac12e7e4373521a018596f6 17109: Hopefully fixes several integration test flakyness issues. Arvados-DCO-1.1-Signed-off-by: Lucas Di Pentima --- diff --git a/cypress/integration/collection-panel.spec.js b/cypress/integration/collection-panel.spec.js index b86ff2a7..f70fe691 100644 --- a/cypress/integration/collection-panel.spec.js +++ b/cypress/integration/collection-panel.spec.js @@ -51,8 +51,11 @@ describe('Collection panel tests', function() { tail_uuid: activeUser.user.uuid }) cy.visit(`/collections/${this.testCollection.uuid}`); - // Check that name & uuid are correct. + + cy.get('[data-cy=linear-progress]').should('exist'); cy.get('[data-cy=linear-progress]').should('not.exist'); + + // Check that name & uuid are correct. cy.get('[data-cy=collection-info-panel]') .should('contain', this.testCollection.name) .and('contain', this.testCollection.uuid) @@ -139,6 +142,10 @@ describe('Collection panel tests', function() { .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'); + const nameTransitions = [ ['bar', '&'], ['&', 'foo'], @@ -147,7 +154,6 @@ describe('Collection panel tests', function() { ['I ❤️ ⛵️', '...'] ]; nameTransitions.forEach(([from, to]) => { - cy.get('[data-cy=linear-progress]').should('not.exist'); cy.get('[data-cy=collection-files-panel]') .contains(`${from}`).rightclick(); cy.get('[data-cy=context-menu]') @@ -176,8 +182,11 @@ describe('Collection panel tests', function() { .as('testCollection').then(function() { cy.loginAs(activeUser); cy.visit(`/collections/${this.testCollection.uuid}`); - // Rename 'bar' to 'subdir/foo' + + cy.get('[data-cy=linear-progress]').should('exist'); cy.get('[data-cy=linear-progress]').should('not.exist'); + + // Rename 'bar' to 'subdir/foo' cy.get('[data-cy=collection-files-panel]') .contains('bar').rightclick(); cy.get('[data-cy=context-menu]') @@ -214,7 +223,7 @@ describe('Collection panel tests', function() { }); }); - it('tries to rename a file with an illegal names', function() { + it('tries to rename a file with illegal names', function() { // Creates the collection using the admin token so we can set up // a bogus manifest text without block signatures. cy.createCollection(adminUser.token, { @@ -224,6 +233,10 @@ describe('Collection panel tests', function() { .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'); + const illegalNamesFromUI = [ ['.', "Name cannot be '.' or '..'"], ['..', "Name cannot be '.' or '..'"], @@ -234,7 +247,6 @@ describe('Collection panel tests', function() { ['//foo', 'Empty dir name not allowed'] ] illegalNamesFromUI.forEach(([name, errMsg]) => { - cy.get('[data-cy=linear-progress]').should('not.exist'); cy.get('[data-cy=collection-files-panel]') .contains('bar').rightclick(); cy.get('[data-cy=context-menu]') @@ -299,6 +311,10 @@ 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.get('[data-cy=collection-info-panel]').should('contain', 'This is an old version'); cy.get('[data-cy=read-only-icon]').should('exist'); cy.get('[data-cy=collection-info-panel]').should('contain', colName); @@ -320,6 +336,10 @@ describe('Collection panel tests', 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.get('[data-cy=collection-info-panel]').should('not.contain', 'This is an old version'); cy.get('[data-cy=read-only-icon]').should('not.exist'); cy.get('[data-cy=collection-version-number]').should('contain', '1'); diff --git a/cypress/integration/delete-multiple-files.spec.js b/cypress/integration/delete-multiple-files.spec.js index 2c7f4840..0955f56a 100644 --- a/cypress/integration/delete-multiple-files.spec.js +++ b/cypress/integration/delete-multiple-files.spec.js @@ -2,7 +2,7 @@ // // SPDX-License-Identifier: AGPL-3.0 -describe('Collection panel tests', function () { +describe('Multi-file deletion tests', function () { let activeUser; let adminUser; @@ -33,6 +33,10 @@ describe('Collection panel tests', function () { .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.get('[data-cy=collection-files-panel]').within(() => { cy.get('[type="checkbox"]').first().check(); cy.get('[type="checkbox"]').last().check(); @@ -56,6 +60,9 @@ describe('Collection panel tests', 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.get('[data-cy=virtual-file-tree] > div > i').first().click(); cy.get('[data-cy=collection-files-panel]') .should('contain', 'foo'); diff --git a/cypress/support/commands.js b/cypress/support/commands.js index 228e1cab..c2b222a7 100644 --- a/cypress/support/commands.js +++ b/cypress/support/commands.js @@ -166,6 +166,8 @@ Cypress.Commands.add( Cypress.Commands.add( "loginAs", (user) => { cy.visit(`/token/?api_token=${user.token}`); + cy.get('[data-cy=loading-spinner]').should('exist'); + cy.get('[data-cy=loading-spinner]').should('not.exist'); cy.url().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/src/views/workbench/workbench-loading-screen.tsx b/src/views/workbench/workbench-loading-screen.tsx index 30401034..dd19fdf1 100644 --- a/src/views/workbench/workbench-loading-screen.tsx +++ b/src/views/workbench/workbench-loading-screen.tsx @@ -27,6 +27,6 @@ const styles: StyleRulesCallback = (theme: ArvadosTheme) => ({ export const WorkbenchLoadingScreen = withStyles(styles)(({ classes }: WithStyles) => - + );