});
});
- 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, {
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',
+ 'View details',
'Open in new tab',
'Outputs',
+ 'API Details',
+ 'Edit process',
+ 'Copy and re-run process',
+ 'CANCEL',
'Remove',
- 'Share',
- 'View details',
+ 'Add to favorites',
];
createContainerRequest(
// Fake submitted by another user
cy.intercept({ method: "GET", url: "**/arvados/v1/container_requests/*" }, req => {
- req.reply(res => {
+ req.on('response', res => {
res.body.modified_by_user_uuid = "zzzzz-tpzed-000000000000000";
});
});
// Force container_count for testing
let containerCount = 2;
cy.intercept({ method: "GET", url: "**/arvados/v1/container_requests/*" }, req => {
- req.reply(res => {
+ req.on('response', res => {
res.body.container_count = containerCount;
});
});
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();
) {
// Fake container uuid
cy.intercept({ method: "GET", url: `**/arvados/v1/container_requests/${containerRequest.uuid}` }, req => {
- req.reply(res => {
+ req.on('response', res => {
res.body.output_uuid = fakeCrUuid;
res.body.priority = 500;
res.body.state = "Committed";
) {
// Fake container uuid
cy.intercept({ method: "GET", url: `**/arvados/v1/container_requests/${containerRequest.uuid}` }, req => {
- req.reply(res => {
+ req.on('response', res => {
res.body.output_uuid = fakeCrLockedUuid;
res.body.priority = 500;
res.body.state = "Committed";
) {
// Fake container uuid
cy.intercept({ method: "GET", url: `**/arvados/v1/container_requests/${containerRequest.uuid}` }, req => {
- req.reply(res => {
+ req.on('response', res => {
res.body.output_uuid = fakeCrOnHoldUuid;
res.body.priority = 0;
res.body.state = "Committed";
describe("Logs panel", function () {
it("shows live process logs", function () {
cy.intercept({ method: "GET", url: "**/arvados/v1/containers/*" }, req => {
- req.reply(res => {
+ req.on('response', res => {
res.body.state = ContainerState.RUNNING;
});
});
});
});
});
+
+ 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 () {
cy.getAll("@testOutputCollection").then(([testOutputCollection]) => {
// Add output uuid and inputs to container request
cy.intercept({ method: "GET", url: "**/arvados/v1/container_requests/*" }, req => {
- req.reply(res => {
+ req.on('response', res => {
res.body.output_uuid = testOutputCollection.uuid;
res.body.mounts["/var/lib/cwl/cwl.input.json"] = {
content: testInputs.map(param => param.input).reduce((acc, val) => Object.assign(acc, val), {}),
// Add output uuid and inputs to container request
cy.intercept({ method: "GET", url: "**/arvados/v1/container_requests/*" }, req => {
- req.reply(res => {
+ req.on('response', res => {
res.body.output_uuid = fakeOutputUUID;
res.body.mounts["/var/lib/cwl/cwl.input.json"] = {
content: {},