/** * BDD E2E Test: Onboarding Personal Information Step * * Tests the personal information collection step of the onboarding wizard: * - First name input * - Last name input * - Display name input * - Country selection * - Timezone selection * - Step validation and navigation * * Focus: Final user outcomes - what the driver sees and can verify */ import { test, expect } from '@playwright/test'; test.describe('Onboarding - Personal Information Step', () => { test.beforeEach(async ({ page }) => { // TODO: Implement authentication setup // - Navigate to login page // - Enter credentials for a new user // - Verify redirection to onboarding page // - Verify step 1 is active }); test('User sees personal information form fields', async ({ page }) => { // TODO: Implement test // Scenario: User sees form fields // Given I am on step 1 of onboarding // Then I should see a "First Name" input field // And I should see a "Last Name" input field // And I should see a "Display Name" input field // And I should see a "Country" dropdown // And I should see a "Timezone" dropdown }); test('User can enter first name', async ({ page }) => { // TODO: Implement test // Scenario: User enters first name // Given I am on step 1 of onboarding // When I enter "John" in the first name field // Then the first name field should contain "John" }); test('User can enter last name', async ({ page }) => { // TODO: Implement test // Scenario: User enters last name // Given I am on step 1 of onboarding // When I enter "Doe" in the last name field // Then the last name field should contain "Doe" }); test('User can enter display name', async ({ page }) => { // TODO: Implement test // Scenario: User enters display name // Given I am on step 1 of onboarding // When I enter "RacerJohn" in the display name field // Then the display name field should contain "RacerJohn" }); test('User can select country from dropdown', async ({ page }) => { // TODO: Implement test // Scenario: User selects country // Given I am on step 1 of onboarding // When I click the country dropdown // And I select "United States" // Then the country dropdown should show "United States" }); test('User can select timezone from dropdown', async ({ page }) => { // TODO: Implement test // Scenario: User selects timezone // Given I am on step 1 of onboarding // When I click the timezone dropdown // And I select "UTC-05:00" // Then the timezone dropdown should show "UTC-05:00" }); test('User sees validation error for empty first name', async ({ page }) => { // TODO: Implement test // Scenario: First name validation // Given I am on step 1 of onboarding // When I leave the first name field empty // And I try to proceed to step 2 // Then I should see "First name is required" }); test('User sees validation error for empty last name', async ({ page }) => { // TODO: Implement test // Scenario: Last name validation // Given I am on step 1 of onboarding // When I leave the last name field empty // And I try to proceed to step 2 // Then I should see "Last name is required" }); test('User sees validation error for empty display name', async ({ page }) => { // TODO: Implement test // Scenario: Display name validation // Given I am on step 1 of onboarding // When I leave the display name field empty // And I try to proceed to step 2 // Then I should see "Display name is required" }); test('User sees validation error for short display name', async ({ page }) => { // TODO: Implement test // Scenario: Display name length validation // Given I am on step 1 of onboarding // When I enter "AB" in the display name field // And I try to proceed to step 2 // Then I should see "Display name must be at least 3 characters" }); test('User sees validation error for empty country', async ({ page }) => { // TODO: Implement test // Scenario: Country validation // Given I am on step 1 of onboarding // When I leave the country field empty // And I try to proceed to step 2 // Then I should see "Please select your country" }); test('User can proceed to step 2 with valid data', async ({ page }) => { // TODO: Implement test // Scenario: Valid data allows progression // Given I am on step 1 of onboarding // When I enter "John" in first name // And I enter "Doe" in last name // And I enter "RacerJohn" in display name // And I select "United States" in country // And I click "Next" // Then I should see step 2 of onboarding }); test('User can go back from step 1', async ({ page }) => { // TODO: Implement test // Scenario: Back button on step 1 // Given I am on step 1 of onboarding // When I click "Back" // Then I should see the onboarding welcome screen // Or the back button should be disabled }); test('User sees entered data preserved when going back and forth', async ({ page }) => { // TODO: Implement test // Scenario: Data persistence // Given I am on step 1 of onboarding // When I enter "John" in first name // And I enter "Doe" in last name // And I enter "RacerJohn" in display name // And I select "United States" in country // And I click "Next" // And I click "Back" // Then the first name field should still contain "John" // And the last name field should still contain "Doe" // And the display name field should still contain "RacerJohn" // And the country field should still show "United States" }); test('User sees help text for personal information', async ({ page }) => { // TODO: Implement test // Scenario: Help text visibility // Given I am on step 1 of onboarding // Then I should see help text explaining what information is needed // And I should see any requirements or hints }); test('User cannot proceed with invalid display name characters', async ({ page }) => { // TODO: Implement test // Scenario: Display name character validation // Given I am on step 1 of onboarding // When I enter special characters in display name // And I try to proceed to step 2 // Then I should see validation errors }); test('User sees real-time validation feedback', async ({ page }) => { // TODO: Implement test // Scenario: Real-time validation // Given I am on step 1 of onboarding // When I type in the display name field // Then I should see validation feedback as I type // And I should see if the name meets requirements }); });