Files
gridpilot.gg/tests/e2e/profile/profile-main.spec.ts
Marc Mintel 9894c4a841
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
code quality
2026-01-27 16:30:03 +01:00

193 lines
7.7 KiB
TypeScript

/**
* BDD E2E Test: Profile Main Page
*
* Tests the main profile page that displays:
* - Driver's personal information (name, avatar, bio)
* - Driver's profile statistics and achievements
* - Navigation to profile sub-pages (leagues, liveries, settings, sponsorship requests)
* - Profile management options
*
* Focus: Final user outcomes - what the driver sees and can verify
*/
import { expect, testWithAuth } from '../../shared/auth-fixture';
testWithAuth.describe('Profile Main Page', () => {
testWithAuth.beforeEach(async ({ authenticatedDriver }) => {
await authenticatedDriver.goto('/profile');
await authenticatedDriver.waitForLoadState('networkidle');
});
testWithAuth('Driver sees their profile information on main page', async ({ authenticatedDriver }) => {
await expect(authenticatedDriver.getByTestId('profile-name')).toBeVisible();
await expect(authenticatedDriver.getByTestId('profile-avatar')).toBeVisible();
await expect(authenticatedDriver.getByTestId('profile-bio')).toBeVisible();
});
test('Driver sees profile statistics on main page', async () => {
// TODO: Implement test
// Scenario: Driver views their profile statistics
// Given I am a registered driver "John Doe"
// And I am on the "Profile" page
// Then I should see my current rating
// And I should see my current rank
// And I should see my total race starts
// And I should see my total wins
// And I should see my total podiums
// And I should see my win percentage
});
test('Driver can navigate to leagues page from profile', async () => {
// TODO: Implement test
// Scenario: Driver navigates to leagues page
// Given I am a registered driver "John Doe"
// And I am on the "Profile" page
// When I click on the "Leagues" section or link
// Then I should be navigated to the profile leagues page
// And the URL should be /profile/leagues
});
test('Driver can navigate to liveries page from profile', async () => {
// TODO: Implement test
// Scenario: Driver navigates to liveries page
// Given I am a registered driver "John Doe"
// And I am on the "Profile" page
// When I click on the "Liveries" section or link
// Then I should be navigated to the profile liveries page
// And the URL should be /profile/liveries
});
test('Driver can navigate to settings page from profile', async () => {
// TODO: Implement test
// Scenario: Driver navigates to settings page
// Given I am a registered driver "John Doe"
// And I am on the "Profile" page
// When I click on the "Settings" section or link
// Then I should be navigated to the profile settings page
// And the URL should be /profile/settings
});
test('Driver can navigate to sponsorship requests page from profile', async () => {
// TODO: Implement test
// Scenario: Driver navigates to sponsorship requests page
// Given I am a registered driver "John Doe"
// And I am on the "Profile" page
// When I click on the "Sponsorship Requests" section or link
// Then I should be navigated to the sponsorship requests page
// And the URL should be /profile/sponsorship-requests
});
test('Driver sees profile achievements section', async () => {
// TODO: Implement test
// Scenario: Driver views their achievements
// Given I am a registered driver "John Doe"
// And I am on the "Profile" page
// Then I should see an achievements section
// And I should see badges or trophies for completed achievements
// And I should see progress indicators for ongoing achievements
});
test('Driver sees recent activity on profile page', async () => {
// TODO: Implement test
// Scenario: Driver views recent activity
// Given I am a registered driver "John Doe"
// And I am on the "Profile" page
// Then I should see a recent activity feed
// And I should see recent races, league joins, or other actions
// And each activity should have a timestamp
});
test('Driver sees profile completion indicator', async () => {
// TODO: Implement test
// Scenario: Driver sees profile completion status
// Given I am a registered driver "John Doe"
// And I am on the "Profile" page
// Then I should see a profile completion percentage
// And I should see suggestions to complete my profile
// And I should see which sections are incomplete
});
test('Driver can edit profile from main page', async () => {
// TODO: Implement test
// Scenario: Driver edits profile from main page
// Given I am a registered driver "John Doe"
// And I am on the "Profile" page
// When I click "Edit Profile" or similar button
// Then I should be navigated to the settings page
// And I should be able to edit my profile information
});
test('Driver sees empty state when no leagues joined', async () => {
// TODO: Implement test
// Scenario: Driver with no league memberships
// Given I am a registered driver "John Doe"
// And I am on the "Profile" page
// And I have not joined any leagues
// Then I should see the leagues section
// And I should see a message indicating no leagues joined
// And I should see a call-to-action to discover leagues
});
test('Driver sees empty state when no liveries uploaded', async () => {
// TODO: Implement test
// Scenario: Driver with no liveries
// Given I am a registered driver "John Doe"
// And I am on the "Profile" page
// And I have not uploaded any liveries
// Then I should see the liveries section
// And I should see a message indicating no liveries
// And I should see a call-to-action to upload a livery
});
test('Driver sees empty state when no sponsorship requests', async () => {
// TODO: Implement test
// Scenario: Driver with no sponsorship requests
// Given I am a registered driver "John Doe"
// And I am on the "Profile" page
// And I have no sponsorship requests
// Then I should see the sponsorship requests section
// And I should see a message indicating no requests
// And I should see information about how to get sponsorships
});
test('Driver sees profile with SEO metadata', async () => {
// TODO: Implement test
// Scenario: Driver verifies SEO metadata
// Given I am a registered driver "John Doe"
// And I am on the "Profile" page
// Then the page title should contain my name
// And the page description should mention my profile
// And the page should have Open Graph tags for social sharing
});
test('Driver sees consistent profile layout', async () => {
// TODO: Implement test
// Scenario: Driver verifies profile layout consistency
// Given I am on the "Profile" page
// Then the layout should be consistent with other profile pages
// And the navigation should be accessible
// And the styling should match the design system
});
test('Driver sees profile with team affiliation', async () => {
// TODO: Implement test
// Scenario: Driver views their team affiliation
// Given I am a registered driver "John Doe"
// And I am on the "Profile" page
// And I am affiliated with a team
// Then I should see my team name
// And I should see my team logo (if available)
// And I should see my role in the team
});
test('Driver sees profile with social links', async () => {
// TODO: Implement test
// Scenario: Driver views their social links
// Given I am a registered driver "John Doe"
// And I am on the "Profile" page
// And I have social links configured
// Then I should see social media links (e.g., Discord, Twitter, iRacing)
// And each link should be clickable
// And each link should navigate to the correct external URL
});
});