forked from trent_larson/crowd-funder-for-time-pwa
Merge branch 'master' into contact-gifting-current-user
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:
|
||||
@@ -100,7 +100,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 }) => {
|
||||
|
||||
@@ -23,7 +23,7 @@ test('Record an offer', async ({ page }) => {
|
||||
await page.locator('button', { hasText: 'Edit' }).isVisible(); // since the 'edit' takes longer to show, wait for that (lest the click miss)
|
||||
await page.getByTestId('offerButton').click();
|
||||
await page.getByTestId('inputDescription').fill(description);
|
||||
await page.getByTestId('inputOfferAmount').fill(randomNonZeroNumber.toString());
|
||||
await page.getByTestId('inputOfferAmount').locator('input').fill(randomNonZeroNumber.toString());
|
||||
expect(page.getByRole('button', { name: 'Sign & Send' }));
|
||||
await page.getByRole('button', { name: 'Sign & Send' }).click();
|
||||
await expect(page.getByText('That offer was recorded.')).toBeVisible();
|
||||
|
||||
@@ -24,7 +24,7 @@ test('New offers for another user', async ({ page }) => {
|
||||
await expect(page.locator('button > svg.fa-plus')).toBeVisible();
|
||||
await page.locator('button > svg.fa-plus').click();
|
||||
await page.locator('div[role="alert"] button:has-text("No")').click(); // don't register
|
||||
await expect(page.locator('div[role="alert"] span:has-text("Success")')).toBeVisible();
|
||||
await expect(page.locator('div[role="alert"] h4:has-text("Success")')).toBeVisible();
|
||||
await page.locator('div[role="alert"] button > svg.fa-xmark').click(); // dismiss info alert
|
||||
await expect(page.locator('div[role="alert"] button > svg.fa-xmark')).toBeHidden(); // ensure alert is gone
|
||||
|
||||
@@ -36,7 +36,7 @@ test('New offers for another user', async ({ page }) => {
|
||||
const randomString1 = Math.random().toString(36).substring(2, 5);
|
||||
await page.getByTestId('offerButton').click();
|
||||
await page.getByTestId('inputDescription').fill(`help of ${randomString1} from #000`);
|
||||
await page.getByTestId('inputOfferAmount').fill('1');
|
||||
await page.getByTestId('inputOfferAmount').locator('input').fill('1');
|
||||
await page.getByRole('button', { name: 'Sign & Send' }).click();
|
||||
await expect(page.getByText('That offer was recorded.')).toBeVisible();
|
||||
await page.locator('div[role="alert"] button > svg.fa-xmark').click(); // dismiss info alert
|
||||
@@ -46,7 +46,7 @@ test('New offers for another user', async ({ page }) => {
|
||||
const randomString2 = Math.random().toString(36).substring(2, 5);
|
||||
await page.getByTestId('offerButton').click();
|
||||
await page.getByTestId('inputDescription').fill(`help of ${randomString2} from #000`);
|
||||
await page.getByTestId('inputOfferAmount').fill('3');
|
||||
await page.getByTestId('inputOfferAmount').locator('input').fill('3');
|
||||
await page.getByRole('button', { name: 'Sign & Send' }).click();
|
||||
await expect(page.getByText('That offer was recorded.')).toBeVisible();
|
||||
await page.locator('div[role="alert"] button > svg.fa-xmark').click(); // dismiss info alert
|
||||
|
||||
@@ -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