Skip to content

E2E Test Specifications

This directory contains E2E test specifications for App Suite for Teams. Each specification documents user workflows, acceptance criteria, and test scenarios for Playwright tests.

Application Overview

App Suite for Teams is a collaborative email management application built on Vue 3 with real-time synchronization capabilities. Key technical components:

Real-time Collaboration

  • Yjs (CRDT): Conflict-free state sharing for collaborative editing
  • TipTap: Rich text editor with collaboration extensions
  • WebSocket: Custom provider for real-time notifications and awareness
  • PostgreSQL + IndexedDB: Persistent storage for shared state

Architecture

  • Frontend: Vue 3 SPA with Pinia state management
  • Backend: Fastify with PostgreSQL database
  • Authentication: JWT-based with <username>@teams format
  • Real-time: WebSocket for notifications, Yjs awareness for presence

See Technical Patterns for detailed architecture patterns.

Test Environment

Standard Configuration

  • URL: https://localhost:5173/ (or configured LAUNCH_URL)
  • Authentication: Users log in with <username>@teams format
  • Shared Inbox: Tests use "Support" inbox by default
  • Multi-user: Tests support multiple authenticated browser contexts

Running Tests

# Run all E2E tests
pnpm e2e

# Run single spec
LAUNCH_URL=https://localhost:5173 npx playwright test e2e/tests/[test-name].spec.js

# Run with specific browser
npx playwright test --project=chromium

# Debug mode
npx playwright test --debug

Common Fixtures

Authentication

  • storageState: Persisted auth state for test users
  • users: Array fixture providing multiple authenticated users
  • Format: Login with <username>@teams (e.g., alice@teams, bob@teams)

Data Setup

  • sendMail: Fixture for sending test emails to shared inbox
  • inbox: Access to shared inbox (default: "Support")
  • thread: Thread creation and manipulation

Multi-user Testing

  • Parallel contexts: Tests can spawn multiple authenticated browser contexts
  • Storage states: Each user has persistent authentication
  • Synchronization: Tests verify real-time sync across users

See E2E Testing Guide for comprehensive fixture documentation.

Test Specification Format

Each test spec follows this structure:

1. Feature Description

Brief description of the feature being tested and its purpose.

2. Seed Data Requirements

Test-specific preconditions and data setup requirements.

3. Test Scenarios

Structured test cases with:

  • Objective: What the test verifies
  • Preconditions: Required setup
  • Test Steps: User actions to perform
  • Expected Results: Observable outcomes

4. Edge Cases (if applicable)

Boundary conditions, error states, and unusual scenarios.

Test Organization

Test specifications are organized by feature:

SpecificationTest FileDescription
assignee-spec.mdassignee.spec.jsThread assignment workflow
comments-spec.mdcomments.spec.jsComment threads functionality
deep-links-spec.mddeep-links.spec.jsURL-based thread navigation
draft-awareness-spec.mddraft-awareness.spec.jsCollaborative draft awareness
inbox-list-spec.mdinbox-list.spec.jsInbox list and thread management
mail-detail-spec.mdmail-detail.spec.jsThread detail view
mentions-keyboard-navigation-spec.mdmention-keyboard-navigation.spec.jsMention autocomplete keyboard UX
multiuser-spec.mdmultiuser.spec.jsReal-time multi-user collaboration
provisioning-spec.mdprovisioning.spec.jsAccount setup and configuration
reply-spec.mdreply.spec.jsEmail reply functionality
status-spec.mdstatus.spec.jsThread status tracking
categories-spec.mdtagging.spec.jsThread categories
tour-view-spec.mdtour-view.spec.jsApplication tour

Writing Test Specifications

When creating new test specs:

  1. Focus on scenarios: Describe user workflows, not implementation details
  2. Be specific: Include concrete examples and expected outcomes
  3. Avoid duplication: Reference this index for common patterns
  4. Keep concise: Target 150-200 lines per spec
  5. Reference patterns: Link to Technical Patterns instead of repeating architecture details

Troubleshooting

Common Issues

  • Authentication failures: Verify <username>@teams format
  • Timeout errors: Check that backend (pnpm dev) and frontend (pnpm vite dev) are running
  • WebSocket connection: Ensure both services are accessible
  • Test data: Confirm "Support" inbox exists and is accessible

Debug Strategies

  • Use --headed flag to watch tests execute
  • Add await page.pause() to inspect state
  • Check browser console for errors
  • Verify network requests in DevTools

See E2E Troubleshooting Guide for comprehensive troubleshooting.