2022-11-28 07:54:13 -08:00
|
|
|
import { WorkflowPage as WorkflowPageClass } from '../pages/workflow';
|
2023-01-18 06:48:36 -08:00
|
|
|
import { NDV } from '../pages/ndv';
|
2022-11-28 07:54:13 -08:00
|
|
|
|
|
|
|
const WorkflowPage = new WorkflowPageClass();
|
2023-01-18 06:48:36 -08:00
|
|
|
const ndv = new NDV();
|
2022-11-28 07:54:13 -08:00
|
|
|
|
|
|
|
describe('Code node', () => {
|
|
|
|
beforeEach(() => {
|
2022-11-28 11:01:44 -08:00
|
|
|
cy.resetAll();
|
2022-11-28 07:54:13 -08:00
|
|
|
cy.skipSetup();
|
|
|
|
});
|
|
|
|
|
|
|
|
it('should execute the placeholder in all-items mode successfully', () => {
|
|
|
|
WorkflowPage.actions.visit();
|
|
|
|
WorkflowPage.actions.addInitialNodeToCanvas('Manual Trigger');
|
|
|
|
WorkflowPage.actions.addNodeToCanvas('Code');
|
2023-01-18 06:48:36 -08:00
|
|
|
WorkflowPage.actions.openNode('Code');
|
2022-11-28 07:54:13 -08:00
|
|
|
|
2023-01-18 06:48:36 -08:00
|
|
|
ndv.actions.execute();
|
2022-11-28 07:54:13 -08:00
|
|
|
|
|
|
|
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');
|
2023-01-18 06:48:36 -08:00
|
|
|
WorkflowPage.actions.openNode('Code');
|
|
|
|
ndv.getters.parameterInput('mode').click();
|
|
|
|
ndv.actions.selectOptionInParameterDropdown('mode', 'Run Once for Each Item');
|
2022-11-28 07:54:13 -08:00
|
|
|
|
2023-01-18 06:48:36 -08:00
|
|
|
ndv.actions.execute();
|
2022-11-28 07:54:13 -08:00
|
|
|
|
|
|
|
WorkflowPage.getters.successToast().contains('Node executed successfully');
|
|
|
|
});
|
|
|
|
});
|