code quality
Some checks failed
CI / lint-typecheck (pull_request) Failing after 13s
CI / tests (pull_request) Has been skipped
CI / contract-tests (pull_request) Has been skipped
CI / e2e-tests (pull_request) Has been skipped
CI / comment-pr (pull_request) Has been skipped
CI / commit-types (pull_request) Has been skipped
Some checks failed
CI / lint-typecheck (pull_request) Failing after 13s
CI / tests (pull_request) Has been skipped
CI / contract-tests (pull_request) Has been skipped
CI / e2e-tests (pull_request) Has been skipped
CI / comment-pr (pull_request) Has been skipped
CI / commit-types (pull_request) Has been skipped
This commit is contained in:
@@ -12,58 +12,55 @@
|
||||
* Focus: Final user outcomes - what the driver sees and can verify
|
||||
*/
|
||||
|
||||
import { test, expect } from '@playwright/test';
|
||||
import { expect } from '@playwright/test';
|
||||
import { testWithAuth } from '../../shared/auth-fixture';
|
||||
import * as path from 'path';
|
||||
|
||||
test.describe('Onboarding - Avatar Step', () => {
|
||||
test.beforeEach(async ({ page }) => {
|
||||
// TODO: Implement authentication setup
|
||||
// - Navigate to login page
|
||||
// - Enter credentials for a new user
|
||||
// - Verify redirection to onboarding page
|
||||
// - Complete step 1 with valid data
|
||||
// - Verify step 2 is active
|
||||
testWithAuth.describe('Onboarding - Avatar Step', () => {
|
||||
testWithAuth('User sees avatar creation form', async ({ unonboardedDriver }) => {
|
||||
await unonboardedDriver.goto('/onboarding/avatar');
|
||||
await unonboardedDriver.waitForLoadState('networkidle');
|
||||
|
||||
await expect(unonboardedDriver.getByTestId('avatar-creation-form')).toBeVisible();
|
||||
await expect(unonboardedDriver.getByTestId('photo-upload-area')).toBeVisible();
|
||||
await expect(unonboardedDriver.getByTestId('suit-color-options')).toBeVisible();
|
||||
await expect(unonboardedDriver.getByTestId('generate-avatars-btn')).toBeVisible();
|
||||
});
|
||||
|
||||
test('User sees avatar creation form', async ({ page }) => {
|
||||
// TODO: Implement test
|
||||
// Scenario: User sees avatar form
|
||||
// Given I am on step 2 of onboarding
|
||||
// Then I should see a face photo upload area
|
||||
// And I should see suit color options
|
||||
// And I should see a "Generate Avatars" button
|
||||
testWithAuth('User can upload face photo', async ({ unonboardedDriver }) => {
|
||||
await unonboardedDriver.goto('/onboarding/avatar');
|
||||
const uploadInput = unonboardedDriver.getByTestId('photo-upload-input');
|
||||
const filePath = path.resolve(__dirname, '../../assets/test-photo.jpg');
|
||||
await uploadInput.setInputFiles(filePath);
|
||||
await expect(unonboardedDriver.getByTestId('photo-preview')).toBeVisible();
|
||||
});
|
||||
|
||||
test('User can upload face photo', async ({ page }) => {
|
||||
// TODO: Implement test
|
||||
// Scenario: User uploads face photo
|
||||
// Given I am on step 2 of onboarding
|
||||
// When I click the photo upload area
|
||||
// And I select a face photo file
|
||||
// Then the photo should be uploaded
|
||||
// And I should see a preview of the photo
|
||||
testWithAuth('User can select suit color', async ({ unonboardedDriver }) => {
|
||||
await unonboardedDriver.goto('/onboarding/avatar');
|
||||
await unonboardedDriver.getByTestId('suit-color-red').click();
|
||||
await expect(unonboardedDriver.getByTestId('suit-color-red')).toHaveAttribute('data-selected', 'true');
|
||||
});
|
||||
|
||||
test('User can select suit color', async ({ page }) => {
|
||||
// TODO: Implement test
|
||||
// Scenario: User selects suit color
|
||||
// Given I am on step 2 of onboarding
|
||||
// When I click the suit color options
|
||||
// And I select "Red"
|
||||
// Then the "Red" option should be selected
|
||||
testWithAuth('User can generate avatars after uploading photo', async ({ unonboardedDriver }) => {
|
||||
await unonboardedDriver.goto('/onboarding');
|
||||
await unonboardedDriver.getByTestId('first-name-input').fill('Demo');
|
||||
await unonboardedDriver.getByTestId('last-name-input').fill('Driver');
|
||||
await unonboardedDriver.getByTestId('display-name-input').fill('DemoDriver');
|
||||
await unonboardedDriver.getByTestId('country-select').selectOption('US');
|
||||
await unonboardedDriver.getByTestId('next-btn').click();
|
||||
|
||||
const uploadInput = unonboardedDriver.getByTestId('photo-upload-input');
|
||||
const filePath = path.resolve(__dirname, '../../assets/test-photo.jpg');
|
||||
await uploadInput.setInputFiles(filePath);
|
||||
|
||||
await unonboardedDriver.getByTestId('suit-color-red').click();
|
||||
await unonboardedDriver.getByTestId('generate-avatars-btn').click();
|
||||
|
||||
await expect(unonboardedDriver.getByTestId('generate-avatars-btn')).toBeDisabled();
|
||||
await expect(unonboardedDriver.locator('button:has(img[alt*="Avatar option"])').first()).toBeVisible({ timeout: 15000 });
|
||||
});
|
||||
|
||||
test('User can generate avatars after uploading photo', async ({ page }) => {
|
||||
// TODO: Implement test
|
||||
// Scenario: Avatar generation
|
||||
// Given I am on step 2 of onboarding
|
||||
// And I have uploaded a face photo
|
||||
// And I have selected a suit color
|
||||
// When I click "Generate Avatars"
|
||||
// Then I should see a loading indicator
|
||||
// And I should see generated avatar options
|
||||
});
|
||||
|
||||
test('User sees avatar generation progress', async ({ page }) => {
|
||||
testWithAuth('User sees avatar generation progress', async () => {
|
||||
// TODO: Implement test
|
||||
// Scenario: Avatar generation progress
|
||||
// Given I am on step 2 of onboarding
|
||||
@@ -72,7 +69,7 @@ test.describe('Onboarding - Avatar Step', () => {
|
||||
// And I should see "Generating..." text
|
||||
});
|
||||
|
||||
test('User can select from generated avatars', async ({ page }) => {
|
||||
testWithAuth('User can select from generated avatars', async () => {
|
||||
// TODO: Implement test
|
||||
// Scenario: Avatar selection
|
||||
// Given I am on step 2 of onboarding
|
||||
@@ -82,7 +79,7 @@ test.describe('Onboarding - Avatar Step', () => {
|
||||
// And I should see a selection indicator
|
||||
});
|
||||
|
||||
test('User sees validation error when no photo uploaded', async ({ page }) => {
|
||||
testWithAuth('User sees validation error when no photo uploaded', async () => {
|
||||
// TODO: Implement test
|
||||
// Scenario: Photo validation
|
||||
// Given I am on step 2 of onboarding
|
||||
@@ -90,7 +87,7 @@ test.describe('Onboarding - Avatar Step', () => {
|
||||
// Then I should see "Please upload a photo of your face"
|
||||
});
|
||||
|
||||
test('User sees validation error when no avatar selected', async ({ page }) => {
|
||||
testWithAuth('User sees validation error when no avatar selected', async () => {
|
||||
// TODO: Implement test
|
||||
// Scenario: Avatar selection validation
|
||||
// Given I am on step 2 of onboarding
|
||||
@@ -99,7 +96,7 @@ test.describe('Onboarding - Avatar Step', () => {
|
||||
// Then I should see "Please select one of the generated avatars"
|
||||
});
|
||||
|
||||
test('User can regenerate avatars with different suit color', async ({ page }) => {
|
||||
testWithAuth('User can regenerate avatars with different suit color', async () => {
|
||||
// TODO: Implement test
|
||||
// Scenario: Regenerate avatars
|
||||
// Given I am on step 2 of onboarding
|
||||
@@ -109,7 +106,7 @@ test.describe('Onboarding - Avatar Step', () => {
|
||||
// Then I should see new avatars with the new color
|
||||
});
|
||||
|
||||
test('User sees avatar preview before upload', async ({ page }) => {
|
||||
testWithAuth('User sees avatar preview before upload', async () => {
|
||||
// TODO: Implement test
|
||||
// Scenario: Photo preview
|
||||
// Given I am on step 2 of onboarding
|
||||
@@ -118,7 +115,7 @@ test.describe('Onboarding - Avatar Step', () => {
|
||||
// And I should see the file name
|
||||
});
|
||||
|
||||
test('User cannot upload invalid file format for photo', async ({ page }) => {
|
||||
testWithAuth('User cannot upload invalid file format for photo', async () => {
|
||||
// TODO: Implement test
|
||||
// Scenario: File format validation
|
||||
// Given I am on step 2 of onboarding
|
||||
@@ -127,7 +124,7 @@ test.describe('Onboarding - Avatar Step', () => {
|
||||
// And the upload should be rejected
|
||||
});
|
||||
|
||||
test('User cannot upload oversized photo file', async ({ page }) => {
|
||||
testWithAuth('User cannot upload oversized photo file', async () => {
|
||||
// TODO: Implement test
|
||||
// Scenario: File size validation
|
||||
// Given I am on step 2 of onboarding
|
||||
@@ -136,7 +133,7 @@ test.describe('Onboarding - Avatar Step', () => {
|
||||
// And the upload should be rejected
|
||||
});
|
||||
|
||||
test('User sees avatar generation error state', async ({ page }) => {
|
||||
testWithAuth('User sees avatar generation error state', async () => {
|
||||
// TODO: Implement test
|
||||
// Scenario: Avatar generation error
|
||||
// Given I am on step 2 of onboarding
|
||||
@@ -145,7 +142,7 @@ test.describe('Onboarding - Avatar Step', () => {
|
||||
// And I should see an option to retry
|
||||
});
|
||||
|
||||
test('User can retry failed avatar generation', async ({ page }) => {
|
||||
testWithAuth('User can retry failed avatar generation', async () => {
|
||||
// TODO: Implement test
|
||||
// Scenario: Retry avatar generation
|
||||
// Given I am on step 2 of onboarding
|
||||
@@ -154,7 +151,7 @@ test.describe('Onboarding - Avatar Step', () => {
|
||||
// Then the generation should be attempted again
|
||||
});
|
||||
|
||||
test('User can proceed to submit with valid avatar selection', async ({ page }) => {
|
||||
testWithAuth('User can proceed to submit with valid avatar selection', async () => {
|
||||
// TODO: Implement test
|
||||
// Scenario: Valid avatar submission
|
||||
// Given I am on step 2 of onboarding
|
||||
@@ -166,7 +163,7 @@ test.describe('Onboarding - Avatar Step', () => {
|
||||
// And I should be redirected to dashboard
|
||||
});
|
||||
|
||||
test('User sees help text for avatar generation', async ({ page }) => {
|
||||
testWithAuth('User sees help text for avatar generation', async () => {
|
||||
// TODO: Implement test
|
||||
// Scenario: Avatar help text
|
||||
// Given I am on step 2 of onboarding
|
||||
@@ -174,7 +171,7 @@ test.describe('Onboarding - Avatar Step', () => {
|
||||
// And I should see tips for taking a good photo
|
||||
});
|
||||
|
||||
test('User sees avatar generation requirements', async ({ page }) => {
|
||||
testWithAuth('User sees avatar generation requirements', async () => {
|
||||
// TODO: Implement test
|
||||
// Scenario: Avatar requirements
|
||||
// Given I am on step 2 of onboarding
|
||||
@@ -183,7 +180,7 @@ test.describe('Onboarding - Avatar Step', () => {
|
||||
// And I should see maximum file size
|
||||
});
|
||||
|
||||
test('User can cancel avatar generation', async ({ page }) => {
|
||||
testWithAuth('User can cancel avatar generation', async () => {
|
||||
// TODO: Implement test
|
||||
// Scenario: Cancel generation
|
||||
// Given I am on step 2 of onboarding
|
||||
@@ -192,7 +189,7 @@ test.describe('Onboarding - Avatar Step', () => {
|
||||
// Then I should be able to cancel the generation
|
||||
});
|
||||
|
||||
test('User sees avatar in different contexts after onboarding', async ({ page }) => {
|
||||
testWithAuth('User sees avatar in different contexts after onboarding', async () => {
|
||||
// TODO: Implement test
|
||||
// Scenario: Avatar visibility
|
||||
// Given I have completed onboarding
|
||||
|
||||
@@ -9,28 +9,22 @@
|
||||
* Focus: Final user outcomes - what the driver sees and can verify
|
||||
*/
|
||||
|
||||
import { test, expect } from '@playwright/test';
|
||||
import { expect } from '@playwright/test';
|
||||
import { testWithAuth } from '../../shared/auth-fixture';
|
||||
|
||||
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
|
||||
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');
|
||||
});
|
||||
|
||||
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
|
||||
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();
|
||||
});
|
||||
|
||||
test('User sees onboarding wizard with two steps', async ({ page }) => {
|
||||
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
|
||||
@@ -39,7 +33,7 @@ test.describe('Onboarding Wizard Flow', () => {
|
||||
// And I should see a progress indicator
|
||||
});
|
||||
|
||||
test('User can navigate between onboarding steps', async ({ page }) => {
|
||||
testWithAuth('User can navigate between onboarding steps', async () => {
|
||||
// TODO: Implement test
|
||||
// Scenario: User navigates between steps
|
||||
// Given I am on the onboarding page
|
||||
@@ -50,7 +44,7 @@ test.describe('Onboarding Wizard Flow', () => {
|
||||
// Then I should see step 1 again
|
||||
});
|
||||
|
||||
test('User completes onboarding and is redirected to dashboard', async ({ page }) => {
|
||||
testWithAuth('User completes onboarding and is redirected to dashboard', async () => {
|
||||
// TODO: Implement test
|
||||
// Scenario: User completes onboarding
|
||||
// Given I am on the onboarding page
|
||||
@@ -61,7 +55,7 @@ test.describe('Onboarding Wizard Flow', () => {
|
||||
// And I should see my profile information
|
||||
});
|
||||
|
||||
test('User sees onboarding help panel', async ({ page }) => {
|
||||
testWithAuth('User sees onboarding help panel', async () => {
|
||||
// TODO: Implement test
|
||||
// Scenario: User sees help information
|
||||
// Given I am on the onboarding page
|
||||
@@ -69,7 +63,7 @@ test.describe('Onboarding Wizard Flow', () => {
|
||||
// And I should see instructions for the current step
|
||||
});
|
||||
|
||||
test('User sees avatar generation help on step 2', async ({ page }) => {
|
||||
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
|
||||
@@ -77,7 +71,7 @@ test.describe('Onboarding Wizard Flow', () => {
|
||||
// And I should see tips for taking a good photo
|
||||
});
|
||||
|
||||
test('User cannot skip required onboarding steps', async ({ page }) => {
|
||||
testWithAuth('User cannot skip required onboarding steps', async () => {
|
||||
// TODO: Implement test
|
||||
// Scenario: User cannot skip steps
|
||||
// Given I am on the onboarding page
|
||||
@@ -86,7 +80,7 @@ test.describe('Onboarding Wizard Flow', () => {
|
||||
// And I should not be able to proceed
|
||||
});
|
||||
|
||||
test('User sees processing state during submission', async ({ page }) => {
|
||||
testWithAuth('User sees processing state during submission', async () => {
|
||||
// TODO: Implement test
|
||||
// Scenario: User sees processing indicator
|
||||
// Given I am on the onboarding page
|
||||
@@ -95,7 +89,7 @@ test.describe('Onboarding Wizard Flow', () => {
|
||||
// And I should not be able to submit again
|
||||
});
|
||||
|
||||
test('User sees error state when submission fails', async ({ page }) => {
|
||||
testWithAuth('User sees error state when submission fails', async () => {
|
||||
// TODO: Implement test
|
||||
// Scenario: User sees submission error
|
||||
// Given I am on the onboarding page
|
||||
@@ -105,7 +99,7 @@ test.describe('Onboarding Wizard Flow', () => {
|
||||
// And I should be able to retry
|
||||
});
|
||||
|
||||
test('User sees already onboarded redirect', async ({ page }) => {
|
||||
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
|
||||
@@ -114,7 +108,7 @@ test.describe('Onboarding Wizard Flow', () => {
|
||||
// And I should not see the onboarding wizard
|
||||
});
|
||||
|
||||
test('User sees unauthorized redirect when not logged in', async ({ page }) => {
|
||||
testWithAuth('User sees unauthorized redirect when not logged in', async () => {
|
||||
// TODO: Implement test
|
||||
// Scenario: Unauthorized user is redirected
|
||||
// Given I am not logged in
|
||||
|
||||
Reference in New Issue
Block a user