n8n/packages/testing/playwright
2025-08-12 12:06:42 +01:00
..
composables test: Migrate UI tests from Cypress -> Playwright (no-changelog) (#18201) 2025-08-12 12:06:42 +01:00
config test: Migrate UI tests from Cypress -> Playwright (no-changelog) (#18201) 2025-08-12 12:06:42 +01:00
fixtures test: Migrate UI tests from Cypress -> Playwright (no-changelog) (#18201) 2025-08-12 12:06:42 +01:00
pages test: Migrate UI tests from Cypress -> Playwright (no-changelog) (#18201) 2025-08-12 12:06:42 +01:00
services test: Migrate UI tests from Cypress -> Playwright (no-changelog) (#18201) 2025-08-12 12:06:42 +01:00
tests test: Migrate UI tests from Cypress -> Playwright (no-changelog) (#18201) 2025-08-12 12:06:42 +01:00
utils test: Migrate UI tests from Cypress -> Playwright (no-changelog) (#18201) 2025-08-12 12:06:42 +01:00
workflows test: Migrate UI tests from Cypress -> Playwright (no-changelog) (#18201) 2025-08-12 12:06:42 +01:00
CONTRIBUTING.md test: Migrate 1-workflows to Playwright (#17360) 2025-08-01 10:27:48 +01:00
currents.config.ts ci: Enable Playwright tests in PRs (#17238) 2025-07-16 09:05:11 +01:00
eslint.config.mjs test: Migrate UI tests from Cypress -> Playwright (no-changelog) (#18201) 2025-08-12 12:06:42 +01:00
global-setup.ts ci: Fix timing issue (#17984) 2025-08-05 09:57:48 +01:00
package.json test: Migrate UI tests from Cypress -> Playwright (no-changelog) (#18201) 2025-08-12 12:06:42 +01:00
playwright-projects.ts ci: Playwright project organization (#17905) 2025-08-04 19:59:06 +01:00
playwright.config.ts ci: Playwright project organization (#17905) 2025-08-04 19:59:06 +01:00
README.md feat(editor): Add Production checklist for active workflows (#17756) 2025-08-06 11:15:10 +02:00
tsconfig.json feat: Add testcontainers and Playwright (no-changelog) (#16662) 2025-07-01 14:15:31 +01:00
Types.ts test: Migrate UI tests from Cypress -> Playwright (no-changelog) (#18201) 2025-08-12 12:06:42 +01:00

Playwright E2E Test Guide

Development setup

pnpm install-browsers:local # in playwright directory
pnpm build:docker # from root first to test against local changes

Quick Start

pnpm test:all                 									# Run all tests (fresh containers, pnpm build:docker from root first to ensure local containers)
pnpm test:local           											# Starts a local server and runs the UI tests
N8N_BASE_URL=localhost:5068 pnpm test:local			# Runs the UI tests against the instance running

Test Commands

# By Mode
pnpm test:container:standard    # Sqlite
pnpm test:container:postgres    # PostgreSQL
pnpm test:container:queue       # Queue mode
pnpm test:container:multi-main  # HA setup

pnpm test:performance						# Runs the performance tests against Sqlite container
pnpm test:chaos									# Runs the chaos tests


# Development
pnpm test:all --grep "workflow"           # Pattern match, can run across all test types UI/cli-workflow/performance
pnpm test:local --ui            # To enable UI debugging and test running mode

Test Tags

test('basic test', ...)                              // All modes, fully parallel
test('postgres only @mode:postgres', ...)            // Mode-specific
test('needs clean db @db:reset', ...)                // Sequential per worker
test('chaos test @mode:multi-main @chaostest', ...) // Isolated per worker

Tips

  • test:* commands use fresh containers (for testing)
  • VS Code: Set N8N_BASE_URL in Playwright settings to run tests directly from VS Code
  • Pass custom env vars via N8N_TEST_ENV='{"KEY":"value"}'

Project Layout

  • composables: Multi-page interactions (e.g., WorkflowComposer.executeWorkflowAndWaitForNotification())
  • config: Test setup and configuration (constants, test users, etc.)
  • fixtures: Custom test fixtures extending Playwright's base test
  • pages: Page Object Models for UI interactions
  • services: API helpers for E2E controller, REST calls, etc.
  • utils: Utility functions (string manipulation, helpers, etc.)
  • workflows: Test workflow JSON files for import/reuse

Writing Tests

For guidelines on writing new tests, see CONTRIBUTING.md.