docs(tests): Add comprehensive test suite documentation

- Add detailed header documentation to playwright tests
- Document test categories and flows
- Add key selector documentation
- Document state verification and alert handling
- Include code examples and usage patterns
- Add important checks and requirements

The documentation helps developers understand the foundational tests that verify
basic application functionality before running more complex test suites.
This commit is contained in:
Matthew Raymer
2025-02-16 03:29:22 +00:00
parent 499d35b22b
commit cc71d383e6
10 changed files with 683 additions and 516 deletions

View File

@@ -1,3 +1,73 @@
/**
* Initial State and Basic Functionality Tests
*
* Core test suite that validates fundamental application features and initial state handling.
* These tests run first to ensure basic functionality before more complex tests.
*
* Test Categories:
* 1. Activity Feed
* - Verifies server connectivity
* - Tests infinite scroll loading
* - Checks initial 10 activities load
* - Validates additional activity loading
*
* 2. Discovery Features
* - Tests project listing
* - Verifies infinite scroll
* - Checks project card rendering
*
* 3. Account State
* - Validates initial no-ID state
* - Tests ID generation flow
* - Verifies registration notices
* - Checks account detail display
*
* 4. Contact Sharing
* - Tests name setting functionality
* - Validates clipboard operations
* - Checks sharing UI elements
* - Verifies alert handling
*
* 5. User Registration
* - Tests User 0's ability to register others
* - Validates gift recording after registration
* - Checks contact deletion
* - Verifies deleted contact handling
*
* Key Selectors:
* - Activity list: 'ul#listLatestActivity li'
* - Discover list: 'ul#listDiscoverResults li'
* - Account notices: '#noticeBeforeShare', '#noticeBeforeAnnounce'
* - Identity details: '#sectionIdentityDetails code.truncate'
*
* State Verification:
* - Checks empty ID state
* - Verifies ID generation
* - Validates alert presence/dismissal
* - Confirms navigation state
*
* Alert Handling:
* - Closes onboarding dialogs
* - Verifies alert content
* - Checks alert dismissal
* - Validates alert transitions
*
* Important Checks:
* - Server connectivity
* - Data loading
* - UI state transitions
* - Error conditions
* - Clipboard operations
*
* @example Checking activity feed
* ```typescript
* await page.goto('./');
* await page.getByTestId('closeOnboardingAndFinish').click();
* await expect(page.locator('ul#listLatestActivity li:nth-child(10)'))
* .toBeVisible();
* ```
*/
import { test, expect } from '@playwright/test';
import { deleteContact, generateAndRegisterEthrUser, importUser } from './testUtils';