X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/75eb080fec293c283ce934c5c82cfeee85bee4c1..b4f14437823e9201e9cd952a4f6f3b1502b583bd:/cypress/integration/process.spec.js diff --git a/cypress/integration/process.spec.js b/cypress/integration/process.spec.js index 00a6631bcd..64f27c50b5 100644 --- a/cypress/integration/process.spec.js +++ b/cypress/integration/process.spec.js @@ -2,6 +2,8 @@ // // SPDX-License-Identifier: AGPL-3.0 +import { ContainerState } from 'models/container'; + describe('Process tests', function() { let activeUser; let adminUser; @@ -415,6 +417,12 @@ describe('Process tests', function() { describe('Logs panel', function() { it('shows live process logs', function() { + cy.intercept({method: 'GET', url: '**/arvados/v1/containers/*'}, (req) => { + req.reply((res) => { + res.body.state = ContainerState.RUNNING; + }); + }); + const crName = 'test_container_request'; createContainerRequest( activeUser, @@ -423,6 +431,11 @@ describe('Process tests', function() { ['echo', 'hello world'], false, 'Committed') .then(function(containerRequest) { + // Create empty log file before loading process page + cy.appendLog(adminUser.token, containerRequest.uuid, "stdout.txt", [ + "" + ]) + cy.loginAs(activeUser); cy.goToPath(`/processes/${containerRequest.uuid}`); cy.get('[data-cy=process-details]').should('contain', crName); @@ -430,6 +443,7 @@ describe('Process tests', function() { .should('contain', 'No logs yet') .and('not.contain', 'hello world'); + // Append a log line cy.appendLog(adminUser.token, containerRequest.uuid, "stdout.txt", [ "2023-07-18T20:14:48.128642814Z hello world" ]).then(() => { @@ -438,6 +452,7 @@ describe('Process tests', function() { .and('contain', 'hello world'); }); + // Append new log line to different file cy.appendLog(adminUser.token, containerRequest.uuid, "stderr.txt", [ "2023-07-18T20:14:49.128642814Z hello new line" ]).then(() => {