Browse Source

docs: enhance TESTING.md troubleshooting section with detailed Playwright command explanation

Add comprehensive breakdown of the --headed test debugging command, explaining each parameter and its purpose for visual test debugging. Resolves "New offers for another user" test debugging workflow.
pull/142/head
Matthew Raymer 17 hours ago
parent
commit
820fb29021
  1. 15
      test-playwright/TESTING.md
  2. 2
      test-playwright/testUtils.ts

15
test-playwright/TESTING.md

@ -88,3 +88,18 @@ firefox --no-remote --profile $(realpath profiles/dev2) --devtools --new-window
1. Identity Errors: 1. Identity Errors:
- "No keys for ID" errors may occur when current account was erased - "No keys for ID" errors may occur when current account was erased
- Account switching can cause issues with erased accounts - Account switching can cause issues with erased accounts
2. If you find yourself wanting to see the testing process try something like this:
```
npx playwright test -c playwright.config-local.ts test-playwright/60-new-activity.spec.ts --grep "New offers for another user" --headed
```
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.

2
test-playwright/testUtils.ts

@ -99,11 +99,9 @@ export async function switchToUser(page: Page, did: string): Promise<void> {
const switchIdentityLink = page.locator("#switch-identity-link"); const switchIdentityLink = page.locator("#switch-identity-link");
if (await switchIdentityLink.isHidden()) { if (await switchIdentityLink.isHidden()) {
console.log("Switch identity link is hidden, clicking advanced settings");
await page.getByTestId("advancedSettings").click(); await page.getByTestId("advancedSettings").click();
await switchIdentityLink.click(); await switchIdentityLink.click();
} else { } else {
console.log("Switch identity link is visible, clicking it");
await switchIdentityLink.click(); await switchIdentityLink.click();
} }

Loading…
Cancel
Save