n8n/cypress/e2e/6-code-node.cy.ts
Mutasem Aldmour a89c9c68d1
test: Add tests for pinning data (#5157)
* test: add tests for pinning

* test: add test for value

* test: add pinned data tests

* test: refactor into ndv

* refactor: move to ndv

* refactor: rename node

* test: fix test

* test: fix refactor

* test: remove unused id

* test: update test

* test: chain rename input

* test: refactor invoking text

* test: fix ndv tests

* test: move test id

* test: update selectors
2023-01-18 15:48:36 +01:00

37 lines
1.1 KiB
TypeScript

import { WorkflowPage as WorkflowPageClass } from '../pages/workflow';
import { NDV } from '../pages/ndv';
const WorkflowPage = new WorkflowPageClass();
const ndv = new NDV();
describe('Code node', () => {
beforeEach(() => {
cy.resetAll();
cy.skipSetup();
});
it('should execute the placeholder in all-items mode successfully', () => {
WorkflowPage.actions.visit();
WorkflowPage.actions.addInitialNodeToCanvas('Manual Trigger');
WorkflowPage.actions.addNodeToCanvas('Code');
WorkflowPage.actions.openNode('Code');
ndv.actions.execute();
WorkflowPage.getters.successToast().contains('Node executed successfully');
});
it('should execute the placeholder in each-item mode successfully', () => {
WorkflowPage.actions.visit();
WorkflowPage.actions.addInitialNodeToCanvas('Manual Trigger');
WorkflowPage.actions.addNodeToCanvas('Code');
WorkflowPage.actions.openNode('Code');
ndv.getters.parameterInput('mode').click();
ndv.actions.selectOptionInParameterDropdown('mode', 'Run Once for Each Item');
ndv.actions.execute();
WorkflowPage.getters.successToast().contains('Node executed successfully');
});
});