diff --git a/cypress/constants.ts b/cypress/constants.ts index dcb96b5ffd..06ccbd7130 100644 --- a/cypress/constants.ts +++ b/cypress/constants.ts @@ -1,6 +1,5 @@ import { randFirstName, randLastName } from '@ngneat/falso'; -export const BASE_URL = 'http://localhost:5678'; export const BACKEND_BASE_URL = 'http://localhost:5678'; export const N8N_AUTH_COOKIE = 'n8n-auth'; diff --git a/cypress/support/commands.ts b/cypress/support/commands.ts index 505022934a..6c7adaea8f 100644 --- a/cypress/support/commands.ts +++ b/cypress/support/commands.ts @@ -1,6 +1,6 @@ import 'cypress-real-events'; import { WorkflowPage } from '../pages'; -import { BASE_URL, N8N_AUTH_COOKIE } from '../constants'; +import { BACKEND_BASE_URL, N8N_AUTH_COOKIE } from '../constants'; Cypress.Commands.add('getByTestId', (selector, ...args) => { return cy.get(`[data-test-id="${selector}"]`, ...args); @@ -41,11 +41,15 @@ Cypress.Commands.add('waitForLoad', (waitForIntercepts = true) => { Cypress.Commands.add('signin', ({ email, password }) => { Cypress.session.clearAllSavedSessions(); - cy.session([email, password], () => cy.request('POST', '/rest/login', { email, password }), { - validate() { - cy.getCookie(N8N_AUTH_COOKIE).should('exist'); + cy.session( + [email, password], + () => cy.request('POST', `${BACKEND_BASE_URL}/rest/login`, { email, password }), + { + validate() { + cy.getCookie(N8N_AUTH_COOKIE).should('exist'); + }, }, - }); + ); }); Cypress.Commands.add('signout', () => { @@ -58,7 +62,10 @@ Cypress.Commands.add('interceptREST', (method, url) => { }); const setFeature = (feature: string, enabled: boolean) => - cy.request('PATCH', `${BASE_URL}/rest/e2e/feature`, { feature: `feat:${feature}`, enabled }); + cy.request('PATCH', `${BACKEND_BASE_URL}/rest/e2e/feature`, { + feature: `feat:${feature}`, + enabled, + }); Cypress.Commands.add('enableFeature', (feature: string) => setFeature(feature, true)); Cypress.Commands.add('disableFeature', (feature): string => setFeature(feature, false)); diff --git a/cypress/support/e2e.ts b/cypress/support/e2e.ts index 456ba9efd9..dc3079282f 100644 --- a/cypress/support/e2e.ts +++ b/cypress/support/e2e.ts @@ -1,8 +1,8 @@ -import { BASE_URL, INSTANCE_MEMBERS, INSTANCE_OWNER } from '../constants'; +import { BACKEND_BASE_URL, INSTANCE_MEMBERS, INSTANCE_OWNER } from '../constants'; import './commands'; before(() => { - cy.request('POST', `${BASE_URL}/rest/e2e/reset`, { + cy.request('POST', `${BACKEND_BASE_URL}/rest/e2e/reset`, { owner: INSTANCE_OWNER, members: INSTANCE_MEMBERS, });