Skip to content

Conversation

@alexgrozav
Copy link
Member

@alexgrozav alexgrozav commented Dec 4, 2025

Summary

This pull request enhances the Playwright end-to-end testing setup to support running tests against separate backend and frontend servers, improving flexibility for local development and CI environments. The changes introduce new environment variables, update test fixtures and configuration, and improve documentation to clarify usage. The most important changes are:

Support for Separate Backend and Frontend URLs:

  • Added support for N8N_BASE_URL (backend) and N8N_EDITOR_URL (frontend) environment variables, allowing tests to target different URLs for API calls and browser navigation. This enables workflows where the backend and frontend run on different ports or servers. [1] [2]

  • Updated test fixtures (base.ts) to provide backendUrl and frontendUrl to tests, ensuring API requests and browser navigation go to the correct endpoints. The n8nPage class now receives an API helper instance that uses the backend URL. [1] [2] [3] [4] [5] [6] [7] [8]

Configuration and Command Updates:

  • Modified Playwright configuration and project setup to use the new URL helpers, ensuring the correct URLs are used for web server startup and test execution. Added a new dev script for local development with separate backend/frontend, and a dev:fe:e2e script for frontend-only e2e development. [1] [2] [3] [4] [5] [6] [7] [8]

Documentation Improvements:

  • Expanded the Playwright testing README with clear instructions and examples for using separate backend and frontend URLs, describing environment variables, test behavior, and compatibility notes.

Codebase Simplification and Consistency:

  • Centralized URL logic in a new url-helper utility, reducing duplication and making it easier to manage environment-based configuration throughout the test suite. [1] [2]

These changes make it easier to run and debug end-to-end tests in various development setups, and clarify how to configure the environment for both local and CI workflows.

Related Linear tickets, Github issues, and Community forum posts

cat-1890-allow-running-playwright-e2e-in-dev-mode-using-vite

Review / Merge checklist

  • PR title and summary are descriptive. (conventions)
  • Docs updated or follow-up ticket created.
  • Tests included.
  • PR Labeled with release/backport (if the PR is an urgent fix that needs to be backported)

@n8n-assistant n8n-assistant bot added the n8n team Authored by the n8n team label Dec 4, 2025
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 issue found across 9 files

Prompt for AI agents (all 1 issues)

Check if these issues are valid — if so, understand the root cause of each and fix them.


<file name="packages/testing/playwright/fixtures/base.ts">

<violation number="1" location="packages/testing/playwright/fixtures/base.ts:127">
P2: Comment references incorrect environment variable. The comment mentions `N8N_BACKEND_URL` but `getBackendUrl()` actually reads `N8N_BASE_URL`.</violation>
</file>

Reply to cubic to teach it or ask questions. Re-run a review with @cubic-dev-ai review this PR

@codecov
Copy link

codecov bot commented Dec 4, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@blacksmith-sh
Copy link

blacksmith-sh bot commented Dec 4, 2025

Found 4 test failures on Blacksmith runners:

Failures

Test View Logs
tests/ui/17-sharing.spec.ts/
@isolated › Sharing - Workflow and Credential Sharing (Sequential) › should create C2,
share C2 with U1 and U2, as U3
View Logs
tests/ui/18-user-management.spec.ts/
User Management › should prevent non-owners to access UM settings
View Logs
tests/ui/56-workflow-viewer-permissions.spec.ts/
Workflow Viewer Permissions @isolated › user without workflow:update can copy but canno
t paste @auth:owner
View Logs
tests/ui/task-runner-demo.spec.ts/
Task Runner Capability @capability:task-runner › should execute Python with task runner
enabled
View Logs

Fix in Cursor

@currents-bot
Copy link

currents-bot bot commented Dec 4, 2025

E2E Tests: n8n tests failed after 10m 8.8s

🟢 582 · 🔴 4 · ⚪️ 52 · 🟣 4

View Run Details

Run Details

  • Project: n8n

  • Groups: 2

  • Framework: Playwright

  • Run Status: Failed

  • Commit: ef11621

  • Spec files: 108

  • Overall tests: 638

  • Duration: 10m 8.8s

  • Parallelization: 9

Failed Spec Files

Spec File Failures
tests/ui/18-user-management.spec.ts 1
tests/ui/task-runner-demo.spec.ts 1
tests/ui/17-sharing.spec.ts 1
tests/ui/56-workflow-viewer-permissions.spec.ts 1

Groups

GroupId Results Spec Files Progress
multi-main:ui 🟢 543 · 🔴 2 · ⚪️ 39 · 🟣 3 100 / 100
multi-main:ui:isolated 🟢 39 · 🔴 2 · ⚪️ 13 · 🟣 1 8 / 8


This message was posted automatically by currents.dev | Integration Settings

Copy link
Contributor

@shortstacked shortstacked left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The change is solid. The only area of concern is that when we are running n8n in dev mode it's less responsive. This could lead to more test failures, or the developers feeling the tests are flaky. We might want to look at making dev mode on par with regular running.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

n8n team Authored by the n8n team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants