/** * 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 { test, expect } from '@playwright/test'; test.describe('Onboarding Wizard Flow', () => { test.beforeEach(async ({ page }) => { // TODO: Implement authentication setup // - Navigate to login page // - Enter credentials for a new user (not yet onboarded) // - Verify successful login // - Verify redirection to onboarding page }); test('New user is redirected to onboarding after login', async ({ page }) => { // TODO: Implement test // Scenario: New user is redirected to onboarding // Given I am a new registered user "John Doe" // And I have not completed onboarding // When I log in // Then I should be redirected to the onboarding page // And I should see the onboarding wizard }); test('User sees onboarding wizard with two steps', async ({ page }) => { // 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 }); test('User can navigate between onboarding steps', async ({ page }) => { // 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 }); test('User completes onboarding and is redirected to dashboard', async ({ page }) => { // 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 }); test('User sees onboarding help panel', async ({ page }) => { // 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 }); test('User sees avatar generation help on step 2', async ({ page }) => { // 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 }); test('User cannot skip required onboarding steps', async ({ page }) => { // 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 }); test('User sees processing state during submission', async ({ page }) => { // 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 }); test('User sees error state when submission fails', async ({ page }) => { // 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 }); test('User sees already onboarded redirect', async ({ page }) => { // 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 }); test('User sees unauthorized redirect when not logged in', async ({ page }) => { // 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 }); });