Skip to content

Playwright E2E Testing

While our PHPUnit and Jest configurations ensure the fundamental mechanics of the architecture are robust locally, our massive End-to-End (E2E) Test Suite in e2e-tests/ simulates the entire lifecycle of our Minimum Viable Product.

Using Playwright, these tests boot and interact with the application precisely as an end-user driving the presentation flows.

What is Covered?

The E2E suite verifies the 33 architectural structural flows explicitly without mocked UI dependencies. The test directory is incredibly specialized:

plaintext
e2e-tests/tests/
  ├── workflows/                 # The core MVP Canonical Flow orchestrations 
  │     └── subscription-digest-complete-flow.spec.ts
  ├── digests/                   # Delivery of scheduled context reporting
  │     ├── digest-with-ai-summaries.spec.ts 
  │     └── digest-distribution-multi-channel.spec.ts
  ├── slack-ui/                  # App Home layout assertions
  ├── slack-interactions/        # Context menus, clicking 'Add Knowledge', etc
  ├── categories/                # Category Subscriptions CRUD validations 
  ├── notion/                    # Validating the sync status and Notion mockups
  └── summaries/                 # Validating AI Generation flows

Running the E2E Suite

Playwright tests require both the Symfony API and the Slack Node.js instance to be fully functional or successfully mocked in local infrastructure.

bash
cd e2e-tests
npm install

# Run the complete test suite headless
npx playwright test

# Or using the package.json wrapper
npm run test:e2e

UI Interaction Mode

Playwright offers an incredible trace viewer and UI runner, which is mandatory when debugging complex state failures like why a Home layout didn't render perfectly.

bash
npx playwright test --ui

Segmented Testing

To execute isolated MVP paths:

bash
# Test ONLY the digest flows
npx playwright test tests/digests

# Execute specifically on categories
npx playwright test tests/categories/category-subscription.spec.ts

The Canonical E2E Flow

At the heart of our E2E framework is validating the Knowledge -> AI -> Digest MVP path mapped out in our AI Summaries Flow.

An exemplary test mimics the user adding a URL in Slack:

  1. Intercepting Slack: A Playwright worker dispatches a mocked Slash Command (/knowledge) via our test helpers.
  2. Symfony Execution: The API processes the request, firing an AI Summary job in the background.
  3. Job Validation: The test intercepts the internal worker status locally, verifying the summary is placed into the correct Knowledge table target groupings.
  4. Digest Generation: Finally, the test forcibly steps the internal cron schedule, verifying the exact UI Blocks that render the Digest Notification to the subscribed mock-user.

IMPORTANT

If you make severe UI layout changes to your Action IDs or Block Kit structures in Node, or refactor a major Orchestrator property in Symfony, these suites will fail. They represent the final seal of stability for the application.