forked from trent_larson/crowd-funder-for-time-pwa
feat(accessibility): enhance AccountViewView and document test suite
- Add ARIA annotations and roles to AccountViewView for better screen reader support - Add role="tooltip" to API server description - Improve input control accessibility with proper ARIA attributes - Add descriptive labels and aria-labels for interactive elements - Create comprehensive README.md for Playwright test suite - Document test structure and organization - Add setup instructions and prerequisites - Include troubleshooting guide and contribution guidelines - Link to related documentation This change improves accessibility compliance and makes the test suite more maintainable for contributors.
This commit is contained in:
@@ -179,7 +179,7 @@ test('Confirm test API setting (may fail if you are running your own Time Safari
|
||||
const endorserTermInConfig = endorserTerm?.substring(ENDORSER_ENV_NAME.length + 1);
|
||||
|
||||
const endorserServer = endorserTermInConfig || 'https://test-api.endorser.ch';
|
||||
await expect(page.getByRole('textbox').nth(1)).toHaveValue(endorserServer);
|
||||
await expect(page.locator('#apiServerInput')).toHaveValue(endorserServer);
|
||||
});
|
||||
|
||||
test('Check User 0 can register a random person', async ({ page }) => {
|
||||
|
||||
119
test-playwright/README.md
Normal file
119
test-playwright/README.md
Normal file
@@ -0,0 +1,119 @@
|
||||
# Playwright Test Suite
|
||||
|
||||
This directory contains the automated end-to-end test suite for Time Safari using Playwright. The tests verify critical functionality across web and mobile platforms.
|
||||
|
||||
## Test Structure
|
||||
|
||||
Tests are organized by feature area and numbered for execution order:
|
||||
|
||||
- `00-noid-tests.spec.ts` - Tests for unregistered users
|
||||
- `05-invite.spec.ts` - Contact invitation functionality
|
||||
- `10-check-usage-limits.spec.ts` - Usage limit verification
|
||||
- `20-create-project.spec.ts` - Project creation
|
||||
- `25-create-project-x10.spec.ts` - Bulk project creation
|
||||
- `30-record-gift.spec.ts` - Gift recording
|
||||
- `33-record-gift-x10.spec.ts` - Bulk gift recording
|
||||
- `35-record-gift-from-image-share.spec.ts` - Gift recording from shared images
|
||||
- `37-record-gift-on-project.spec.ts` - Project-specific gift recording
|
||||
- `40-add-contact.spec.ts` - Contact management
|
||||
- `50-record-offer.spec.ts` - Offer recording
|
||||
- `60-new-activity.spec.ts` - Activity feed updates
|
||||
|
||||
## Key Files
|
||||
|
||||
- `testUtils.ts` - Shared test utilities and helper functions
|
||||
- `TESTING.md` - Detailed testing guide and manual test procedures
|
||||
- `playwright.config-local.ts` - Playwright configuration for local testing
|
||||
- `exported-data.json` - Test data for import/export testing
|
||||
|
||||
## Prerequisites
|
||||
|
||||
1. Endorser server running locally (see TESTING.md for setup)
|
||||
2. Playwright browsers installed:
|
||||
```bash
|
||||
npx playwright install
|
||||
```
|
||||
3. For mobile testing:
|
||||
- XCode (for iOS)
|
||||
- Android Studio or connected Android device
|
||||
|
||||
## Running Tests
|
||||
|
||||
### Full Test Suite
|
||||
|
||||
```bash
|
||||
# Run all tests (web + mobile)
|
||||
npm run test:all
|
||||
|
||||
# Run web-only tests
|
||||
npm run test:web
|
||||
```
|
||||
|
||||
### Individual Tests
|
||||
|
||||
```bash
|
||||
# Run a specific test with tracing
|
||||
npx playwright test -c playwright.config-local.ts --trace on test-playwright/40-add-contact.spec.ts
|
||||
```
|
||||
|
||||
### Test Environment Options
|
||||
|
||||
1. Local Endorser Server (default):
|
||||
```bash
|
||||
NODE_ENV=test-local npm run dev
|
||||
```
|
||||
|
||||
2. Global Test Server:
|
||||
```bash
|
||||
VITE_DEFAULT_ENDORSER_API_SERVER=https://test-ledger.time.com npm run dev
|
||||
```
|
||||
|
||||
3. Minimal Test Data:
|
||||
```bash
|
||||
rm ../endorser-ch-test-local.sqlite3
|
||||
NODE_ENV=test-local npm run flyway migrate
|
||||
NODE_ENV=test-local npm run test test/controller0
|
||||
NODE_ENV=test-local npm run dev
|
||||
```
|
||||
|
||||
## Test Data
|
||||
|
||||
The test suite uses predefined test users, with User #0 having registration privileges:
|
||||
- DID: `did:ethr:0x0000694B58C2cC69658993A90D3840C560f2F51F`
|
||||
- Seed phrase available in TESTING.md
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
Common issues and solutions:
|
||||
|
||||
1. **Test Failures**
|
||||
- Some tests may fail intermittently - try rerunning
|
||||
- Check Endorser server logs for backend issues
|
||||
- Verify test environment setup
|
||||
|
||||
2. **Mobile Testing**
|
||||
- Ensure XCode/Android Studio is running
|
||||
- Check device connectivity
|
||||
- Verify browser installation
|
||||
|
||||
3. **Data Issues**
|
||||
- Clear browser data if tests fail due to stale state
|
||||
- Reset IndexedDB if needed
|
||||
- Check service worker status
|
||||
|
||||
For more detailed troubleshooting, see TESTING.md.
|
||||
|
||||
## Contributing
|
||||
|
||||
When adding new tests:
|
||||
1. Follow the existing naming convention
|
||||
2. Use testUtils.ts for common operations
|
||||
3. Add appropriate comments and documentation
|
||||
4. Update this README if adding new test categories
|
||||
5. Consider both web and mobile platforms
|
||||
|
||||
## Related Documentation
|
||||
|
||||
- [TESTING.md](./TESTING.md) - Detailed testing guide
|
||||
- [Playwright Documentation](https://playwright.dev/docs/intro)
|
||||
- Endorser server documentation for test setup
|
||||
Reference in New Issue
Block a user