2024-11-01 06:04:58 -07:00
|
|
|
import { getOutputTableRow } from '../composables/ndv';
|
|
|
|
import { getCanvasNodes, openNode } from '../composables/workflow';
|
|
|
|
import SIMPLE_WORKFLOW from '../fixtures/Manual_wait_set.json';
|
|
|
|
import WORKFLOW_WITH_PINNED from '../fixtures/Webhook_set_pinned.json';
|
2024-07-03 06:14:26 -07:00
|
|
|
import { importWorkflow, visitDemoPage } from '../pages/demo';
|
|
|
|
import { errorToast } from '../pages/notifications';
|
2023-11-02 08:06:33 -07:00
|
|
|
|
|
|
|
describe('Demo', () => {
|
2024-07-03 06:14:26 -07:00
|
|
|
beforeEach(() => {
|
|
|
|
cy.overrideSettings({ previewMode: true });
|
|
|
|
});
|
|
|
|
|
2023-11-02 08:06:33 -07:00
|
|
|
it('can import template', () => {
|
2024-07-03 06:14:26 -07:00
|
|
|
visitDemoPage();
|
|
|
|
errorToast().should('not.exist');
|
2024-11-01 06:04:58 -07:00
|
|
|
importWorkflow(SIMPLE_WORKFLOW);
|
|
|
|
getCanvasNodes().should('have.length', 3);
|
|
|
|
});
|
|
|
|
|
|
|
|
it('can import workflow with pin data', () => {
|
|
|
|
visitDemoPage();
|
|
|
|
importWorkflow(WORKFLOW_WITH_PINNED);
|
|
|
|
getCanvasNodes().should('have.length', 2);
|
|
|
|
openNode('Webhook');
|
|
|
|
getOutputTableRow(0).should('include.text', 'headers');
|
|
|
|
getOutputTableRow(1).should('include.text', 'dragons');
|
2023-11-02 08:06:33 -07:00
|
|
|
});
|
|
|
|
|
|
|
|
it('can override theme to dark', () => {
|
2024-07-03 06:14:26 -07:00
|
|
|
visitDemoPage('dark');
|
2023-11-02 08:06:33 -07:00
|
|
|
cy.get('body').should('have.attr', 'data-theme', 'dark');
|
2024-07-03 06:14:26 -07:00
|
|
|
errorToast().should('not.exist');
|
2023-11-02 08:06:33 -07:00
|
|
|
});
|
|
|
|
|
|
|
|
it('can override theme to light', () => {
|
2024-07-03 06:14:26 -07:00
|
|
|
visitDemoPage('light');
|
2023-11-02 08:06:33 -07:00
|
|
|
cy.get('body').should('have.attr', 'data-theme', 'light');
|
2024-07-03 06:14:26 -07:00
|
|
|
errorToast().should('not.exist');
|
2023-11-02 08:06:33 -07:00
|
|
|
});
|
|
|
|
});
|