Skip to content

Commit

Permalink
test(editor): Prevent node view unload by default in e2e run (#6787)
Browse files Browse the repository at this point in the history
Signed-off-by: Oleg Ivaniv <[email protected]>
  • Loading branch information
OlegIvaniv committed Aug 3, 2023
1 parent ee8e7d4 commit 5140bcd
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 21 deletions.
5 changes: 0 additions & 5 deletions cypress/e2e/14-data-transformation-expressions.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,6 @@ const ndv = new NDV();
describe('Data transformation expressions', () => {
beforeEach(() => {
wf.actions.visit();

cy.window().then((win) => {
// @ts-ignore
win.preventNodeViewBeforeUnload = true;
});
});

it('$json + native string methods', () => {
Expand Down
5 changes: 0 additions & 5 deletions cypress/e2e/14-mapping.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,6 @@ const ndv = new NDV();
describe('Data mapping', () => {
beforeEach(() => {
workflowPage.actions.visit();

cy.window().then((win) => {
// @ts-ignore
win.preventNodeViewBeforeUnload = true;
});
});

it('maps expressions from table header', () => {
Expand Down
5 changes: 0 additions & 5 deletions cypress/e2e/16-webhook-node.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,11 +79,6 @@ const simpleWebhookCall = (options: SimpleWebhookCallOptions) => {
describe('Webhook Trigger node', async () => {
beforeEach(() => {
workflowPage.actions.visit();

cy.window().then((win) => {
// @ts-ignore
win.preventNodeViewBeforeUnload = true;
});
});

it('should listen for a GET request', () => {
Expand Down
5 changes: 0 additions & 5 deletions cypress/e2e/25-stickies.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,6 @@ function checkStickiesStyle(
describe('Canvas Actions', () => {
beforeEach(() => {
workflowPage.actions.visit();

cy.window().then((win) => {
// @ts-ignore
win.preventNodeViewBeforeUnload = true;
});
});

it('adds sticky to canvas with default text and position', () => {
Expand Down
6 changes: 5 additions & 1 deletion cypress/pages/workflow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,9 +115,13 @@ export class WorkflowPage extends BasePage {
editorTabButton: () => cy.getByTestId('radio-button-workflow'),
};
actions = {
visit: () => {
visit: (preventNodeViewUnload = true) => {
cy.visit(this.url);
cy.waitForLoad();
cy.window().then((win) => {
// @ts-ignore
win.preventNodeViewBeforeUnload = preventNodeViewUnload;
});
},
addInitialNodeToCanvas: (nodeDisplayName: string, { keepNdvOpen } = { keepNdvOpen: false }) => {
this.getters.canvasPlusButton().click();
Expand Down

0 comments on commit 5140bcd

Please sign in to comment.