mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 01:56:46 +00:00
fix: Add Exact Match Option for NDV (no-changelog) (#15787)
Co-authored-by: Eugene Molodkin <eugene@n8n.io>
This commit is contained in:
@@ -179,35 +179,52 @@ export function executeWorkflowAndWait(waitForSuccessBannerToDisappear = true) {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param nodeDisplayName - The name of the node to add to the canvas
|
||||
* @param plusButtonClick - Whether to click the plus button to open the node creator
|
||||
* @param preventNdvClose - Whether to prevent the Ndv from closing
|
||||
* @param action - The action to select in the node creator
|
||||
* @param useExactMatch - Whether to use an exact match for the node name will use selector instead of enter key
|
||||
*/
|
||||
export function addNodeToCanvas(
|
||||
nodeDisplayName: string,
|
||||
plusButtonClick = true,
|
||||
preventNdvClose?: boolean,
|
||||
action?: string,
|
||||
useExactMatch = false,
|
||||
) {
|
||||
if (plusButtonClick) {
|
||||
getNodeCreatorPlusButton().click();
|
||||
}
|
||||
|
||||
getNodeCreatorSearchBar().type(nodeDisplayName);
|
||||
getNodeCreatorSearchBar().type('{enter}');
|
||||
|
||||
if (useExactMatch) {
|
||||
cy.getByTestId('node-creator-item-name').contains(nodeDisplayName).click();
|
||||
} else {
|
||||
getNodeCreatorSearchBar().type('{enter}');
|
||||
}
|
||||
|
||||
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 {
|
||||
// Select the first action
|
||||
cy.get('[data-keyboard-nav-type="action"]').eq(0).click();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
if (!preventNdvClose) cy.get('body').type('{esc}');
|
||||
if (!preventNdvClose) {
|
||||
cy.get('body').type('{esc}');
|
||||
}
|
||||
}
|
||||
|
||||
export function navigateToNewWorkflowPage(preventNodeViewUnload = true) {
|
||||
cy.visit(ROUTES.NEW_WORKFLOW_PAGE);
|
||||
cy.getByTestId('node-creator-plus-button').should('be.visible');
|
||||
cy.waitForLoad();
|
||||
cy.window().then((win) => {
|
||||
win.preventNodeViewBeforeUnload = preventNodeViewUnload;
|
||||
|
||||
Reference in New Issue
Block a user