2023-08-16 08:13:57 -07:00
|
|
|
import { BasePage } from './base';
|
|
|
|
import { WorkflowPage } from './workflow';
|
2023-02-14 02:39:19 -08:00
|
|
|
|
|
|
|
const workflowPage = new WorkflowPage();
|
|
|
|
|
|
|
|
export class WorkflowExecutionsTab extends BasePage {
|
|
|
|
getters = {
|
|
|
|
executionsTabButton: () => cy.getByTestId('radio-button-executions'),
|
|
|
|
executionsSidebar: () => cy.getByTestId('executions-sidebar'),
|
|
|
|
autoRefreshCheckBox: () => cy.getByTestId('auto-refresh-checkbox'),
|
|
|
|
executionsList: () => cy.getByTestId('current-executions-list'),
|
|
|
|
executionListItems: () => this.getters.executionsList().find('div.execution-card'),
|
|
|
|
successfulExecutionListItems: () => cy.get('[data-test-execution-status="success"]'),
|
|
|
|
failedExecutionListItems: () => cy.get('[data-test-execution-status="error"]'),
|
|
|
|
executionCard: (executionId: string) => cy.getByTestId(`execution-details-${executionId}`),
|
|
|
|
executionPreviewDetails: () => cy.get('[data-test-id^="execution-preview-details-"]'),
|
2023-11-30 03:12:26 -08:00
|
|
|
executionPreviewDeleteButton: () => cy.get('[data-test-id="execution-preview-delete-button"]'),
|
2023-08-16 08:13:57 -07:00
|
|
|
executionPreviewDetailsById: (executionId: string) =>
|
|
|
|
cy.getByTestId(`execution-preview-details-${executionId}`),
|
|
|
|
executionPreviewTime: () =>
|
|
|
|
this.getters.executionPreviewDetails().find('[data-test-id="execution-time"]'),
|
|
|
|
executionPreviewStatus: () =>
|
|
|
|
this.getters.executionPreviewDetails().find('[data-test-id="execution-preview-label"]'),
|
|
|
|
executionPreviewId: () =>
|
|
|
|
this.getters.executionPreviewDetails().find('[data-test-id="execution-preview-id"]'),
|
2023-08-25 00:39:14 -07:00
|
|
|
executionDebugButton: () => cy.getByTestId('execution-debug-button'),
|
2023-02-14 02:39:19 -08:00
|
|
|
};
|
|
|
|
actions = {
|
|
|
|
toggleNodeEnabled: (nodeName: string) => {
|
|
|
|
workflowPage.getters.canvasNodeByName(nodeName).click();
|
|
|
|
cy.get('body').type('d', { force: true });
|
|
|
|
},
|
|
|
|
createManualExecutions: (count: number) => {
|
2023-08-16 08:13:57 -07:00
|
|
|
for (let i = 0; i < count; i++) {
|
2023-03-02 07:50:21 -08:00
|
|
|
cy.intercept('POST', '/rest/workflows/run').as('workflowExecution');
|
2023-02-14 02:39:19 -08:00
|
|
|
workflowPage.actions.executeWorkflow();
|
2023-03-02 07:50:21 -08:00
|
|
|
cy.wait('@workflowExecution');
|
2023-02-14 02:39:19 -08:00
|
|
|
}
|
|
|
|
},
|
|
|
|
switchToExecutionsTab: () => {
|
|
|
|
this.getters.executionsTabButton().click();
|
2023-12-14 02:50:00 -08:00
|
|
|
cy.url().should('include', '/executions');
|
2023-02-14 02:39:19 -08:00
|
|
|
},
|
|
|
|
switchToEditorTab: () => {
|
|
|
|
workflowPage.getters.editorTabButton().click();
|
2023-12-14 02:50:00 -08:00
|
|
|
cy.url().should('match', /\/workflow\/[^\/]+$/);
|
2023-08-16 08:13:57 -07:00
|
|
|
},
|
2023-11-30 03:12:26 -08:00
|
|
|
deleteExecutionInPreview: () => {
|
|
|
|
this.getters.executionPreviewDeleteButton().click();
|
|
|
|
cy.get('button.btn--confirm').click();
|
|
|
|
},
|
2023-02-14 02:39:19 -08:00
|
|
|
};
|
2023-08-16 08:13:57 -07:00
|
|
|
}
|