test(editor): Prevent node view unload by default in e2e run (#6787)

Signed-off-by: Oleg Ivaniv <me@olegivaniv.com>
This commit is contained in:
OlegIvaniv 2023-07-28 16:46:26 +02:00 committed by GitHub
parent 11a3965ba8
commit e824ab057d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 5 additions and 21 deletions

View file

@ -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', () => {

View file

@ -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', () => {

View file

@ -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', () => {

View file

@ -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', () => {

View file

@ -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();