From 820fb290215a6ea0bbfdd279433946750c44f332 Mon Sep 17 00:00:00 2001 From: Matthew Raymer Date: Sun, 27 Jul 2025 02:10:42 +0000 Subject: [PATCH] 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. --- test-playwright/TESTING.md | 15 +++++++++++++++ test-playwright/testUtils.ts | 2 -- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/test-playwright/TESTING.md b/test-playwright/TESTING.md index e51d873e..7a173c65 100644 --- a/test-playwright/TESTING.md +++ b/test-playwright/TESTING.md @@ -88,3 +88,18 @@ firefox --no-remote --profile $(realpath profiles/dev2) --devtools --new-window 1. Identity Errors: - "No keys for ID" errors may occur when current account was erased - 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. + diff --git a/test-playwright/testUtils.ts b/test-playwright/testUtils.ts index fc2522fc..7ffee877 100644 --- a/test-playwright/testUtils.ts +++ b/test-playwright/testUtils.ts @@ -99,11 +99,9 @@ export async function switchToUser(page: Page, did: string): Promise { const switchIdentityLink = page.locator("#switch-identity-link"); if (await switchIdentityLink.isHidden()) { - console.log("Switch identity link is hidden, clicking advanced settings"); await page.getByTestId("advancedSettings").click(); await switchIdentityLink.click(); } else { - console.log("Switch identity link is visible, clicking it"); await switchIdentityLink.click(); }