Add test guards to wait for progress bar to complete before continuing
authorPeter Amstutz <peter.amstutz@curii.com>
Fri, 8 Jan 2021 19:28:20 +0000 (14:28 -0500)
committerPeter Amstutz <peter.amstutz@curii.com>
Fri, 8 Jan 2021 19:28:20 +0000 (14:28 -0500)
no issue #

Arvados-DCO-1.1-Signed-off-by: Peter Amstutz <peter.amstutz@curii.com>

cypress/integration/collection-panel.spec.js
src/views/main-panel/main-panel-root.tsx

index 23ba682e51c27bdba42e9b1a975edcfb56efdaaa..b86ff2a7d39143fe6c3d66c813abdfaec386085c 100644 (file)
@@ -52,6 +52,7 @@ describe('Collection panel tests', function() {
                     })
                     cy.visit(`/collections/${this.testCollection.uuid}`);
                     // Check that name & uuid are correct.
+                    cy.get('[data-cy=linear-progress]').should('not.exist');
                     cy.get('[data-cy=collection-info-panel]')
                         .should('contain', this.testCollection.name)
                         .and('contain', this.testCollection.uuid)
@@ -146,6 +147,7 @@ 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]')
@@ -175,6 +177,7 @@ describe('Collection panel tests', function() {
             cy.loginAs(activeUser);
             cy.visit(`/collections/${this.testCollection.uuid}`);
             // Rename 'bar' to 'subdir/foo'
+            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]')
@@ -231,6 +234,7 @@ 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]')
index acaa43ad2b8b67741ae6babf238d65f38cf832fa..8f41ff3d96d1965ca1a5f1e07a71714ac3e30a9a 100644 (file)
@@ -48,7 +48,7 @@ export const MainPanelRoot = withStyles(styles)(
                     uuidPrefix={uuidPrefix}
                     siteBanner={siteBanner}>
                     {working
-                        ? <LinearProgress color="secondary" />
+                        ? <LinearProgress color="secondary" data-cy="linear-progress" />
                         : null}
                 </MainAppBar>}
                 <Grid container direction="column" className={classes.root}>