/** * BDD E2E Test: Profile Liveries Page * * Tests the profile liveries page that displays: * - List of uploaded liveries * - Livery details (car name, validation status, upload date) * - Livery preview and metadata * - Navigation to livery upload page * * Focus: Final user outcomes - what the driver sees and can verify */ import { test, expect } from '@playwright/test'; test.describe('Profile Liveries Page', () => { test.beforeEach(async ({ page }) => { // TODO: Implement authentication setup for a registered driver // - Navigate to login page // - Enter credentials for "John Doe" or similar test driver // - Verify successful login // - Navigate to /profile/liveries page }); test('Driver sees list of uploaded liveries', async ({ page }) => { // TODO: Implement test // Scenario: Driver views their liveries // Given I am a registered driver "John Doe" // And I am on the "Profile Liveries" page // Then I should see a list of my uploaded liveries // And each livery should display the car name // And each livery should display the livery thumbnail }); test('Driver can view livery details', async ({ page }) => { // TODO: Implement test // Scenario: Driver views livery details // Given I am a registered driver "John Doe" // And I am on the "Profile Liveries" page // And I have uploaded a livery // When I click on a livery entry // Then I should see detailed information about the livery // And I should see the car name, car ID, and upload date }); test('Driver sees livery validation status', async ({ page }) => { // TODO: Implement test // Scenario: Driver sees livery validation status // Given I am a registered driver "John Doe" // And I am on the "Profile Liveries" page // Then I should see the validation status for each livery // And the status should indicate if the livery is validated or pending // And the status should be clearly indicated with visual cues }); test('Driver sees livery upload date', async ({ page }) => { // TODO: Implement test // Scenario: Driver sees livery upload date // Given I am a registered driver "John Doe" // And I am on the "Profile Liveries" page // Then I should see the upload date for each livery // And the date should be formatted correctly }); test('Driver can navigate to livery upload page', async ({ page }) => { // TODO: Implement test // Scenario: Driver navigates to livery upload page // Given I am a registered driver "John Doe" // And I am on the "Profile Liveries" page // When I click "Upload New Livery" or similar button // Then I should be navigated to the livery upload page // And the URL should be /profile/liveries/upload }); test('Driver sees livery preview', async ({ page }) => { // TODO: Implement test // Scenario: Driver sees livery preview // Given I am a registered driver "John Doe" // And I am on the "Profile Liveries" page // And I have uploaded a livery // Then I should see a preview image of the livery // And the preview should be clearly visible }); test('Driver sees livery car name', async ({ page }) => { // TODO: Implement test // Scenario: Driver sees livery car name // Given I am a registered driver "John Doe" // And I am on the "Profile Liveries" page // Then I should see the car name for each livery // And the car name should be accurate }); test('Driver sees livery car ID', async ({ page }) => { // TODO: Implement test // Scenario: Driver sees livery car ID // Given I am a registered driver "John Doe" // And I am on the "Profile Liveries" page // Then I should see the car ID for each livery // And the car ID should be accurate }); test('Driver sees empty state when no liveries uploaded', async ({ page }) => { // TODO: Implement test // Scenario: Driver with no liveries // Given I am a registered driver "John Doe" // And I am on the "Profile Liveries" page // And I have not uploaded any liveries // Then I should see a message indicating no liveries // And I should see a call-to-action to upload a livery // And I should see a link to the livery upload page }); test('Driver can filter liveries by validation status', async ({ page }) => { // TODO: Implement test // Scenario: Driver filters liveries by validation status // Given I am a registered driver "John Doe" // And I am on the "Profile Liveries" page // And I have both validated and pending liveries // When I filter by "Validated" status // Then I should only see validated liveries // And pending liveries should be hidden }); test('Driver can search liveries by car name', async ({ page }) => { // TODO: Implement test // Scenario: Driver searches for a specific livery // Given I am a registered driver "John Doe" // And I am on the "Profile Liveries" page // When I search for "Porsche" // Then I should see liveries matching the search term // And non-matching liveries should be hidden }); test('Driver sees livery metadata', async ({ page }) => { // TODO: Implement test // Scenario: Driver sees livery metadata // Given I am a registered driver "John Doe" // And I am on the "Profile Liveries" page // And I have uploaded a livery // Then I should see metadata for the livery // And metadata should include file size, format, and upload date }); test('Driver sees livery file size', async ({ page }) => { // TODO: Implement test // Scenario: Driver sees livery file size // Given I am a registered driver "John Doe" // And I am on the "Profile Liveries" page // Then I should see the file size for each livery // And the file size should be formatted correctly (e.g., MB, KB) }); test('Driver sees livery file format', async ({ page }) => { // TODO: Implement test // Scenario: Driver sees livery file format // Given I am a registered driver "John Doe" // And I am on the "Profile Liveries" page // Then I should see the file format for each livery // And the format should be clearly indicated (e.g., PNG, DDS) }); test('Driver can delete a livery', async ({ page }) => { // TODO: Implement test // Scenario: Driver deletes a livery // Given I am a registered driver "John Doe" // And I am on the "Profile Liveries" page // And I have uploaded a livery // When I click "Delete" for a livery // Then the livery should be removed from my list // And I should see a confirmation message }); test('Driver sees livery with error state', async ({ page }) => { // TODO: Implement test // Scenario: Driver sees livery error state // Given I am a registered driver "John Doe" // And I am on the "Profile Liveries" page // And a livery failed to load // Then I should see an error placeholder // And I should see an option to retry }); test('Driver can retry failed livery load', async ({ page }) => { // TODO: Implement test // Scenario: Driver retries failed livery load // Given I am a registered driver "John Doe" // And I am on the "Profile Liveries" page // And a livery failed to load // When I click "Retry" for the livery // Then the livery should be loaded again // And I should see the result }); test('Driver sees livery upload progress', async ({ page }) => { // TODO: Implement test // Scenario: Driver sees livery upload progress // Given I am a registered driver "John Doe" // And I am on the "Profile Liveries" page // When I upload a new livery // Then I should see a progress indicator // And I should see the upload status }); test('Driver sees livery validation requirements', async ({ page }) => { // TODO: Implement test // Scenario: Driver sees livery validation requirements // Given I am a registered driver "John Doe" // And I am on the "Profile Liveries" page // When I click "Upload New Livery" // Then I should see validation requirements // And I should see supported file formats // And I should see maximum file size }); test('Driver sees livery preview before upload', async ({ page }) => { // TODO: Implement test // Scenario: Driver sees livery preview before upload // Given I am a registered driver "John Doe" // And I am on the "Profile Liveries" page // When I select a livery file to upload // Then I should see a preview of the livery // And I should be able to confirm the upload }); test('Driver can cancel livery upload', async ({ page }) => { // TODO: Implement test // Scenario: Driver cancels livery upload // Given I am a registered driver "John Doe" // And I am on the "Profile Liveries" page // When I select a livery file to upload // And I click "Cancel" // Then the upload should be cancelled // And the livery should not be added to my list }); });