n8n/cypress/pages/workflows.ts
Csaba Tuncsik 430cc65a4e
test: E2E NDV (#4712)
* test: start testing node details view

* test: deleting workflow after test

* test: rename deleteWorkflow command

* test: webhook node

* test: roll back deleting workflow in workflow test

* test: check output display modes after webhook node invoked

* test: simplifying test

* test: simplifying test

* test: adding more tests related to NDV

* test: adding more tests related to NDV

* test: update after merge

* Merge remote-tracking branch 'origin/master' into n8n-5494-e2e-ndv

# Conflicts:
#	cypress/pages/workflow.ts

* test: improving test blocks

* test: NDV change node input

* test: NDV change node input

* test: NDV fix missing command

* test(editor): Add NDV page object
2022-12-01 09:26:38 +01:00

41 lines
1.7 KiB
TypeScript

import { BasePage } from "./base";
export class WorkflowsPage extends BasePage {
url = '/workflows';
getters = {
newWorkflowButtonCard: () => cy.getByTestId('new-workflow-card'),
newWorkflowTemplateCard: () => cy.getByTestId('new-workflow-template-card'),
searchBar: () => cy.getByTestId('resources-list-search'),
createWorkflowButton: () => cy.getByTestId('resources-list-add'),
workflowCards: () => cy.getByTestId('resources-list-item'),
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')
// Not yet implemented
// myWorkflows: () => cy.getByTestId('my-workflows'),
// allWorkflows: () => cy.getByTestId('all-workflows'),
};
actions = {
createWorkflowFromCard: () => {
this.getters.newWorkflowButtonCard().click();
},
deleteWorkFlow: (name: string) => {
cy.visit(this.url);
this.getters.workflowCardActions(name).click();
this.getters.workflowDeleteButton().click();
cy.get('button').contains('delete').click();
}
}
}