19093: Add cypress test for container_count warning
[arvados-workbench2.git] / cypress / integration / process.spec.js
index 3234f7c4bd5bcd04a89df3274642b467a2e3a2f6..faf70c49ec2fe93ec813b0cf821985e33ec81d9c 100644 (file)
@@ -95,7 +95,7 @@ describe('Process tests', function() {
         .then(function(containerRequest) {
             cy.loginAs(activeUser);
             cy.goToPath(`/processes/${containerRequest.uuid}`);
-            cy.get('[data-cy=process-info]').should('contain', crName);
+            cy.get('[data-cy=process-details]').should('contain', crName);
             cy.get('[data-cy=process-logs]')
                 .should('contain', 'No logs yet')
                 .and('not.contain', 'hello world');
@@ -244,5 +244,27 @@ describe('Process tests', function() {
                 .should('contain', 'Free disk space is low')
                 .and('contain', 'No additional warning details available');
         });
+
+
+        // Force container_count for testing
+        let containerCount = 2;
+        cy.intercept({method: 'GET', url: '**/arvados/v1/container_requests/*'}, (req) => {
+            req.reply((res) => {
+                res.body.container_count = containerCount;
+            });
+        });
+
+        cy.getAll('@containerRequest').then(function([containerRequest]) {
+            cy.goToPath(`/processes/${containerRequest.uuid}`);
+            cy.get('[data-cy=process-runtime-status-retry-warning]')
+                .should('contain', 'Process retried 1 time');
+        });
+
+        cy.getAll('@containerRequest').then(function([containerRequest]) {
+            containerCount = 3;
+            cy.goToPath(`/processes/${containerRequest.uuid}`);
+            cy.get('[data-cy=process-runtime-status-retry-warning]')
+                .should('contain', 'Process retried 2 times');
+        });
     });
-});
\ No newline at end of file
+});