forked from trent_larson/crowd-funder-for-time-pwa
Merge branch 'master' into didview-invalid-did-handling
This commit is contained in:
@@ -37,7 +37,7 @@
|
||||
* Key Selectors:
|
||||
* - Activity list: 'ul#listLatestActivity li'
|
||||
* - Discover list: 'ul#listDiscoverResults li'
|
||||
* - Account notices: '#noticeBeforeShare', '#noticeBeforeAnnounce'
|
||||
* - Account notices: '#noticeBeforeShare', '#noticeSomeoneMustRegisterYou'
|
||||
* - Identity details: '#sectionIdentityDetails code.truncate'
|
||||
*
|
||||
* State Verification:
|
||||
@@ -69,6 +69,7 @@
|
||||
*/
|
||||
|
||||
import { test, expect } from '@playwright/test';
|
||||
import { UNNAMED_ENTITY_NAME } from '../src/constants/entities';
|
||||
import { deleteContact, generateAndRegisterEthrUser, importUser } from './testUtils';
|
||||
import { NOTIFY_CONTACT_INVALID_DID } from '../src/constants/notifications';
|
||||
|
||||
@@ -100,7 +101,7 @@ test('Check no-ID messaging in account', async ({ page }) => {
|
||||
await page.goto('./account');
|
||||
|
||||
// Check 'a friend needs to register you' notice
|
||||
await expect(page.locator('#noticeBeforeAnnounce')).toBeVisible();
|
||||
await expect(page.locator('#noticeSomeoneMustRegisterYou')).toBeVisible();
|
||||
});
|
||||
|
||||
test('Check ability to share contact', async ({ page }) => {
|
||||
@@ -191,7 +192,7 @@ test('Check User 0 can register a random person', async ({ page }) => {
|
||||
await page.goto('./');
|
||||
await page.getByTestId('closeOnboardingAndFinish').click();
|
||||
await page.getByRole('button', { name: 'Person' }).click();
|
||||
await page.getByRole('listitem').filter({ hasText: 'Unnamed' }).locator('svg').click();
|
||||
await page.getByRole('listitem').filter({ hasText: UNNAMED_ENTITY_NAME }).locator('svg').click();
|
||||
await page.getByPlaceholder('What was given').fill('Gave me access!');
|
||||
await page.getByRole('button', { name: 'Sign & Send' }).click();
|
||||
await expect(page.getByText('That gift was recorded.')).toBeVisible();
|
||||
|
||||
@@ -79,6 +79,7 @@
|
||||
* ```
|
||||
*/
|
||||
import { test, expect } from '@playwright/test';
|
||||
import { UNNAMED_ENTITY_NAME } from '../src/constants/entities';
|
||||
import { importUser } from './testUtils';
|
||||
|
||||
test('Record something given', async ({ page }) => {
|
||||
@@ -101,7 +102,7 @@ test('Record something given', async ({ page }) => {
|
||||
await page.goto('./');
|
||||
await page.getByTestId('closeOnboardingAndFinish').click();
|
||||
await page.getByRole('button', { name: 'Person' }).click();
|
||||
await page.getByRole('listitem').filter({ hasText: 'Unnamed' }).locator('svg').click();
|
||||
await page.getByRole('listitem').filter({ hasText: UNNAMED_ENTITY_NAME }).locator('svg').click();
|
||||
await page.getByPlaceholder('What was given').fill(finalTitle);
|
||||
await page.getByRole('spinbutton').fill(randomNonZeroNumber.toString());
|
||||
await page.getByRole('button', { name: 'Sign & Send' }).click();
|
||||
|
||||
@@ -85,6 +85,7 @@
|
||||
*/
|
||||
|
||||
import { test, expect } from '@playwright/test';
|
||||
import { UNNAMED_ENTITY_NAME } from '../src/constants/entities';
|
||||
import { importUser, createUniqueStringsArray, createRandomNumbersArray } from './testUtils';
|
||||
|
||||
test('Record 9 new gifts', async ({ page }) => {
|
||||
@@ -116,7 +117,7 @@ test('Record 9 new gifts', async ({ page }) => {
|
||||
await page.getByTestId('closeOnboardingAndFinish').click();
|
||||
}
|
||||
await page.getByRole('button', { name: 'Person' }).click();
|
||||
await page.getByRole('listitem').filter({ hasText: 'Unnamed' }).locator('svg').click();
|
||||
await page.getByRole('listitem').filter({ hasText: UNNAMED_ENTITY_NAME }).locator('svg').click();
|
||||
await page.getByPlaceholder('What was given').fill(finalTitles[i]);
|
||||
await page.getByRole('spinbutton').fill(finalNumbers[i].toString());
|
||||
await page.getByRole('button', { name: 'Sign & Send' }).click();
|
||||
|
||||
@@ -29,6 +29,7 @@ Tests are organized by feature area and numbered for execution order:
|
||||
## Prerequisites
|
||||
|
||||
1. Endorser server running locally (see TESTING.md for setup)
|
||||
|
||||
```bash
|
||||
git clone https://github.com/time-endorser/endorser-ch.git
|
||||
cd endorser-ch
|
||||
@@ -37,10 +38,13 @@ Tests are organized by feature area and numbered for execution order:
|
||||
cp .env.local .env
|
||||
NODE_ENV=test-local npm run dev
|
||||
```
|
||||
|
||||
2. Playwright browsers installed:
|
||||
|
||||
```bash
|
||||
npx playwright install
|
||||
```
|
||||
|
||||
3. For mobile testing:
|
||||
- XCode (for iOS)
|
||||
- Android Studio or connected Android device
|
||||
@@ -67,16 +71,19 @@ npx playwright test -c playwright.config-local.ts --trace on test-playwright/40-
|
||||
### 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
|
||||
@@ -114,6 +121,7 @@ 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
|
||||
@@ -124,4 +132,4 @@ When adding new tests:
|
||||
|
||||
- [TESTING.md](./TESTING.md) - Detailed testing guide
|
||||
- [Playwright Documentation](https://playwright.dev/docs/intro)
|
||||
- Endorser server documentation for test setup
|
||||
- Endorser server documentation for test setup
|
||||
|
||||
@@ -5,6 +5,7 @@ Start with [README.md](./README.md). This file has more details.
|
||||
## Test User Setup
|
||||
|
||||
### Register New User on Test Server
|
||||
|
||||
On the test server, User #0 has rights to register others. Import User #0 with this seed phrase:
|
||||
|
||||
```bash
|
||||
@@ -18,6 +19,7 @@ This corresponds to: `did:ethr:0x0000694B58C2cC69658993A90D3840C560f2F51F`
|
||||
## Manual Testing Steps
|
||||
|
||||
### Identity Management
|
||||
|
||||
1. Create multiple identifiers:
|
||||
- Go to "Your Identity" screen
|
||||
- Click "Advanced"
|
||||
@@ -96,10 +98,10 @@ npx playwright test -c playwright.config-local.ts test-playwright/60-new-activit
|
||||
```
|
||||
|
||||
This command allows you to:
|
||||
|
||||
- **Run a specific test file**: `test-playwright/60-new-activity.spec.ts`
|
||||
- **Filter to a specific test**: `--grep "New offers for another user"` runs only tests with that name
|
||||
- **See the browser**: `--headed` opens the browser window so you can watch the test execute
|
||||
- **Use local config**: `-c playwright.config-local.ts` uses the local configuration file
|
||||
|
||||
This is useful when you want to observe the testing process visually rather than running tests in headless mode. It's particularly helpful for debugging test failures or understanding how the application behaves during automated testing.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user