mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-16 17:46:45 +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:
@@ -36,6 +36,10 @@ export function getInputSelect() {
|
||||
return cy.getByTestId('ndv-input-select').find('input');
|
||||
}
|
||||
|
||||
export function getInputLinkRun() {
|
||||
return getInputPanel().findChildByTestId('link-run');
|
||||
}
|
||||
|
||||
export function getMainPanel() {
|
||||
return cy.getByTestId('node-parameters');
|
||||
}
|
||||
@@ -68,6 +72,14 @@ export function getInputTbodyCell(row: number, col: number) {
|
||||
return getInputTableRows().eq(row).find('td').eq(col);
|
||||
}
|
||||
|
||||
export function getInputRunSelector() {
|
||||
return getInputPanel().findChildByTestId('run-selector');
|
||||
}
|
||||
|
||||
export function getInputPanelItemsCount() {
|
||||
return getInputPanel().getByTestId('ndv-items-count');
|
||||
}
|
||||
|
||||
export function getOutputPanelDataContainer() {
|
||||
return getOutputPanel().findChildByTestId('ndv-data-container');
|
||||
}
|
||||
@@ -329,3 +341,7 @@ export function resetHoverState() {
|
||||
export function setInputDisplayMode(mode: 'Schema' | 'Table' | 'JSON' | 'Binary') {
|
||||
getInputPanel().findChildByTestId('ndv-run-data-display-mode').contains(mode).click();
|
||||
}
|
||||
|
||||
export function toggleInputRunLinking() {
|
||||
getInputLinkRun().click();
|
||||
}
|
||||
|
||||
@@ -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