ci: Refactor e2e tests to be less flaky (no-changelog) (#9695)

This commit is contained in:
कारतोफ्फेलस्क्रिप्ट™
2024-06-11 14:45:15 +02:00
committed by GitHub
parent bc35e8c33d
commit 3d0393c739
39 changed files with 485 additions and 539 deletions

View File

@@ -1,5 +1,6 @@
import 'cypress-real-events';
import FakeTimers from '@sinonjs/fake-timers';
import type { IN8nUISettings } from 'n8n-workflow';
import { WorkflowPage } from '../pages';
import {
BACKEND_BASE_URL,
@@ -66,9 +67,9 @@ Cypress.Commands.add('signin', ({ email, password }) => {
);
});
Cypress.Commands.add('signinAsOwner', () => {
cy.signin({ email: INSTANCE_OWNER.email, password: INSTANCE_OWNER.password });
});
Cypress.Commands.add('signinAsOwner', () => cy.signin(INSTANCE_OWNER));
Cypress.Commands.add('signinAsAdmin', () => cy.signin(INSTANCE_ADMIN));
Cypress.Commands.add('signinAsMember', (index = 0) => cy.signin(INSTANCE_MEMBERS[index]));
Cypress.Commands.add('signout', () => {
cy.request({
@@ -79,8 +80,9 @@ Cypress.Commands.add('signout', () => {
cy.getCookie(N8N_AUTH_COOKIE).should('not.exist');
});
Cypress.Commands.add('interceptREST', (method, url) => {
cy.intercept(method, `${BACKEND_BASE_URL}/rest${url}`);
export let settings: Partial<IN8nUISettings>;
Cypress.Commands.add('overrideSettings', (value: Partial<IN8nUISettings>) => {
settings = value;
});
const setFeature = (feature: string, enabled: boolean) =>