fix(editor): Fix and re-enable e2e test (no-changelog) (#13535)

This commit is contained in:
Csaba Tuncsik
2025-02-28 07:10:09 +01:00
committed by GitHub
parent 0c266b3060
commit 1c5f1cab37
3 changed files with 17 additions and 21 deletions

View File

@@ -54,11 +54,7 @@ describe('Projects', { disableAutoLogin: true }, () => {
cy.changeQuota('maxTeamProjects', -1);
});
/**
* @TODO: New Canvas - Fix this test
*/
// eslint-disable-next-line n8n-local-rules/no-skipped-tests
it.skip('should filter credentials by project ID when creating new workflow or hard reloading an opened workflow', () => {
it('should filter credentials by project ID when creating new workflow or hard reloading an opened workflow', () => {
cy.signinAsOwner();
cy.visit(workflowsPage.url);
@@ -453,6 +449,8 @@ describe('Projects', { disableAutoLogin: true }, () => {
});
it('should allow to change inaccessible credential when the workflow was moved to a team project', () => {
cy.intercept('GET', /\/rest\/(workflows|credentials).*/).as('getResources');
cy.signinAsOwner();
cy.visit(workflowsPage.url);
@@ -474,15 +472,14 @@ describe('Projects', { disableAutoLogin: true }, () => {
// Create a project and add a user to it
projects.createProject('Project 1');
projects.addProjectMember(INSTANCE_MEMBERS[0].email);
clearNotifications();
projects.getProjectSettingsSaveButton().click();
// Move the workflow from Home to Project 1
projects.getHomeButton().click();
workflowsPage.getters
.workflowCards()
.should('have.length', 1)
.filter(':contains("Personal")')
.should('exist');
workflowsPage.getters.workflowCards().should('have.length', 1);
workflowsPage.getters.workflowCards().filter(':contains("Personal")').should('exist');
workflowsPage.getters.workflowCardActions('My workflow').click();
workflowsPage.getters.workflowMoveButton().click();
@@ -492,13 +489,13 @@ describe('Projects', { disableAutoLogin: true }, () => {
.contains('button', 'Move workflow')
.should('be.disabled');
projects.getProjectMoveSelect().click();
getVisibleSelect()
.find('li')
.should('have.length', 4)
.filter(':contains("Project 1")')
.click();
getVisibleSelect().find('li').should('have.length', 4);
getVisibleSelect().find('li').filter(':contains("Project 1")').click();
projects.getResourceMoveModal().contains('button', 'Move workflow').click();
clearNotifications();
cy.wait('@getResources');
workflowsPage.getters
.workflowCards()
.should('have.length', 1)

View File

@@ -16,9 +16,11 @@ export const clearNotifications = () => {
const notificationSelector = '.el-notification:has(.el-notification--success)';
cy.get('body').then(($body) => {
if ($body.find(notificationSelector).length) {
cy.get(notificationSelector)
.find('.el-notification__closeBtn')
.click({ multiple: true, force: true });
cy.get(notificationSelector).each(($el) => {
if ($el.find('.el-notification__closeBtn').length) {
cy.wrap($el).find('.el-notification__closeBtn').click({ force: true });
}
});
}
});
};