/** * BDD E2E Test: Onboarding Wizard Flow * * Tests the complete onboarding wizard flow that guides new users through: * - Personal information collection (Step 1) * - Racing avatar creation (Step 2) * - Profile completion and redirection to dashboard * * Focus: Final user outcomes - what the driver sees and can verify */ import { expect } from '@playwright/test'; import { testWithAuth } from '../../shared/auth-fixture'; testWithAuth.describe('Onboarding Wizard Flow', () => { testWithAuth.beforeEach(async ({ unonboardedDriver }) => { // Navigate to onboarding page (assuming user needs onboarding) await unonboardedDriver.goto('/onboarding'); await unonboardedDriver.waitForLoadState('networkidle'); }); testWithAuth('New user sees onboarding wizard after authentication', async ({ unonboardedDriver }) => { await expect(unonboardedDriver.getByTestId('onboarding-wizard')).toBeVisible(); await expect(unonboardedDriver.getByTestId('step-1-personal-info')).toBeVisible(); }); testWithAuth('User sees onboarding wizard with two steps', async () => { // TODO: Implement test // Scenario: User sees onboarding wizard structure // Given I am on the onboarding page // Then I should see the "Personal Info" step // And I should see the "Racing Avatar" step // And I should see a progress indicator }); testWithAuth('User can navigate between onboarding steps', async () => { // TODO: Implement test // Scenario: User navigates between steps // Given I am on the onboarding page // When I complete step 1 // And I click "Next" // Then I should see step 2 // When I click "Back" // Then I should see step 1 again }); testWithAuth('User completes onboarding and is redirected to dashboard', async () => { // TODO: Implement test // Scenario: User completes onboarding // Given I am on the onboarding page // When I complete step 1 with valid data // And I complete step 2 with a valid avatar // And I submit the onboarding form // Then I should be redirected to the dashboard // And I should see my profile information }); testWithAuth('User sees onboarding help panel', async () => { // TODO: Implement test // Scenario: User sees help information // Given I am on the onboarding page // Then I should see the onboarding help panel // And I should see instructions for the current step }); testWithAuth('User sees avatar generation help on step 2', async () => { // TODO: Implement test // Scenario: User sees avatar generation help // Given I am on step 2 of onboarding // Then I should see avatar generation help // And I should see tips for taking a good photo }); testWithAuth('User cannot skip required onboarding steps', async () => { // TODO: Implement test // Scenario: User cannot skip steps // Given I am on the onboarding page // When I try to navigate to step 2 without completing step 1 // Then I should see validation errors // And I should not be able to proceed }); testWithAuth('User sees processing state during submission', async () => { // TODO: Implement test // Scenario: User sees processing indicator // Given I am on the onboarding page // When I submit the onboarding form // Then I should see a loading/processing indicator // And I should not be able to submit again }); testWithAuth('User sees error state when submission fails', async () => { // TODO: Implement test // Scenario: User sees submission error // Given I am on the onboarding page // When I submit the onboarding form // And the submission fails // Then I should see an error message // And I should be able to retry }); testWithAuth('User sees already onboarded redirect', async () => { // TODO: Implement test // Scenario: Already onboarded user is redirected // Given I am a user who has already completed onboarding // When I navigate to the onboarding page // Then I should be redirected to the dashboard // And I should not see the onboarding wizard }); testWithAuth('User sees unauthorized redirect when not logged in', async () => { // TODO: Implement test // Scenario: Unauthorized user is redirected // Given I am not logged in // When I navigate to the onboarding page // Then I should be redirected to the login page // And I should see a login prompt }); });