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-03-02 07:50:21 -08:00
|
|
|
searchBar: () => cy.getByTestId('resources-list-search').find('input'),
|
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'),
|
2022-11-11 00:07:14 -08:00
|
|
|
// Not yet implemented
|
|
|
|
// myWorkflows: () => cy.getByTestId('my-workflows'),
|
|
|
|
// allWorkflows: () => cy.getByTestId('all-workflows'),
|
|
|
|
};
|
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();
|
|
|
|
|
|
|
|
cy.get('button').contains('delete').click();
|
2022-12-15 07:39:59 -08:00
|
|
|
},
|
|
|
|
};
|
2022-11-08 04:21:10 -08:00
|
|
|
}
|