2022-12-20 01:33:20 -08:00
|
|
|
import { META_KEY } from '../constants';
|
2022-11-25 04:09:44 -08:00
|
|
|
import { BasePage } from './base';
|
2022-11-11 00:07:14 -08:00
|
|
|
|
|
|
|
export class WorkflowPage extends BasePage {
|
|
|
|
url = '/workflow/new';
|
2022-11-22 01:37:26 -08:00
|
|
|
getters = {
|
2022-12-05 05:31:14 -08:00
|
|
|
workflowNameInputContainer: () => cy.getByTestId('workflow-name-input', { timeout: 5000 }),
|
2022-12-15 07:39:59 -08:00
|
|
|
workflowNameInput: () =>
|
|
|
|
this.getters.workflowNameInputContainer().then(($el) => cy.wrap($el.find('input'))),
|
2022-11-11 00:07:14 -08:00
|
|
|
workflowImportInput: () => cy.getByTestId('workflow-import-input'),
|
|
|
|
workflowTags: () => cy.getByTestId('workflow-tags'),
|
2022-11-25 08:10:28 -08:00
|
|
|
workflowTagsContainer: () => cy.getByTestId('workflow-tags-container'),
|
2022-12-15 07:39:59 -08:00
|
|
|
workflowTagsInput: () =>
|
|
|
|
this.getters.workflowTagsContainer().then(($el) => cy.wrap($el.find('input').first())),
|
2023-02-09 01:04:12 -08:00
|
|
|
tagPills: () => cy.get('[data-test-id="workflow-tags-container"] span.tags > span'),
|
|
|
|
nthTagPill: (n: number) =>
|
|
|
|
cy.get(`[data-test-id="workflow-tags-container"] span.tags > span:nth-child(${n})`),
|
|
|
|
tagsDropdown: () => cy.getByTestId('workflow-tags-dropdown'),
|
|
|
|
tagsInDropdown: () => cy.getByTestId('workflow-tags-dropdown').find('li').filter('.tag'),
|
|
|
|
createTagButton: () => cy.getByTestId('new-tag-link'),
|
2022-11-25 06:32:09 -08:00
|
|
|
saveButton: () => cy.getByTestId('workflow-save-button'),
|
2022-11-25 04:09:44 -08:00
|
|
|
nodeCreatorSearchBar: () => cy.getByTestId('node-creator-search-bar'),
|
|
|
|
nodeCreatorPlusButton: () => cy.getByTestId('node-creator-plus-button'),
|
|
|
|
canvasPlusButton: () => cy.getByTestId('canvas-plus-button'),
|
2022-12-01 00:26:38 -08:00
|
|
|
canvasNodes: () => cy.getByTestId('canvas-node'),
|
2022-12-15 07:39:59 -08:00
|
|
|
canvasNodeByName: (nodeName: string) =>
|
2023-02-17 06:08:26 -08:00
|
|
|
this.getters.canvasNodes().filter(`:contains(${nodeName})`),
|
2023-02-08 05:48:28 -08:00
|
|
|
getEndpointSelector: (type: 'input' | 'output' | 'plus', nodeName: string, index = 0) => {
|
2023-02-14 06:13:00 -08:00
|
|
|
return `[data-endpoint-name='${nodeName}'][data-endpoint-type='${type}'][data-input-index='${index}']`;
|
2023-02-08 05:48:28 -08:00
|
|
|
},
|
|
|
|
canvasNodeInputEndpointByName: (nodeName: string, index = 0) => {
|
|
|
|
return cy.get(this.getters.getEndpointSelector('input', nodeName, index));
|
|
|
|
},
|
|
|
|
canvasNodeOutputEndpointByName: (nodeName: string, index = 0) => {
|
|
|
|
return cy.get(this.getters.getEndpointSelector('output', nodeName, index));
|
|
|
|
},
|
|
|
|
canvasNodePlusEndpointByName: (nodeName: string, index = 0) => {
|
|
|
|
return cy.get(this.getters.getEndpointSelector('plus', nodeName, index));
|
|
|
|
},
|
2022-12-20 01:33:20 -08:00
|
|
|
successToast: () => cy.get('.el-notification .el-icon-success').parent(),
|
|
|
|
errorToast: () => cy.get('.el-notification .el-icon-error'),
|
2022-11-25 06:32:09 -08:00
|
|
|
activatorSwitch: () => cy.getByTestId('workflow-activate-switch'),
|
|
|
|
workflowMenu: () => cy.getByTestId('workflow-menu'),
|
|
|
|
firstStepButton: () => cy.getByTestId('canvas-add-button'),
|
2022-11-25 08:10:28 -08:00
|
|
|
isWorkflowSaved: () => this.getters.saveButton().should('match', 'span'), // In Element UI, disabled button turn into spans 🤷♂️
|
|
|
|
isWorkflowActivated: () => this.getters.activatorSwitch().should('have.class', 'is-checked'),
|
2023-03-02 07:50:21 -08:00
|
|
|
expressionModalInput: () => cy.getByTestId('expression-modal-input').find('[role=textbox]'),
|
2022-12-01 04:26:22 -08:00
|
|
|
expressionModalOutput: () => cy.getByTestId('expression-modal-output'),
|
2022-12-05 05:31:14 -08:00
|
|
|
|
|
|
|
nodeViewRoot: () => cy.getByTestId('node-view-root'),
|
|
|
|
copyPasteInput: () => cy.getByTestId('hidden-copy-paste'),
|
2022-12-14 01:33:44 -08:00
|
|
|
nodeConnections: () => cy.get('.jtk-connector'),
|
|
|
|
zoomToFitButton: () => cy.getByTestId('zoom-to-fit'),
|
|
|
|
nodeEndpoints: () => cy.get('.jtk-endpoint-connected'),
|
|
|
|
disabledNodes: () => cy.get('.node-box.disabled'),
|
2022-12-20 01:33:20 -08:00
|
|
|
selectedNodes: () => this.getters.canvasNodes().filter('.jtk-drag-selected'),
|
2022-12-14 08:13:03 -08:00
|
|
|
// Workflow menu items
|
|
|
|
workflowMenuItemDuplicate: () => cy.getByTestId('workflow-menu-item-duplicate'),
|
|
|
|
workflowMenuItemDownload: () => cy.getByTestId('workflow-menu-item-download'),
|
|
|
|
workflowMenuItemImportFromURLItem: () => cy.getByTestId('workflow-menu-item-import-from-url'),
|
|
|
|
workflowMenuItemImportFromFile: () => cy.getByTestId('workflow-menu-item-import-from-file'),
|
|
|
|
workflowMenuItemSettings: () => cy.getByTestId('workflow-menu-item-settings'),
|
|
|
|
workflowMenuItemDelete: () => cy.getByTestId('workflow-menu-item-delete'),
|
|
|
|
// Workflow settings dialog elements
|
|
|
|
workflowSettingsModal: () => cy.getByTestId('workflow-settings-dialog'),
|
|
|
|
workflowSettingsErrorWorkflowSelect: () => cy.getByTestId('workflow-settings-error-workflow'),
|
|
|
|
workflowSettingsTimezoneSelect: () => cy.getByTestId('workflow-settings-timezone'),
|
2022-12-15 07:39:59 -08:00
|
|
|
workflowSettingsSaveFiledExecutionsSelect: () =>
|
|
|
|
cy.getByTestId('workflow-settings-save-failed-executions'),
|
|
|
|
workflowSettingsSaveSuccessExecutionsSelect: () =>
|
|
|
|
cy.getByTestId('workflow-settings-save-success-executions'),
|
|
|
|
workflowSettingsSaveManualExecutionsSelect: () =>
|
|
|
|
cy.getByTestId('workflow-settings-save-manual-executions'),
|
|
|
|
workflowSettingsSaveExecutionProgressSelect: () =>
|
|
|
|
cy.getByTestId('workflow-settings-save-execution-progress'),
|
|
|
|
workflowSettingsTimeoutWorkflowSwitch: () =>
|
|
|
|
cy.getByTestId('workflow-settings-timeout-workflow'),
|
2022-12-14 08:13:03 -08:00
|
|
|
workflowSettingsTimeoutForm: () => cy.getByTestId('workflow-settings-timeout-form'),
|
2022-12-15 07:39:59 -08:00
|
|
|
workflowSettingsSaveButton: () =>
|
|
|
|
cy.getByTestId('workflow-settings-save-button').find('button'),
|
2022-12-15 06:36:28 -08:00
|
|
|
|
2023-02-14 06:13:00 -08:00
|
|
|
shareButton: () => cy.getByTestId('workflow-share-button'),
|
2023-02-08 12:41:35 -08:00
|
|
|
|
2022-12-20 01:33:20 -08:00
|
|
|
duplicateWorkflowModal: () => cy.getByTestId('duplicate-modal'),
|
|
|
|
nodeViewBackground: () => cy.getByTestId('node-view-background'),
|
|
|
|
nodeView: () => cy.getByTestId('node-view'),
|
2023-03-02 07:50:21 -08:00
|
|
|
inlineExpressionEditorInput: () => cy.getByTestId('inline-expression-editor-input').find('[role=textbox]'),
|
2022-12-15 06:36:28 -08:00
|
|
|
inlineExpressionEditorOutput: () => cy.getByTestId('inline-expression-editor-output'),
|
2022-12-20 01:33:20 -08:00
|
|
|
zoomInButton: () => cy.getByTestId('zoom-in-button'),
|
|
|
|
zoomOutButton: () => cy.getByTestId('zoom-out-button'),
|
|
|
|
resetZoomButton: () => cy.getByTestId('reset-zoom-button'),
|
|
|
|
executeWorkflowButton: () => cy.getByTestId('execute-workflow-button'),
|
2023-02-16 02:41:25 -08:00
|
|
|
clearExecutionDataButton: () => cy.getByTestId('clear-execution-data-button'),
|
|
|
|
stopExecutionButton: () => cy.getByTestId('stop-execution-button'),
|
|
|
|
stopExecutionWaitingForWebhookButton: () => cy.getByTestId('stop-execution-waiting-for-webhook-button'),
|
2023-01-27 00:05:43 -08:00
|
|
|
nodeCredentialsSelect: () => cy.getByTestId('node-credentials-select'),
|
|
|
|
nodeCredentialsEditButton: () => cy.getByTestId('credential-edit-button'),
|
|
|
|
nodeCreatorItems: () => cy.getByTestId('item-iterator-item'),
|
|
|
|
ndvParameters: () => cy.getByTestId('parameter-item'),
|
|
|
|
nodeCredentialsLabel: () => cy.getByTestId('credentials-label'),
|
2023-02-07 07:34:08 -08:00
|
|
|
getConnectionBetweenNodes: (sourceNodeName: string, targetNodeName: string) =>
|
2023-02-09 01:04:12 -08:00
|
|
|
cy.get(
|
|
|
|
`.jtk-connector[data-source-node="${sourceNodeName}"][data-target-node="${targetNodeName}"]`,
|
|
|
|
),
|
2023-02-07 07:34:08 -08:00
|
|
|
getConnectionActionsBetweenNodes: (sourceNodeName: string, targetNodeName: string) =>
|
2023-02-09 01:04:12 -08:00
|
|
|
cy.get(
|
|
|
|
`.connection-actions[data-source-node="${sourceNodeName}"][data-target-node="${targetNodeName}"]`,
|
|
|
|
),
|
2023-02-14 02:39:19 -08:00
|
|
|
editorTabButton: () => cy.getByTestId('radio-button-workflow'),
|
2022-11-25 04:09:44 -08:00
|
|
|
};
|
|
|
|
actions = {
|
2022-11-25 08:10:28 -08:00
|
|
|
visit: () => {
|
|
|
|
cy.visit(this.url);
|
2022-12-13 02:55:51 -08:00
|
|
|
cy.waitForLoad();
|
2022-11-25 08:10:28 -08:00
|
|
|
},
|
2023-02-08 01:41:36 -08:00
|
|
|
addInitialNodeToCanvas: (nodeDisplayName: string, { keepNdvOpen } = { keepNdvOpen: false }) => {
|
2022-11-25 04:09:44 -08:00
|
|
|
this.getters.canvasPlusButton().click();
|
|
|
|
this.getters.nodeCreatorSearchBar().type(nodeDisplayName);
|
feat(editor): Node creator actions (#4696)
* WIP: Node Actions List UI
* WIP: Recommended Actions and preseting of fields
* WIP: Resource category
* :art: Moved actions categorisation to the server
* :label: Add missing INodeAction type
* :sparkles: Improve SSR categorisation, fix adding of mixed actions
* :recycle: Refactor CategorizedItems to composition api, style fixes
* WIP: Adding multiple nodes
* :recycle: Refactor rest of the NodeCreator component to composition API, conver globalLinkActions to composable
* :sparkles: Allow actions dragging, fix search and refactor passing of actions to categorized items
* :lipstick: Fix node actions title
* Migrate to the pinia store, add posthog feature and various fixes
* :bug: Fix filtering of trigger actions when not merged
* fix: N8N-5439 — Do not use simple node item when at NodeHelperPanel root
* :bug: Design review fixes
* :bug: Fix disabling of merged actions
* Fix trigger root filtering
* :sparkles: Allow for custom node actions parser, introduce hubspot parser
* :bug: Fix initial node params validation, fix position of second added node
* :bug: Introduce operations category, removed canvas node names overrride, fix API actions display and prevent dragging of action nodes
* :sparkles: Prevent NDV auto-open feature flag
* :bug: Inject recommened action for trigger nodes without actions
* Refactored NodeCreatorNode to Storybook, change filtering of merged nodes for the trigger helper panel, minor fixes
* Improve rendering of app nodes and animation
* Cleanup, any only enable accordion transition on triggerhelperpanel
* Hide node creator scrollbars in Firefox
* Minor styles fixes
* Do not copy the array in rendering method
* Removed unused props
* Fix memory leak
* Fix categorisation of regular nodes with a single resource
* Implement telemetry calls for node actions
* Move categorization to FE
* Fix client side actions categorisation
* Skip custom action show
* Only load tooltip for NodeIcon if necessary
* Fix lodash startCase import
* Remove lodash.startcase
* Cleanup
* Fix node creator autofocus on "tab"
* Prevent posthog getFeatureFlag from crashing
* Debugging preview env search issues
* Remove logs
* Make sure the pre-filled params are update not overwritten
* Get rid of transition in itemiterator
* WIP: Rough version of NodeActions keyboard navigation, replace nodeCreator composable with Pinia store module
* Rewrite to add support for ActionItem to ItemIterator and make CategorizedItems accept items props
* Fix category item counter & cleanup
* Add APIHint to actions search no-result, clean up NodeCreatorNode
* Improve node actions no results message
* Remove logging, fix filtering of recommended placeholder category
* Remove unused NodeActions component and node merging feature falg
* Do not show regular nodes without actions
* Make sure to add manual trigger when adding http node via actions hint
* Fixed api hint footer line height
* Prevent pointer-events od NodeIcon img and remove "this" from template
* Address PR points
* Fix e2e specs
* Make sure canvas ia loaded
* Make sure canvas ia loaded before opening nodeCreator in e2e spec
* Fix flaky workflows tags e2e getter
* Imrpove node creator click outside UX, add manual node to regular nodes added from trigger panel
* Add manual trigger node if dragging regular from trigger panel
2022-12-09 01:56:36 -08:00
|
|
|
this.getters.nodeCreatorSearchBar().type('{enter}');
|
2023-02-08 01:41:36 -08:00
|
|
|
if (keepNdvOpen) return;
|
feat(editor): Node creator actions (#4696)
* WIP: Node Actions List UI
* WIP: Recommended Actions and preseting of fields
* WIP: Resource category
* :art: Moved actions categorisation to the server
* :label: Add missing INodeAction type
* :sparkles: Improve SSR categorisation, fix adding of mixed actions
* :recycle: Refactor CategorizedItems to composition api, style fixes
* WIP: Adding multiple nodes
* :recycle: Refactor rest of the NodeCreator component to composition API, conver globalLinkActions to composable
* :sparkles: Allow actions dragging, fix search and refactor passing of actions to categorized items
* :lipstick: Fix node actions title
* Migrate to the pinia store, add posthog feature and various fixes
* :bug: Fix filtering of trigger actions when not merged
* fix: N8N-5439 — Do not use simple node item when at NodeHelperPanel root
* :bug: Design review fixes
* :bug: Fix disabling of merged actions
* Fix trigger root filtering
* :sparkles: Allow for custom node actions parser, introduce hubspot parser
* :bug: Fix initial node params validation, fix position of second added node
* :bug: Introduce operations category, removed canvas node names overrride, fix API actions display and prevent dragging of action nodes
* :sparkles: Prevent NDV auto-open feature flag
* :bug: Inject recommened action for trigger nodes without actions
* Refactored NodeCreatorNode to Storybook, change filtering of merged nodes for the trigger helper panel, minor fixes
* Improve rendering of app nodes and animation
* Cleanup, any only enable accordion transition on triggerhelperpanel
* Hide node creator scrollbars in Firefox
* Minor styles fixes
* Do not copy the array in rendering method
* Removed unused props
* Fix memory leak
* Fix categorisation of regular nodes with a single resource
* Implement telemetry calls for node actions
* Move categorization to FE
* Fix client side actions categorisation
* Skip custom action show
* Only load tooltip for NodeIcon if necessary
* Fix lodash startCase import
* Remove lodash.startcase
* Cleanup
* Fix node creator autofocus on "tab"
* Prevent posthog getFeatureFlag from crashing
* Debugging preview env search issues
* Remove logs
* Make sure the pre-filled params are update not overwritten
* Get rid of transition in itemiterator
* WIP: Rough version of NodeActions keyboard navigation, replace nodeCreator composable with Pinia store module
* Rewrite to add support for ActionItem to ItemIterator and make CategorizedItems accept items props
* Fix category item counter & cleanup
* Add APIHint to actions search no-result, clean up NodeCreatorNode
* Improve node actions no results message
* Remove logging, fix filtering of recommended placeholder category
* Remove unused NodeActions component and node merging feature falg
* Do not show regular nodes without actions
* Make sure to add manual trigger when adding http node via actions hint
* Fixed api hint footer line height
* Prevent pointer-events od NodeIcon img and remove "this" from template
* Address PR points
* Fix e2e specs
* Make sure canvas ia loaded
* Make sure canvas ia loaded before opening nodeCreator in e2e spec
* Fix flaky workflows tags e2e getter
* Imrpove node creator click outside UX, add manual node to regular nodes added from trigger panel
* Add manual trigger node if dragging regular from trigger panel
2022-12-09 01:56:36 -08:00
|
|
|
cy.get('body').type('{esc}');
|
2022-11-25 04:09:44 -08:00
|
|
|
},
|
2023-02-08 12:41:35 -08:00
|
|
|
addNodeToCanvas: (
|
|
|
|
nodeDisplayName: string,
|
|
|
|
plusButtonClick = true,
|
|
|
|
preventNdvClose?: boolean,
|
2023-02-17 06:08:26 -08:00
|
|
|
action?: string,
|
2023-02-08 12:41:35 -08:00
|
|
|
) => {
|
2023-01-30 09:20:50 -08:00
|
|
|
if (plusButtonClick) {
|
|
|
|
this.getters.nodeCreatorPlusButton().click();
|
|
|
|
}
|
|
|
|
|
2022-11-25 04:09:44 -08:00
|
|
|
this.getters.nodeCreatorSearchBar().type(nodeDisplayName);
|
feat(editor): Node creator actions (#4696)
* WIP: Node Actions List UI
* WIP: Recommended Actions and preseting of fields
* WIP: Resource category
* :art: Moved actions categorisation to the server
* :label: Add missing INodeAction type
* :sparkles: Improve SSR categorisation, fix adding of mixed actions
* :recycle: Refactor CategorizedItems to composition api, style fixes
* WIP: Adding multiple nodes
* :recycle: Refactor rest of the NodeCreator component to composition API, conver globalLinkActions to composable
* :sparkles: Allow actions dragging, fix search and refactor passing of actions to categorized items
* :lipstick: Fix node actions title
* Migrate to the pinia store, add posthog feature and various fixes
* :bug: Fix filtering of trigger actions when not merged
* fix: N8N-5439 — Do not use simple node item when at NodeHelperPanel root
* :bug: Design review fixes
* :bug: Fix disabling of merged actions
* Fix trigger root filtering
* :sparkles: Allow for custom node actions parser, introduce hubspot parser
* :bug: Fix initial node params validation, fix position of second added node
* :bug: Introduce operations category, removed canvas node names overrride, fix API actions display and prevent dragging of action nodes
* :sparkles: Prevent NDV auto-open feature flag
* :bug: Inject recommened action for trigger nodes without actions
* Refactored NodeCreatorNode to Storybook, change filtering of merged nodes for the trigger helper panel, minor fixes
* Improve rendering of app nodes and animation
* Cleanup, any only enable accordion transition on triggerhelperpanel
* Hide node creator scrollbars in Firefox
* Minor styles fixes
* Do not copy the array in rendering method
* Removed unused props
* Fix memory leak
* Fix categorisation of regular nodes with a single resource
* Implement telemetry calls for node actions
* Move categorization to FE
* Fix client side actions categorisation
* Skip custom action show
* Only load tooltip for NodeIcon if necessary
* Fix lodash startCase import
* Remove lodash.startcase
* Cleanup
* Fix node creator autofocus on "tab"
* Prevent posthog getFeatureFlag from crashing
* Debugging preview env search issues
* Remove logs
* Make sure the pre-filled params are update not overwritten
* Get rid of transition in itemiterator
* WIP: Rough version of NodeActions keyboard navigation, replace nodeCreator composable with Pinia store module
* Rewrite to add support for ActionItem to ItemIterator and make CategorizedItems accept items props
* Fix category item counter & cleanup
* Add APIHint to actions search no-result, clean up NodeCreatorNode
* Improve node actions no results message
* Remove logging, fix filtering of recommended placeholder category
* Remove unused NodeActions component and node merging feature falg
* Do not show regular nodes without actions
* Make sure to add manual trigger when adding http node via actions hint
* Fixed api hint footer line height
* Prevent pointer-events od NodeIcon img and remove "this" from template
* Address PR points
* Fix e2e specs
* Make sure canvas ia loaded
* Make sure canvas ia loaded before opening nodeCreator in e2e spec
* Fix flaky workflows tags e2e getter
* Imrpove node creator click outside UX, add manual node to regular nodes added from trigger panel
* Add manual trigger node if dragging regular from trigger panel
2022-12-09 01:56:36 -08:00
|
|
|
this.getters.nodeCreatorSearchBar().type('{enter}');
|
2023-02-17 06:08:26 -08:00
|
|
|
cy.wait(500)
|
|
|
|
cy.get('body').then((body) => {
|
|
|
|
if(body.find('[data-test-id=node-creator]').length > 0) {
|
|
|
|
if(action) {
|
|
|
|
cy.contains(action).click()
|
|
|
|
} else {
|
|
|
|
cy.getByTestId('item-iterator-item').eq(1).click()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
})
|
2023-01-16 05:55:58 -08:00
|
|
|
|
|
|
|
if (!preventNdvClose) cy.get('body').type('{esc}');
|
2022-11-25 04:09:44 -08:00
|
|
|
},
|
2023-01-18 06:48:36 -08:00
|
|
|
openNode: (nodeTypeName: string) => {
|
2023-02-17 06:08:26 -08:00
|
|
|
this.getters.canvasNodeByName(nodeTypeName).first().dblclick();
|
2022-11-25 04:09:44 -08:00
|
|
|
},
|
2022-12-15 06:36:28 -08:00
|
|
|
openExpressionEditorModal: () => {
|
2022-12-14 05:43:02 -08:00
|
|
|
cy.contains('Expression').invoke('show').click();
|
|
|
|
cy.getByTestId('expander').invoke('show').click();
|
2022-12-01 04:26:22 -08:00
|
|
|
},
|
2023-02-09 01:04:12 -08:00
|
|
|
openTagManagerModal: () => {
|
|
|
|
this.getters.createTagButton().click();
|
|
|
|
this.getters.tagsDropdown().find('li.manage-tags').first().click();
|
|
|
|
},
|
2022-12-15 06:36:28 -08:00
|
|
|
openInlineExpressionEditor: () => {
|
|
|
|
cy.contains('Expression').invoke('show').click();
|
|
|
|
this.getters.inlineExpressionEditorInput().click();
|
|
|
|
},
|
2022-11-25 06:32:09 -08:00
|
|
|
openWorkflowMenu: () => {
|
|
|
|
this.getters.workflowMenu().click();
|
|
|
|
},
|
2023-02-08 12:41:35 -08:00
|
|
|
openShareModal: () => {
|
|
|
|
this.getters.shareButton().click();
|
|
|
|
},
|
2022-11-25 06:32:09 -08:00
|
|
|
saveWorkflowOnButtonClick: () => {
|
2023-02-08 05:48:28 -08:00
|
|
|
this.getters.saveButton().should('contain', 'Save');
|
2022-11-25 06:32:09 -08:00
|
|
|
this.getters.saveButton().click();
|
2023-02-14 06:13:00 -08:00
|
|
|
this.getters.saveButton().should('contain', 'Saved');
|
2022-11-25 06:32:09 -08:00
|
|
|
},
|
|
|
|
saveWorkflowUsingKeyboardShortcut: () => {
|
|
|
|
cy.get('body').type('{meta}', { release: false }).type('s');
|
|
|
|
},
|
2023-02-14 06:13:00 -08:00
|
|
|
setWorkflowName: (name: string) => {
|
|
|
|
this.getters.workflowNameInput().should('be.disabled');
|
|
|
|
this.getters.workflowNameInput().parent().click();
|
|
|
|
this.getters.workflowNameInput().should('be.enabled');
|
|
|
|
this.getters.workflowNameInput().clear().type(name).type('{enter}');
|
|
|
|
},
|
2022-11-25 06:32:09 -08:00
|
|
|
activateWorkflow: () => {
|
2023-03-02 07:50:21 -08:00
|
|
|
cy.intercept('PATCH', '/rest/workflows/*').as('activateWorkflow');
|
2022-11-25 06:32:09 -08:00
|
|
|
this.getters.activatorSwitch().find('input').first().should('be.enabled');
|
|
|
|
this.getters.activatorSwitch().click();
|
2023-03-02 07:50:21 -08:00
|
|
|
cy.wait('@activateWorkflow');
|
2022-11-25 06:32:09 -08:00
|
|
|
cy.get('body').type('{esc}');
|
|
|
|
},
|
|
|
|
renameWorkflow: (newName: string) => {
|
2022-11-25 08:10:28 -08:00
|
|
|
this.getters.workflowNameInputContainer().click();
|
2022-11-25 06:32:09 -08:00
|
|
|
cy.get('body').type('{selectall}');
|
|
|
|
cy.get('body').type(newName);
|
|
|
|
cy.get('body').type('{enter}');
|
|
|
|
},
|
2023-02-09 01:04:12 -08:00
|
|
|
addTags: (tags: string | string[]) => {
|
|
|
|
if (!Array.isArray(tags)) tags = [tags];
|
|
|
|
|
2022-12-15 07:39:59 -08:00
|
|
|
tags.forEach((tag) => {
|
2022-12-05 05:31:14 -08:00
|
|
|
this.getters.workflowTagsInput().type(tag);
|
|
|
|
this.getters.workflowTagsInput().type('{enter}');
|
2022-11-25 08:10:28 -08:00
|
|
|
});
|
|
|
|
cy.get('body').type('{enter}');
|
2022-12-13 02:55:51 -08:00
|
|
|
// For a brief moment the Element UI tag component shows the tags as(+X) string
|
|
|
|
// so we need to wait for it to disappear
|
|
|
|
this.getters.workflowTagsContainer().should('not.contain', `+${tags.length}`);
|
2022-11-25 08:10:28 -08:00
|
|
|
},
|
2022-12-01 00:26:38 -08:00
|
|
|
zoomToFit: () => {
|
|
|
|
cy.getByTestId('zoom-to-fit').click();
|
|
|
|
},
|
2022-12-14 01:33:44 -08:00
|
|
|
hitUndo: () => {
|
2022-12-20 01:33:20 -08:00
|
|
|
cy.get('body').type(META_KEY, { delay: 500, release: false }).type('z');
|
2022-12-14 01:33:44 -08:00
|
|
|
},
|
|
|
|
hitRedo: () => {
|
2022-12-15 07:39:59 -08:00
|
|
|
cy.get('body')
|
2022-12-20 01:33:20 -08:00
|
|
|
.type(META_KEY, { delay: 500, release: false })
|
2022-12-15 07:39:59 -08:00
|
|
|
.type('{shift}', { release: false })
|
|
|
|
.type('z');
|
2022-12-14 01:33:44 -08:00
|
|
|
},
|
|
|
|
selectAll: () => {
|
2022-12-20 01:33:20 -08:00
|
|
|
cy.get('body').type(META_KEY, { delay: 500, release: false }).type('a');
|
2022-12-14 01:33:44 -08:00
|
|
|
},
|
|
|
|
hitDisableNodeShortcut: () => {
|
2022-12-20 01:33:20 -08:00
|
|
|
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');
|
2022-12-14 01:33:44 -08:00
|
|
|
},
|
2023-01-18 06:48:36 -08:00
|
|
|
executeWorkflow: () => {
|
|
|
|
this.getters.executeWorkflowButton().click();
|
|
|
|
},
|
2023-02-07 07:34:08 -08:00
|
|
|
addNodeBetweenNodes: (sourceNodeName: string, targetNodeName: string, newNodeName: string) => {
|
|
|
|
this.getters.getConnectionBetweenNodes(sourceNodeName, targetNodeName).first().realHover();
|
2023-02-09 01:04:12 -08:00
|
|
|
this.getters
|
|
|
|
.getConnectionActionsBetweenNodes(sourceNodeName, targetNodeName)
|
|
|
|
.find('.add')
|
|
|
|
.first()
|
|
|
|
.click({ force: true });
|
2023-02-07 07:34:08 -08:00
|
|
|
this.actions.addNodeToCanvas(newNodeName, false);
|
|
|
|
},
|
2023-02-09 01:04:12 -08:00
|
|
|
deleteNodeBetweenNodes: (
|
|
|
|
sourceNodeName: string,
|
|
|
|
targetNodeName: string,
|
|
|
|
newNodeName: string,
|
|
|
|
) => {
|
2023-02-07 07:34:08 -08:00
|
|
|
this.getters.getConnectionBetweenNodes(sourceNodeName, targetNodeName).first().realHover();
|
2023-02-09 01:04:12 -08:00
|
|
|
this.getters
|
|
|
|
.getConnectionActionsBetweenNodes(sourceNodeName, targetNodeName)
|
|
|
|
.find('.delete')
|
|
|
|
.first()
|
|
|
|
.click({ force: true });
|
2023-02-06 07:33:59 -08:00
|
|
|
},
|
2023-02-14 02:39:19 -08:00
|
|
|
turnOnManualExecutionSaving: () => {
|
|
|
|
this.getters.workflowMenu().click();
|
|
|
|
this.getters.workflowMenuItemSettings().click();
|
2023-03-08 06:11:13 -08:00
|
|
|
cy.get('.el-loading-mask').should('not.be.visible');
|
2023-02-14 02:39:19 -08:00
|
|
|
this.getters
|
|
|
|
.workflowSettingsSaveManualExecutionsSelect()
|
|
|
|
.find('li:contains("Yes")')
|
|
|
|
.click({ force: true });
|
2023-03-08 06:11:13 -08:00
|
|
|
|
|
|
|
this.getters.workflowSettingsSaveManualExecutionsSelect().should('contain', 'Yes');
|
2023-02-14 02:39:19 -08:00
|
|
|
this.getters.workflowSettingsSaveButton().click();
|
|
|
|
this.getters.successToast().should('exist');
|
2023-03-08 06:11:13 -08:00
|
|
|
|
|
|
|
this.getters.workflowMenu().click();
|
|
|
|
this.getters.workflowMenuItemSettings().click();
|
|
|
|
this.getters.workflowSettingsSaveManualExecutionsSelect().should('contain', 'Yes');
|
|
|
|
this.getters.workflowSettingsSaveButton().click();
|
2023-02-14 02:39:19 -08:00
|
|
|
},
|
2022-11-11 00:07:14 -08:00
|
|
|
};
|
|
|
|
}
|