mirror of
https://github.com/n8n-io/n8n.git
synced 2024-12-26 21:19:43 -08:00
21 lines
500 B
TypeScript
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, '*');
|
|
});
|
|
}
|