Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: Increase viewport width/height to macbook-16 (no-changelog) #12450

Closed
wants to merge 7 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions cypress/cypress.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,7 @@ module.exports = defineConfig({
screenshotsFolder: 'screenshots',
videosFolder: 'videos',
},
// macbook-16 https://docs.cypress.io/api/commands/viewport
viewportHeight: 960,
viewportWidth: 1536,
});
2 changes: 1 addition & 1 deletion cypress/e2e/12-canvas-actions.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ describe('Canvas Actions', () => {
WorkflowPage.getters.nodeViewBackground().click(600, 200, { force: true });
WorkflowPage.getters.nodeConnections().should('have.length', 1);

WorkflowPage.getters.nodeViewBackground().click(600, 400, { force: true });
WorkflowPage.getters.nodeViewBackground().click(800, 600, { force: true });
WorkflowPage.actions.addNodeToCanvas(EDIT_FIELDS_SET_NODE_NAME);

// Change connection from Set to Set1
Expand Down
2 changes: 0 additions & 2 deletions cypress/e2e/14-mapping.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,6 @@ describe('Data mapping', () => {
});

it('maps expressions from json view', () => {
// ADO-3063 - followup to make this viewport global
cy.viewport('macbook-16');
cy.fixture('Test_workflow_3.json').then((data) => {
cy.get('body').paste(JSON.stringify(data));
});
Expand Down
5 changes: 3 additions & 2 deletions cypress/e2e/20-workflow-executions.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ const executionsRefreshInterval = 4000;
describe('Workflow Executions', () => {
describe('when workflow is saved', () => {
beforeEach(() => {
cy.viewport(1000, 660);
workflowPage.actions.visit();
cy.createFixtureWorkflow('Test_workflow_4_executions_view.json', 'My test workflow');
});
Expand All @@ -25,7 +26,7 @@ describe('Workflow Executions', () => {

cy.wait(['@getExecutions']);

executionsTab.getters.executionsList().scrollTo(0, 500).wait(0);
executionsTab.getters.executionsList().scrollTo(0, 1000).wait(0);

executionsTab.getters.executionListItems().should('have.length', 11);
executionsTab.getters.successfulExecutionListItems().should('have.length', 9);
Expand Down Expand Up @@ -195,7 +196,7 @@ describe('Workflow Executions', () => {

cy.wait(['@getExecutions']);

executionsTab.getters.executionsList().scrollTo(0, 500).wait(0);
executionsTab.getters.executionsList().scrollTo(0, 1000).wait(0);

executionsTab.getters.executionListItems().eq(10).click();

Expand Down
43 changes: 22 additions & 21 deletions cypress/e2e/25-stickies.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@

describe('Canvas Actions', () => {
beforeEach(() => {
// cy.viewport(1000, 660);
workflowPage.actions.visit();
cy.get('#collapse-change-button').should('be.visible').click();
cy.get('#side-menu[class*=collapsed i]').should('be.visible');
Expand Down Expand Up @@ -99,85 +100,85 @@
moveSticky({ top: 200, left: 200 });

cy.drag('[data-test-id="sticky"] [data-dir="right"]', [100, 100]);
checkStickiesStyle(100, 20, 160, 346);
checkStickiesStyle(120, 40, 160, 346);

cy.drag('[data-test-id="sticky"] [data-dir="right"]', [-50, -50]);
checkStickiesStyle(100, 20, 160, 302);
checkStickiesStyle(120, 40, 160, 302);
});

it('expands/shrinks sticky from the left edge', () => {
addDefaultSticky();

moveSticky({ left: 600, top: 200 });
cy.drag('[data-test-id="sticky"] [data-dir="left"]', [100, 100]);
checkStickiesStyle(100, 510, 160, 150);
checkStickiesStyle(120, 530, 160, 150);

cy.drag('[data-test-id="sticky"] [data-dir="left"]', [-50, -50]);
checkStickiesStyle(100, 466, 160, 194);
checkStickiesStyle(120, 486, 160, 194);
});

it('expands/shrinks sticky from the top edge', () => {
workflowPage.actions.addSticky();
cy.drag('[data-test-id="sticky"]', [100, 100]); // move away from canvas button
checkStickiesStyle(300, 620, 160, 240);
checkStickiesStyle(460, 900, 160, 240);

cy.drag('[data-test-id="sticky"] [data-dir="top"]', [100, 100]);
checkStickiesStyle(380, 620, 80, 240);
checkStickiesStyle(540, 900, 80, 240);

cy.drag('[data-test-id="sticky"] [data-dir="top"]', [-50, -50]);
checkStickiesStyle(324, 620, 136, 240);
checkStickiesStyle(484, 900, 136, 240);
});

it('expands/shrinks sticky from the bottom edge', () => {
workflowPage.actions.addSticky();
cy.drag('[data-test-id="sticky"]', [100, 100]); // move away from canvas button
checkStickiesStyle(300, 620, 160, 240);
checkStickiesStyle(460, 900, 160, 240);

cy.drag('[data-test-id="sticky"] [data-dir="bottom"]', [100, 100]);
checkStickiesStyle(300, 620, 254, 240);
checkStickiesStyle(460, 900, 254, 240);

cy.drag('[data-test-id="sticky"] [data-dir="bottom"]', [-50, -50]);
checkStickiesStyle(300, 620, 198, 240);
checkStickiesStyle(460, 900, 198, 240);
});

it('expands/shrinks sticky from the bottom right edge', () => {
workflowPage.actions.addSticky();
cy.drag('[data-test-id="sticky"]', [-100, -100]); // move away from canvas button
checkStickiesStyle(100, 420, 160, 240);
checkStickiesStyle(260, 700, 160, 240);

cy.drag('[data-test-id="sticky"] [data-dir="bottomRight"]', [100, 100]);
checkStickiesStyle(100, 420, 254, 346);
checkStickiesStyle(260, 700, 254, 346);

cy.drag('[data-test-id="sticky"] [data-dir="bottomRight"]', [-50, -50]);
checkStickiesStyle(100, 420, 198, 302);
checkStickiesStyle(260, 700, 198, 302);
});

it('expands/shrinks sticky from the top right edge', () => {
addDefaultSticky();

cy.drag('[data-test-id="sticky"] [data-dir="topRight"]', [100, 100]);
checkStickiesStyle(360, 400, 80, 346);
checkStickiesStyle(520, 680, 80, 346);

cy.drag('[data-test-id="sticky"] [data-dir="topRight"]', [-50, -50]);
checkStickiesStyle(304, 400, 136, 302);
checkStickiesStyle(464, 680, 136, 302);
});

it('expands/shrinks sticky from the top left edge, and reach min height/width', () => {
addDefaultSticky();

cy.drag('[data-test-id="sticky"] [data-dir="topLeft"]', [100, 100]);
checkStickiesStyle(360, 490, 80, 150);
checkStickiesStyle(520, 770, 80, 150);

cy.drag('[data-test-id="sticky"] [data-dir="topLeft"]', [-150, -150]);
checkStickiesStyle(204, 346, 236, 294);
checkStickiesStyle(364, 626, 236, 294);
});

it('sets sticky behind node', () => {
it.only('sets sticky behind node', () => {

Check failure on line 176 in cypress/e2e/25-stickies.cy.ts

View workflow job for this annotation

GitHub Actions / Lint / Lint

Remove `.only()` call
workflowPage.actions.addInitialNodeToCanvas('Manual Trigger');
addDefaultSticky();

cy.drag('[data-test-id="sticky"] [data-dir="topLeft"]', [-150, -150]);
checkStickiesStyle(124, 256, 316, 384, -121);
checkStickiesStyle(284, 536, 316, 384, -121);

workflowPage.getters
.canvasNodes()
Expand Down Expand Up @@ -265,8 +266,8 @@
}

function stickyShouldBePositionedCorrectly(position: Position) {
const yOffset = -100;
const xOffset = -180;
const yOffset = -80;
const xOffset = -160;
workflowPage.getters.stickies().should(($el) => {
expect($el).to.have.css('top', `${yOffset + position.top}px`);
expect($el).to.have.css('left', `${xOffset + position.left}px`);
Expand Down
Loading