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.
This commit is contained in:
Matthew Raymer
2025-07-27 02:10:42 +00:00
parent e04c9f3626
commit 820fb29021
2 changed files with 15 additions and 2 deletions

View File

@@ -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.

View File

@@ -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();
} }