2022-12-15 07:39:59 -08:00
|
|
|
import { BasePage } from './base';
|
2022-11-08 04:21:10 -08:00
|
|
|
|
|
|
|
export class WorkflowsPage extends BasePage {
|
|
|
|
url = '/workflows';
|
2022-11-22 01:37:26 -08:00
|
|
|
getters = {
|
2022-11-11 00:07:14 -08:00
|
|
|
newWorkflowButtonCard: () => cy.getByTestId('new-workflow-card'),
|
|
|
|
newWorkflowTemplateCard: () => cy.getByTestId('new-workflow-template-card'),
|
2023-07-28 00:51:07 -07:00
|
|
|
searchBar: () => cy.getByTestId('resources-list-search'),
|
2022-11-11 00:07:14 -08:00
|
|
|
createWorkflowButton: () => cy.getByTestId('resources-list-add'),
|
2022-11-28 02:11:39 -08:00
|
|
|
workflowCards: () => cy.getByTestId('resources-list-item'),
|
2022-12-15 07:39:59 -08:00
|
|
|
workflowCard: (workflowName: string) =>
|
|
|
|
this.getters
|
|
|
|
.workflowCards()
|
|
|
|
.contains(workflowName)
|
|
|
|
.parents('[data-test-id="resources-list-item"]'),
|
|
|
|
workflowTags: (workflowName: string) =>
|
|
|
|
this.getters.workflowCard(workflowName).findChildByTestId('workflow-card-tags'),
|
|
|
|
workflowActivator: (workflowName: string) =>
|
|
|
|
this.getters.workflowCard(workflowName).findChildByTestId('workflow-card-activator'),
|
|
|
|
workflowActivatorStatus: (workflowName: string) =>
|
|
|
|
this.getters.workflowActivator(workflowName).findChildByTestId('workflow-activator-status'),
|
|
|
|
workflowCardActions: (workflowName: string) =>
|
|
|
|
this.getters.workflowCard(workflowName).findChildByTestId('workflow-card-actions'),
|
|
|
|
workflowDeleteButton: () =>
|
|
|
|
cy.getByTestId('action-toggle-dropdown').filter(':visible').contains('Delete'),
|
2023-11-08 05:42:53 -08:00
|
|
|
workflowFilterButton: () => cy.getByTestId('resources-list-filters-trigger').filter(':visible'),
|
|
|
|
workflowTagsDropdown: () => cy.getByTestId('tags-dropdown'),
|
|
|
|
workflowTagItem: (tag: string) => cy.getByTestId('tag').contains(tag),
|
|
|
|
workflowStatusDropdown: () => cy.getByTestId('status-dropdown'),
|
|
|
|
workflowStatusItem: (status: string) => cy.getByTestId('status').contains(status),
|
|
|
|
workflowOwnershipDropdown: () => cy.getByTestId('user-select-trigger'),
|
|
|
|
workflowOwner: (email: string) => cy.getByTestId('user-email').contains(email),
|
|
|
|
workflowResetFilters: () => cy.getByTestId('workflows-filter-reset'),
|
2022-11-11 00:07:14 -08:00
|
|
|
// Not yet implemented
|
|
|
|
// myWorkflows: () => cy.getByTestId('my-workflows'),
|
|
|
|
// allWorkflows: () => cy.getByTestId('all-workflows'),
|
2023-12-19 06:10:03 -08:00
|
|
|
suggestedTemplatesPageContainer: () => cy.getByTestId('suggested-templates-page-container'),
|
2024-01-02 05:13:09 -08:00
|
|
|
suggestedTemplatesCards: () => cy.get('.agile__slides--regular [data-test-id=templates-info-card]'),
|
2023-12-19 06:10:03 -08:00
|
|
|
suggestedTemplatesNewWorkflowButton: () => cy.getByTestId('suggested-templates-new-workflow-button'),
|
|
|
|
suggestedTemplatesSectionContainer: () => cy.getByTestId('suggested-templates-section-container'),
|
|
|
|
suggestedTemplatesPreviewModal: () => cy.getByTestId('suggested-templates-preview-modal'),
|
|
|
|
suggestedTemplatesUseTemplateButton: () => cy.getByTestId('use-template-button'),
|
|
|
|
suggestedTemplatesSectionDescription: () => cy.getByTestId('suggested-template-section-description'),
|
2022-11-11 00:07:14 -08:00
|
|
|
};
|
2022-11-25 04:09:44 -08:00
|
|
|
|
|
|
|
actions = {
|
|
|
|
createWorkflowFromCard: () => {
|
|
|
|
this.getters.newWorkflowButtonCard().click();
|
|
|
|
},
|
2022-12-01 00:26:38 -08:00
|
|
|
deleteWorkFlow: (name: string) => {
|
|
|
|
cy.visit(this.url);
|
|
|
|
this.getters.workflowCardActions(name).click();
|
|
|
|
this.getters.workflowDeleteButton().click();
|
2023-06-27 04:05:20 -07:00
|
|
|
cy.intercept('DELETE', '/rest/workflows/*').as('deleteWorkflow');
|
2022-12-01 00:26:38 -08:00
|
|
|
|
|
|
|
cy.get('button').contains('delete').click();
|
2023-06-27 04:05:20 -07:00
|
|
|
cy.wait('@deleteWorkflow');
|
2022-12-15 07:39:59 -08:00
|
|
|
},
|
|
|
|
};
|
2022-11-08 04:21:10 -08:00
|
|
|
}
|