fix(editor): Set workflow name when importing (no-changelog) (#19410)

This commit is contained in:
Daria
2025-09-11 15:29:41 +03:00
committed by GitHub
parent 3af4541391
commit b91219ea15
11 changed files with 53 additions and 30 deletions

View File

@@ -10,7 +10,6 @@ import {
N8N_AUTH_COOKIE,
} from '../constants';
import { WorkflowPage } from '../pages';
import { getUniqueWorkflowName } from '../utils/workflowUtils';
Cypress.Commands.add('setAppDate', (targetDate: number | Date) => {
cy.window().then((win) => {
@@ -26,22 +25,17 @@ Cypress.Commands.add('getByTestId', (selector, ...args) => {
return cy.get(`[data-test-id="${selector}"]`, ...args);
});
Cypress.Commands.add(
'createFixtureWorkflow',
(fixtureKey: string, workflowName = getUniqueWorkflowName()) => {
const workflowPage = new WorkflowPage();
Cypress.Commands.add('createFixtureWorkflow', (fixtureKey: string) => {
const workflowPage = new WorkflowPage();
// We need to force the click because the input is hidden
workflowPage.getters
.workflowImportInput()
.selectFile(`fixtures/${fixtureKey}`, { force: true });
// We need to force the click because the input is hidden
workflowPage.getters.workflowImportInput().selectFile(`fixtures/${fixtureKey}`, { force: true });
cy.waitForLoad(false);
workflowPage.actions.setWorkflowName(workflowName);
workflowPage.getters.saveButton().should('contain', 'Saved');
workflowPage.actions.zoomToFit();
},
);
cy.waitForLoad(false);
workflowPage.actions.saveWorkflowOnButtonClick();
workflowPage.getters.saveButton().should('contain', 'Saved');
workflowPage.actions.zoomToFit();
});
Cypress.Commands.addQuery('findChildByTestId', function (testId: string) {
return (subject: Cypress.Chainable) => subject.find(`[data-test-id="${testId}"]`);