n8n/packages/testing/playwright
2025-07-16 09:05:11 +01:00
..
composables ci: Test container enhancements (#17008) 2025-07-10 11:50:03 +01:00
config ci: Test container enhancements (#17008) 2025-07-10 11:50:03 +01:00
fixtures ci: Test container enhancements (#17008) 2025-07-10 11:50:03 +01:00
pages ci: Test container enhancements (#17008) 2025-07-10 11:50:03 +01:00
services ci: Test container enhancements (#17008) 2025-07-10 11:50:03 +01:00
tests feat: Add testcontainers and Playwright (no-changelog) (#16662) 2025-07-01 14:15:31 +01:00
utils feat: Add testcontainers and Playwright (no-changelog) (#16662) 2025-07-01 14:15:31 +01:00
workflows feat: Add testcontainers and Playwright (no-changelog) (#16662) 2025-07-01 14:15:31 +01:00
currents.config.ts ci: Enable Playwright tests in PRs (#17238) 2025-07-16 09:05:11 +01:00
eslint.config.mjs ci: Test container enhancements (#17008) 2025-07-10 11:50:03 +01:00
global-setup.ts ci: Enable Playwright tests in PRs (#17238) 2025-07-16 09:05:11 +01:00
package.json ci: Test container enhancements (#17008) 2025-07-10 11:50:03 +01:00
playwright.config.ts ci: Enable Playwright tests in PRs (#17238) 2025-07-16 09:05:11 +01:00
README.md feat: Add testcontainers and Playwright (no-changelog) (#16662) 2025-07-01 14:15:31 +01:00
tsconfig.json feat: Add testcontainers and Playwright (no-changelog) (#16662) 2025-07-01 14:15:31 +01:00
Types.ts feat: Add testcontainers and Playwright (no-changelog) (#16662) 2025-07-01 14:15:31 +01:00

Playwright E2E Test Guide

Quick Start

pnpm test                 # Run all tests (fresh containers)
pnpm run test:local       # Run against http://localhost:5678

Test Commands

# By Mode
pnpm run test:standard    # Basic n8n
pnpm run test:postgres    # PostgreSQL
pnpm run test:queue       # Queue mode
pnpm run test:multi-main  # HA setup

# Development
pnpm test --grep "workflow"           # Pattern match

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