20000: Cypress use specific selectors
authorStephen Smith <stephen@curii.com>
Thu, 16 Feb 2023 21:38:31 +0000 (16:38 -0500)
committerStephen Smith <stephen@curii.com>
Thu, 16 Feb 2023 21:38:31 +0000 (16:38 -0500)
Arvados-DCO-1.1-Signed-off-by: Stephen Smith <stephen@curii.com>

cypress/integration/process.spec.js
src/views/process-panel/process-details-card.tsx

index bd82700e0b13e32a49af2357de9552dd9b4918d6..19544c9ca543bcbc257b823df48f2d2eaf97fa6f 100644 (file)
@@ -1252,8 +1252,8 @@ describe('Process tests', function() {
             cy.goToPath(`/processes/${containerRequest.uuid}`);
             cy.waitForDom();
             cy.get('[data-cy=process-details]').should('contain', crUncommitted);
-            cy.get('[data-cy=process-details]').find('button').contains('Run');
-            cy.get('[data-cy=process-cancel]').should('not.exist');
+            cy.get('[data-cy=process-run-button]').should('exist');
+            cy.get('[data-cy=process-cancel-button]').should('not.exist');
         });
 
         // Queued container
@@ -1286,7 +1286,7 @@ describe('Process tests', function() {
             cy.goToPath(`/processes/${containerRequest.uuid}`);
             cy.waitForDom();
             cy.get('[data-cy=process-details]').should('contain', crQueued);
-            cy.get('[data-cy=process-cancel]').contains('Cancel');
+            cy.get('[data-cy=process-cancel-button]').contains('Cancel');
         });
 
         // Locked container
@@ -1319,7 +1319,7 @@ describe('Process tests', function() {
             cy.goToPath(`/processes/${containerRequest.uuid}`);
             cy.waitForDom();
             cy.get('[data-cy=process-details]').should('contain', crLocked);
-            cy.get('[data-cy=process-cancel]').contains('Cancel');
+            cy.get('[data-cy=process-cancel-button]').contains('Cancel');
         });
 
         // On Hold container
@@ -1350,10 +1350,10 @@ describe('Process tests', function() {
 
             // Navigate to process and verify cancel button
             cy.goToPath(`/processes/${containerRequest.uuid}`);
-            cy.get('[data-cy=process-details]').should('contain', crOnHold);
             cy.waitForDom();
-            cy.get('[data-cy=process-details]').find('button').contains('Run');
-            cy.get('[data-cy=process-cancel]').should('not.exist');
+            cy.get('[data-cy=process-details]').should('contain', crOnHold);
+            cy.get('[data-cy=process-run-button]').should('exist');
+            cy.get('[data-cy=process-cancel-button]').should('not.exist');
         });
     });
 
index 501d8644f26275dee283dd319e66197d3b6556a4..b8990b2f56630da55e5e338023eab2e82a8c5046 100644 (file)
@@ -120,6 +120,7 @@ export const ProcessDetailsCard = withStyles(styles)(
                     <div>
                         {runAction !== undefined &&
                             <Button
+                                data-cy="process-run-button"
                                 variant="contained"
                                 size="small"
                                 color="primary"
@@ -135,7 +136,7 @@ export const ProcessDetailsCard = withStyles(styles)(
                             process.containerRequest.priority !== null &&
                             process.containerRequest.priority > 0 &&
                             <Button
-                                data-cy="process-cancel"
+                                data-cy="process-cancel-button"
                                 variant="outlined"
                                 size="small"
                                 color="primary"