-
Notifications
You must be signed in to change notification settings - Fork 51.5k
feat: Allow running Playwright e2e tests using Vite dev server (no-changelog) #22742
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this 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 Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
|
Found 4 test failures on Blacksmith runners: Failures
|
|
E2E Tests: n8n tests failed after 10m 8.8s Run Details
Failed Spec Files
Groups
This message was posted automatically by
currents.dev | Integration Settings
|
shortstacked
left a comment
There was a problem hiding this 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.
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) andN8N_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 providebackendUrlandfrontendUrlto tests, ensuring API requests and browser navigation go to the correct endpoints. Then8nPageclass now receives an API helper instance that uses the backend URL. [1] [2] [3] [4] [5] [6] [7] [8]Configuration and Command Updates:
devscript for local development with separate backend/frontend, and adev:fe:e2escript for frontend-only e2e development. [1] [2] [3] [4] [5] [6] [7] [8]Documentation Improvements:
Codebase Simplification and Consistency:
url-helperutility, 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
release/backport(if the PR is an urgent fix that needs to be backported)