2023-02-24 09:07:35 -08:00
|
|
|
import { WorkflowPage } from '../pages';
|
|
|
|
import { WorkflowExecutionsTab } from '../pages/workflow-executions-tab';
|
2023-02-14 02:39:19 -08:00
|
|
|
|
|
|
|
const workflowPage = new WorkflowPage();
|
|
|
|
const executionsTab = new WorkflowExecutionsTab();
|
|
|
|
|
|
|
|
// Test suite for executions tab
|
|
|
|
describe('Current Workflow Executions', () => {
|
2023-02-24 09:07:35 -08:00
|
|
|
beforeEach(() => {
|
2023-02-14 02:39:19 -08:00
|
|
|
workflowPage.actions.visit();
|
|
|
|
cy.createFixtureWorkflow('Test_workflow_4_executions_view.json', `My test workflow`);
|
|
|
|
createMockExecutions();
|
|
|
|
});
|
|
|
|
|
|
|
|
it('should render executions tab correctly', () => {
|
2023-03-02 07:50:21 -08:00
|
|
|
cy.intercept('GET', '/rest/executions?filter=*').as('getExecutions');
|
|
|
|
cy.intercept('GET', '/rest/executions-current?filter=*').as('getCurrentExecutions');
|
|
|
|
|
|
|
|
executionsTab.actions.switchToExecutionsTab();
|
|
|
|
|
|
|
|
cy.wait(['@getExecutions', '@getCurrentExecutions']);
|
|
|
|
|
2023-02-14 02:39:19 -08:00
|
|
|
executionsTab.getters.executionListItems().should('have.length', 11);
|
|
|
|
executionsTab.getters.successfulExecutionListItems().should('have.length', 9);
|
|
|
|
executionsTab.getters.failedExecutionListItems().should('have.length', 2);
|
2023-02-24 09:07:35 -08:00
|
|
|
executionsTab.getters
|
|
|
|
.executionListItems()
|
|
|
|
.first()
|
|
|
|
.invoke('attr', 'class')
|
|
|
|
.should('match', /_active_/);
|
2023-02-14 02:39:19 -08:00
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
const createMockExecutions = () => {
|
|
|
|
executionsTab.actions.createManualExecutions(5);
|
|
|
|
// Make some failed executions by enabling Code node with syntax error
|
|
|
|
executionsTab.actions.toggleNodeEnabled('Error');
|
|
|
|
executionsTab.actions.createManualExecutions(2);
|
|
|
|
// Then add some more successful ones
|
|
|
|
executionsTab.actions.toggleNodeEnabled('Error');
|
|
|
|
executionsTab.actions.createManualExecutions(4);
|
2023-02-24 09:07:35 -08:00
|
|
|
};
|