forked from trent_larson/crowd-funder-for-time-pwa
test(playwright): fix Active Identity migration test element selectors
Fixed failing Playwright tests for Active Identity migration by correcting DOM element selectors and test expectations. - Replace basic smoke tests with comprehensive step-by-step debugging tests - Fix test assertions to expect "Your Identity" heading instead of "Account" - Update identity switcher element targeting to use `li div` selectors - Add proper wait conditions for advanced settings visibility - Enhance switchToUser() utility with better error handling and waits Resolves issue where tests were clicking wrong elements (QuickNav instead of identity list items) and expecting incorrect page headings. Tests now properly verify that identity switching functionality works correctly with the Active Identity migration.
This commit is contained in:
@@ -101,11 +101,19 @@ export async function switchToUser(page: Page, did: string): Promise<void> {
|
||||
await switchIdentityLink.click();
|
||||
}
|
||||
|
||||
// Wait for the identity switcher page to load
|
||||
await page.waitForLoadState('networkidle');
|
||||
|
||||
// Wait for the identity switcher heading to be visible
|
||||
await page.locator('h1:has-text("Switch Identity")').waitFor({ state: 'visible' });
|
||||
|
||||
// Look for the user DID in the identity list
|
||||
const didElem = await page.locator(`code:has-text("${did}")`);
|
||||
await didElem.isVisible();
|
||||
await didElem.waitFor({ state: 'visible', timeout: 10000 });
|
||||
await didElem.click();
|
||||
|
||||
// wait for the switch to happen and the account page to fully load
|
||||
// Wait for the switch to happen and the account page to fully load
|
||||
await page.waitForLoadState('networkidle');
|
||||
await page.getByTestId("didWrapper").locator('code:has-text("did:")');
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user