n8n/cypress/pages/demo.ts
कारतोफ्फेलस्क्रिप्ट™ d0b1f62d96 Merge remote-tracking branch 'origin/master' into seatable_node_rework2
2024-09-30 15:55:45 +02:00

21 lines
500 B
TypeScript

/**
* Actions
*/
export function visitDemoPage(theme?: 'dark' | 'light') {
const query = theme ? `?theme=${theme}` : '';
cy.visit('/workflows/demo' + query);
cy.waitForLoad();
cy.window().then((win) => {
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, '*');
});
}