X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/3517c774109e6588ee94f317994939d3976b3850..be3378300d63ce537a5843c5fc23ecd76f4f1f5c:/services/workbench2/cypress/e2e/process.cy.js diff --git a/services/workbench2/cypress/e2e/process.cy.js b/services/workbench2/cypress/e2e/process.cy.js index 38d99273d6..ca13e9f9e0 100644 --- a/services/workbench2/cypress/e2e/process.cy.js +++ b/services/workbench2/cypress/e2e/process.cy.js @@ -25,11 +25,6 @@ describe("Process tests", function () { }); }); - beforeEach(function () { - cy.clearCookies(); - cy.clearLocalStorage(); - }); - function setupDockerImage(image_name) { // Create a collection that will be used as a docker image for the tests. cy.createCollection(adminUser.token, { @@ -337,6 +332,7 @@ describe("Process tests", function () { createContainerRequest(activeUser, crUncommitted, "arvados/jobs", ["echo", "hello world"], false, "Uncommitted").then(function ( containerRequest ) { + cy.loginAs(activeUser); // Navigate to process and verify run / cancel button cy.goToPath(`/processes/${containerRequest.uuid}`); cy.waitForDom(); @@ -678,6 +674,51 @@ describe("Process tests", function () { }); }); }); + + it("correctly break long lines when no obvious line separation exists", function () { + function randomString(length) { + const chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'; + let res = ''; + for (let i = 0; i < length; i++) { + res += chars.charAt(Math.floor(Math.random() * chars.length)); + } + return res; + } + + const logLinesQty = 10; + const logLines = []; + for (let i = 0; i < logLinesQty; i++) { + const length = Math.floor(Math.random() * 500) + 500; + logLines.push(randomString(length)); + } + + createContainerRequest(activeUser, "test_container_request", "arvados/jobs", ["echo", "hello world"], false, "Committed").then(function ( + containerRequest + ) { + cy.appendLog(adminUser.token, containerRequest.uuid, "stdout.txt", logLines).as("stdoutLogs"); + + cy.getAll("@stdoutLogs").then(function () { + cy.loginAs(activeUser); + cy.goToPath(`/processes/${containerRequest.uuid}`); + // Select 'stdout' log filter + cy.get("[data-cy=process-logs-filter]").click(); + cy.get("body").contains("li", "stdout").click(); + cy.get("[data-cy=process-logs] span > p") + .should('have.length', logLinesQty) + .each($p => { + expect($p.text().length).to.be.greaterThan(499); + + // This looks like an ugly hack, but I was not able + // to get [client|scroll]Width attributes through + // the usual Cypress methods. + const parentClientWidth = $p[0].parentElement.clientWidth; + const parentScrollWidth = $p[0].parentElement.scrollWidth + // Scrollbar should not be visible + expect(parentClientWidth).to.be.eq(parentScrollWidth); + }); + }); + }); + }); }); describe("I/O panel", function () {