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-11-25 08:10:28 -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-05 05:31:14 -08:00
|
|
|
workflowTagsInput: () => this.getters.workflowTagsContainer().then(($el) => cy.wrap($el.find('input').first())),
|
2022-12-07 09:16:38 -08:00
|
|
|
workflowTagElements: () => cy.get('[data-test-id="workflow-tags-container"] span.tags > span'),
|
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
|
|
|
firstWorkflowTagElement: () => cy.get('[data-test-id="workflow-tags-container"] span.tags > span:nth-child(1)'),
|
2022-12-05 05:31:14 -08:00
|
|
|
workflowTagsDropdown: () => cy.getByTestId('workflow-tags-dropdown'),
|
2022-11-25 08:10:28 -08:00
|
|
|
newTagLink: () => 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'),
|
|
|
|
canvasNodeByName: (nodeName: string) => this.getters.canvasNodes().filter(`:contains("${nodeName}")`),
|
2022-11-25 04:09:44 -08:00
|
|
|
ndvParameterInput: (parameterName: string) =>
|
|
|
|
cy.getByTestId(`parameter-input-${parameterName}`),
|
|
|
|
ndvOutputPanel: () => cy.getByTestId('output-panel'),
|
2022-11-28 07:54:13 -08:00
|
|
|
ndvRunDataPaneHeader: () => cy.getByTestId('run-data-pane-header'),
|
|
|
|
successToast: () => cy.get('.el-notification__title'),
|
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'),
|
2022-12-01 04:26:22 -08:00
|
|
|
expressionModalInput: () => cy.getByTestId('expression-modal-input'),
|
|
|
|
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-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
|
|
|
},
|
2022-11-25 04:09:44 -08:00
|
|
|
addInitialNodeToCanvas: (nodeDisplayName: string) => {
|
|
|
|
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}');
|
|
|
|
cy.get('body').type('{esc}');
|
2022-11-25 04:09:44 -08:00
|
|
|
},
|
|
|
|
addNodeToCanvas: (nodeDisplayName: string) => {
|
|
|
|
this.getters.nodeCreatorPlusButton().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}');
|
|
|
|
cy.get('body').type('{esc}');
|
2022-11-25 04:09:44 -08:00
|
|
|
},
|
|
|
|
openNodeNdv: (nodeTypeName: string) => {
|
2022-12-01 00:26:38 -08:00
|
|
|
this.getters.canvasNodeByName(nodeTypeName).dblclick();
|
2022-11-25 04:09:44 -08:00
|
|
|
},
|
2022-12-01 04:26:22 -08:00
|
|
|
openExpressionEditor: () => {
|
|
|
|
cy.get('input[value="expression"]').parent('label').click();
|
|
|
|
},
|
2022-11-25 04:09:44 -08:00
|
|
|
typeIntoParameterInput: (parameterName: string, content: string) => {
|
|
|
|
this.getters.ndvParameterInput(parameterName).type(content);
|
|
|
|
},
|
2022-11-28 07:54:13 -08:00
|
|
|
selectOptionInParameterDropdown: (parameterName: string, content: string) => {
|
|
|
|
this.getters
|
|
|
|
.ndvParameterInput(parameterName)
|
|
|
|
.find('.option-headline')
|
|
|
|
.contains(content)
|
|
|
|
.click();
|
|
|
|
},
|
2022-11-25 04:09:44 -08:00
|
|
|
executeNodeFromNdv: () => {
|
|
|
|
cy.contains('Execute node').click();
|
|
|
|
},
|
2022-11-25 06:32:09 -08:00
|
|
|
openWorkflowMenu: () => {
|
|
|
|
this.getters.workflowMenu().click();
|
|
|
|
},
|
|
|
|
saveWorkflowOnButtonClick: () => {
|
|
|
|
this.getters.saveButton().click();
|
|
|
|
},
|
|
|
|
saveWorkflowUsingKeyboardShortcut: () => {
|
|
|
|
cy.get('body').type('{meta}', { release: false }).type('s');
|
|
|
|
},
|
|
|
|
activateWorkflow: () => {
|
|
|
|
this.getters.activatorSwitch().find('input').first().should('be.enabled');
|
|
|
|
this.getters.activatorSwitch().click();
|
|
|
|
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}');
|
|
|
|
},
|
2022-11-25 08:10:28 -08:00
|
|
|
addTags: (tags: string[]) => {
|
|
|
|
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-11-11 00:07:14 -08:00
|
|
|
};
|
|
|
|
}
|