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', () => {
|
2023-02-24 09:07:35 -08:00
|
|
|
before(() => {
|
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', () => {
|
2023-02-17 06:08:26 -08:00
|
|
|
WorkflowPage.actions.addInitialNodeToCanvas('Manual');
|
2022-11-28 07:54:13 -08:00
|
|
|
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();
|
2023-02-17 06:08:26 -08:00
|
|
|
WorkflowPage.actions.addInitialNodeToCanvas('Manual');
|
2022-11-28 07:54:13 -08:00
|
|
|
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');
|
|
|
|
});
|
|
|
|
});
|