mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 18:12:04 +00:00
test(editor): Add canvas actions e2e tests (#4950)
* ✅ Added some more workflow actions tests * ✅ Updating duplicate workflow tests * ✅ Fixed duplicate workflow tests * ✅ Added first batch of canvas tests * ✅ Added zoom and select tests * ✅ Added tests for adding and deleting nodes * ✅ Adding a wait before clicking connection action buttons * ✅ Adding tests for node actions * 👌 Addressing review feedback * 👌 Addressing PR feedback
This commit is contained in:
committed by
GitHub
parent
343f53bf53
commit
96296e1724
@@ -1,3 +1,4 @@
|
||||
import { META_KEY } from '../constants';
|
||||
import { BasePage } from './base';
|
||||
|
||||
export class WorkflowPage extends BasePage {
|
||||
@@ -27,7 +28,8 @@ export class WorkflowPage extends BasePage {
|
||||
cy.getByTestId(`parameter-input-${parameterName}`),
|
||||
ndvOutputPanel: () => cy.getByTestId('output-panel'),
|
||||
ndvRunDataPaneHeader: () => cy.getByTestId('run-data-pane-header'),
|
||||
successToast: () => cy.get('.el-notification__title'),
|
||||
successToast: () => cy.get('.el-notification .el-icon-success').parent(),
|
||||
errorToast: () => cy.get('.el-notification .el-icon-error'),
|
||||
activatorSwitch: () => cy.getByTestId('workflow-activate-switch'),
|
||||
workflowMenu: () => cy.getByTestId('workflow-menu'),
|
||||
firstStepButton: () => cy.getByTestId('canvas-add-button'),
|
||||
@@ -42,6 +44,7 @@ export class WorkflowPage extends BasePage {
|
||||
zoomToFitButton: () => cy.getByTestId('zoom-to-fit'),
|
||||
nodeEndpoints: () => cy.get('.jtk-endpoint-connected'),
|
||||
disabledNodes: () => cy.get('.node-box.disabled'),
|
||||
selectedNodes: () => this.getters.canvasNodes().filter('.jtk-drag-selected'),
|
||||
nodeNameContainerNDV: () => cy.getByTestId('node-title-container'),
|
||||
nodeRenameInput: () => cy.getByTestId('node-rename-input'),
|
||||
// Workflow menu items
|
||||
@@ -69,8 +72,15 @@ export class WorkflowPage extends BasePage {
|
||||
workflowSettingsSaveButton: () =>
|
||||
cy.getByTestId('workflow-settings-save-button').find('button'),
|
||||
|
||||
duplicateWorkflowModal: () => cy.getByTestId('duplicate-modal'),
|
||||
nodeViewBackground: () => cy.getByTestId('node-view-background'),
|
||||
nodeView: () => cy.getByTestId('node-view'),
|
||||
inlineExpressionEditorInput: () => cy.getByTestId('inline-expression-editor-input'),
|
||||
inlineExpressionEditorOutput: () => cy.getByTestId('inline-expression-editor-output'),
|
||||
zoomInButton: () => cy.getByTestId('zoom-in-button'),
|
||||
zoomOutButton: () => cy.getByTestId('zoom-out-button'),
|
||||
resetZoomButton: () => cy.getByTestId('reset-zoom-button'),
|
||||
executeWorkflowButton: () => cy.getByTestId('execute-workflow-button'),
|
||||
};
|
||||
actions = {
|
||||
visit: () => {
|
||||
@@ -147,23 +157,25 @@ export class WorkflowPage extends BasePage {
|
||||
cy.getByTestId('zoom-to-fit').click();
|
||||
},
|
||||
hitUndo: () => {
|
||||
const metaKey = Cypress.platform === 'darwin' ? '{meta}' : '{ctrl}';
|
||||
cy.get('body').type(metaKey, { delay: 500, release: false }).type('z');
|
||||
cy.get('body').type(META_KEY, { delay: 500, release: false }).type('z');
|
||||
},
|
||||
hitRedo: () => {
|
||||
const metaKey = Cypress.platform === 'darwin' ? '{meta}' : '{ctrl}';
|
||||
cy.get('body')
|
||||
.type(metaKey, { delay: 500, release: false })
|
||||
.type(META_KEY, { delay: 500, release: false })
|
||||
.type('{shift}', { release: false })
|
||||
.type('z');
|
||||
},
|
||||
selectAll: () => {
|
||||
const metaKey = Cypress.platform === 'darwin' ? '{meta}' : '{ctrl}';
|
||||
cy.get('body').type(metaKey, { delay: 500, release: false }).type('a');
|
||||
cy.get('body').type(META_KEY, { delay: 500, release: false }).type('a');
|
||||
},
|
||||
hitDisableNodeShortcut: () => {
|
||||
const metaKey = Cypress.platform === 'darwin' ? '{meta}' : '{ctrl}';
|
||||
cy.get('body').type(metaKey, { delay: 500, release: false }).type('d');
|
||||
cy.get('body').type(META_KEY, { delay: 500, release: false }).type('d');
|
||||
},
|
||||
hitCopy: () => {
|
||||
cy.get('body').type(META_KEY, { delay: 500, release: false }).type('c');
|
||||
},
|
||||
hitPaste: () => {
|
||||
cy.get('body').type(META_KEY, { delay: 500, release: false }).type('P');
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user