n8n/cypress/pages/demo.ts

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

22 lines
510 B
TypeScript
Raw Normal View History

/**
* Actions
*/
export function vistDemoPage(theme?: 'dark' | 'light') {
const query = theme ? `?theme=${theme}` : '';
cy.visit('/workflows/demo' + query);
cy.waitForLoad();
cy.window().then((win) => {
// @ts-ignore
win.preventNodeViewBeforeUnload = true;
});
}
export function importWorkflow(workflow: object) {
const OPEN_WORKFLOW = {command: 'openWorkflow', workflow};
cy.window().then($window => {
const message = JSON.stringify(OPEN_WORKFLOW);
$window.postMessage(message, '*')
});
}