mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-16 09:36:44 +00:00
fix(editor): Prepare e2e suite for inline-expression-editor for new canvas (no-changelog) (#12110)
Co-authored-by: Oleg Ivaniv <me@olegivaniv.com>
This commit is contained in:
@@ -129,7 +129,7 @@ describe('Inline expression editor', () => {
|
|||||||
|
|
||||||
// Run workflow
|
// Run workflow
|
||||||
ndv.actions.close();
|
ndv.actions.close();
|
||||||
WorkflowPage.actions.executeNode('No Operation');
|
WorkflowPage.actions.executeNode('No Operation', { anchor: 'topLeft' });
|
||||||
WorkflowPage.actions.openNode('Hacker News');
|
WorkflowPage.actions.openNode('Hacker News');
|
||||||
WorkflowPage.actions.openInlineExpressionEditor();
|
WorkflowPage.actions.openInlineExpressionEditor();
|
||||||
|
|
||||||
|
|||||||
@@ -112,7 +112,7 @@ describe('Data pinning', () => {
|
|||||||
it('Should be able to pin data from canvas (context menu or shortcut)', () => {
|
it('Should be able to pin data from canvas (context menu or shortcut)', () => {
|
||||||
workflowPage.actions.addInitialNodeToCanvas('Schedule Trigger');
|
workflowPage.actions.addInitialNodeToCanvas('Schedule Trigger');
|
||||||
workflowPage.actions.addNodeToCanvas(EDIT_FIELDS_SET_NODE_NAME);
|
workflowPage.actions.addNodeToCanvas(EDIT_FIELDS_SET_NODE_NAME);
|
||||||
workflowPage.actions.openContextMenu(EDIT_FIELDS_SET_NODE_NAME, 'overflow-button');
|
workflowPage.actions.openContextMenu(EDIT_FIELDS_SET_NODE_NAME, { method: 'overflow-button' });
|
||||||
workflowPage.getters
|
workflowPage.getters
|
||||||
.contextMenuAction('toggle_pin')
|
.contextMenuAction('toggle_pin')
|
||||||
.parent()
|
.parent()
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
import { BasePage } from './base';
|
import { BasePage } from './base';
|
||||||
import { NodeCreator } from './features/node-creator';
|
import { NodeCreator } from './features/node-creator';
|
||||||
import { META_KEY } from '../constants';
|
import { META_KEY } from '../constants';
|
||||||
|
import type { OpenContextMenuOptions } from '../types';
|
||||||
import { getVisibleSelect } from '../utils';
|
import { getVisibleSelect } from '../utils';
|
||||||
import { getUniqueWorkflowName, isCanvasV2 } from '../utils/workflowUtils';
|
import { getUniqueWorkflowName, isCanvasV2 } from '../utils/workflowUtils';
|
||||||
|
|
||||||
@@ -272,14 +273,14 @@ export class WorkflowPage extends BasePage {
|
|||||||
},
|
},
|
||||||
openContextMenu: (
|
openContextMenu: (
|
||||||
nodeTypeName?: string,
|
nodeTypeName?: string,
|
||||||
method: 'right-click' | 'overflow-button' = 'right-click',
|
{ method = 'right-click', anchor = 'center' }: OpenContextMenuOptions = {},
|
||||||
) => {
|
) => {
|
||||||
const target = nodeTypeName
|
const target = nodeTypeName
|
||||||
? this.getters.canvasNodeByName(nodeTypeName)
|
? this.getters.canvasNodeByName(nodeTypeName)
|
||||||
: this.getters.nodeViewBackground();
|
: this.getters.nodeViewBackground();
|
||||||
|
|
||||||
if (method === 'right-click') {
|
if (method === 'right-click') {
|
||||||
target.rightclick(nodeTypeName ? 'center' : 'topLeft', { force: true });
|
target.rightclick(nodeTypeName ? anchor : 'topLeft', { force: true });
|
||||||
} else {
|
} else {
|
||||||
target.realHover();
|
target.realHover();
|
||||||
target.find('[data-test-id="overflow-node-button"]').click({ force: true });
|
target.find('[data-test-id="overflow-node-button"]').click({ force: true });
|
||||||
@@ -296,8 +297,8 @@ export class WorkflowPage extends BasePage {
|
|||||||
this.actions.openContextMenu(nodeTypeName);
|
this.actions.openContextMenu(nodeTypeName);
|
||||||
this.actions.contextMenuAction('delete');
|
this.actions.contextMenuAction('delete');
|
||||||
},
|
},
|
||||||
executeNode: (nodeTypeName: string) => {
|
executeNode: (nodeTypeName: string, options?: OpenContextMenuOptions) => {
|
||||||
this.actions.openContextMenu(nodeTypeName);
|
this.actions.openContextMenu(nodeTypeName, options);
|
||||||
this.actions.contextMenuAction('execute');
|
this.actions.contextMenuAction('execute');
|
||||||
},
|
},
|
||||||
addStickyFromContextMenu: () => {
|
addStickyFromContextMenu: () => {
|
||||||
@@ -324,7 +325,7 @@ export class WorkflowPage extends BasePage {
|
|||||||
this.actions.contextMenuAction('toggle_pin');
|
this.actions.contextMenuAction('toggle_pin');
|
||||||
},
|
},
|
||||||
openNodeFromContextMenu: (nodeTypeName: string) => {
|
openNodeFromContextMenu: (nodeTypeName: string) => {
|
||||||
this.actions.openContextMenu(nodeTypeName, 'overflow-button');
|
this.actions.openContextMenu(nodeTypeName, { method: 'overflow-button' });
|
||||||
this.actions.contextMenuAction('open');
|
this.actions.contextMenuAction('open');
|
||||||
},
|
},
|
||||||
selectAllFromContextMenu: () => {
|
selectAllFromContextMenu: () => {
|
||||||
|
|||||||
@@ -22,3 +22,8 @@ export interface ExecutionResponse {
|
|||||||
results: Execution[];
|
results: Execution[];
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export type OpenContextMenuOptions = {
|
||||||
|
method?: 'right-click' | 'overflow-button';
|
||||||
|
anchor?: 'topRight' | 'topLeft' | 'center' | 'bottomRight' | 'bottomLeft';
|
||||||
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user