X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/3ed6fab9c3ec7ca31133e4d4c750d546727b1847..e5b8b03317deca9ecf858a9fb5695c2e665a7a59:/services/workbench2/cypress/integration/process.spec.js diff --git a/services/workbench2/cypress/integration/process.spec.js b/services/workbench2/cypress/integration/process.spec.js index 438acbf14d..f647560a5f 100644 --- a/services/workbench2/cypress/integration/process.spec.js +++ b/services/workbench2/cypress/integration/process.spec.js @@ -90,6 +90,50 @@ describe("Process tests", function () { }); } + describe('Multiselect Toolbar', () => { + it('shows the appropriate buttons in the toolbar', () => { + + const msButtonTooltips = [ + 'API Details', + 'Add to Favorites', + 'CANCEL', + 'Copy and re-run process', + 'Edit process', + 'Move to', + 'Open in new tab', + 'Outputs', + 'Remove', + 'Share', + 'View details', + ]; + + createContainerRequest( + activeUser, + `test_container_request ${Math.floor(Math.random() * 999999)}`, + "arvados/jobs", + ["echo", "hello world"], + false, + "Committed" + ).then(function (containerRequest) { + cy.loginAs(activeUser); + cy.goToPath(`/processes/${containerRequest.uuid}`); + cy.get("[data-cy=process-details]").should("contain", containerRequest.name); + cy.get("[data-cy=process-details-attributes-modifiedby-user]").contains(`Active User (${activeUser.user.uuid})`); + cy.get("[data-cy=process-details-attributes-runtime-user]").should("not.exist"); + cy.get("[data-cy=side-panel-tree]").contains("Home Projects").click(); + cy.waitForDom() + cy.get('[data-cy=data-table-row]').contains(containerRequest.name).should('exist').parent().parent().parent().parent().click() + cy.waitForDom() + cy.get('[data-cy=multiselect-button]').should('have.length', msButtonTooltips.length) + for (let i = 0; i < msButtonTooltips.length; i++) { + cy.get('[data-cy=multiselect-button]').eq(i).trigger('mouseover'); + cy.get('body').contains(msButtonTooltips[i]).should('exist') + cy.get('[data-cy=multiselect-button]').eq(i).trigger('mouseout'); + } + }); + }) + }) + describe("Details panel", function () { it("shows process details", function () { createContainerRequest( @@ -556,6 +600,53 @@ describe("Process tests", function () { }); }); + it("preserves original ordering of lines within the same log type", function () { + const crName = "test_container_request"; + createContainerRequest(activeUser, crName, "arvados/jobs", ["echo", "hello world"], false, "Committed").then(function (containerRequest) { + cy.appendLog(adminUser.token, containerRequest.uuid, "stdout.txt", [ + // Should come first + "2023-07-18T20:14:46.000000000Z A out 1", + // Comes fourth in a contiguous block + "2023-07-18T20:14:48.128642814Z A out 2", + "2023-07-18T20:14:48.128642814Z X out 3", + "2023-07-18T20:14:48.128642814Z A out 4", + ]).as("stdout"); + + cy.appendLog(adminUser.token, containerRequest.uuid, "stderr.txt", [ + // Comes second + "2023-07-18T20:14:47.000000000Z Z err 1", + // Comes third in a contiguous block + "2023-07-18T20:14:48.128642814Z B err 2", + "2023-07-18T20:14:48.128642814Z C err 3", + "2023-07-18T20:14:48.128642814Z Y err 4", + "2023-07-18T20:14:48.128642814Z Z err 5", + "2023-07-18T20:14:48.128642814Z A err 6", + ]).as("stderr"); + + cy.loginAs(activeUser); + cy.goToPath(`/processes/${containerRequest.uuid}`); + cy.get("[data-cy=process-details]").should("contain", crName); + cy.get("[data-cy=process-logs]").should("contain", "No logs yet"); + + cy.getAll("@stdout", "@stderr").then(() => { + // Switch to All logs + cy.get("[data-cy=process-logs-filter]").click(); + cy.get("body").contains("li", "All logs").click(); + // Verify sorted logs + cy.get("[data-cy=process-logs] pre").eq(0).should("contain", "2023-07-18T20:14:46.000000000Z A out 1"); + cy.get("[data-cy=process-logs] pre").eq(1).should("contain", "2023-07-18T20:14:47.000000000Z Z err 1"); + cy.get("[data-cy=process-logs] pre").eq(2).should("contain", "2023-07-18T20:14:48.128642814Z B err 2"); + cy.get("[data-cy=process-logs] pre").eq(3).should("contain", "2023-07-18T20:14:48.128642814Z C err 3"); + cy.get("[data-cy=process-logs] pre").eq(4).should("contain", "2023-07-18T20:14:48.128642814Z Y err 4"); + cy.get("[data-cy=process-logs] pre").eq(5).should("contain", "2023-07-18T20:14:48.128642814Z Z err 5"); + cy.get("[data-cy=process-logs] pre").eq(6).should("contain", "2023-07-18T20:14:48.128642814Z A err 6"); + cy.get("[data-cy=process-logs] pre").eq(7).should("contain", "2023-07-18T20:14:48.128642814Z A out 2"); + cy.get("[data-cy=process-logs] pre").eq(8).should("contain", "2023-07-18T20:14:48.128642814Z X out 3"); + cy.get("[data-cy=process-logs] pre").eq(9).should("contain", "2023-07-18T20:14:48.128642814Z A out 4"); + }); + }); + }); + it("correctly generates sniplines", function () { const SNIPLINE = `================ ✀ ================ ✀ ========= Some log(s) were skipped ========= ✀ ================ ✀ ================`; const crName = "test_container_request"; @@ -1273,7 +1364,7 @@ describe("Process tests", function () { cy.getAll("@containerRequest", "@testOutputCollection").then(function ([containerRequest, testOutputCollection]) { cy.goToPath(`/processes/${containerRequest.uuid}`); cy.get("[data-cy=process-io-card] h6") - .contains("Inputs") + .contains("Input Parameters") .parents("[data-cy=process-io-card]") .within(() => { verifyIOParameter("input_file", null, "Label Description", "input1.tar", "00000000000000000000000000000000+01"); @@ -1308,7 +1399,7 @@ describe("Process tests", function () { verifyIOParameter("input_file_url", null, null, "http://example.com/index.html"); }); cy.get("[data-cy=process-io-card] h6") - .contains("Outputs") + .contains("Output Parameters") .parents("[data-cy=process-io-card]") .within(ctx => { cy.get(ctx).scrollIntoView(); @@ -1405,8 +1496,10 @@ describe("Process tests", function () { cy.getAll("@containerRequest").then(function ([containerRequest]) { cy.goToPath(`/processes/${containerRequest.uuid}`); + cy.waitForDom(); + cy.get("[data-cy=process-io-card] h6") - .contains("Inputs") + .contains("Input Parameters") .parents("[data-cy=process-io-card]") .within(() => { cy.wait(2000); @@ -1416,7 +1509,7 @@ describe("Process tests", function () { }); }); cy.get("[data-cy=process-io-card] h6") - .contains("Outputs") + .contains("Output Parameters") .parents("[data-cy=process-io-card]") .within(() => { cy.get("tbody tr").each(item => {