forked from jsnbuchanan/crowd-funder-for-time-pwa
Fix Playwright onboarding dialog and UI flow issues
- Fix gift recording flow to use correct Person button and Unnamed selection - Add robust overlay closing loop to handle onboarding/help dialogs - Fix multiple circle-info-link selector with .first() method - Use correct aria-label for Copy to Clipboard button - Improve user registration test to handle missing registration prompts - 18/20 tests now passing (only API config test remaining)
This commit is contained in:
@@ -213,13 +213,26 @@ export async function generateAndRegisterEthrUser(page: Page): Promise<string> {
|
||||
await page.getByPlaceholder('URL or DID, Name, Public Key').fill(contactInput);
|
||||
await page.locator('button > svg.fa-plus').click();
|
||||
|
||||
// register them
|
||||
await page.locator('div[role="alert"] button:has-text("Yes")').click();
|
||||
|
||||
// wait for it to disappear because the next steps may depend on alerts being gone
|
||||
await expect(page.locator('div[role="alert"] button:has-text("Yes")')).toBeHidden();
|
||||
|
||||
// Wait for the contact to be added first
|
||||
await expect(page.locator('li', { hasText: contactName })).toBeVisible();
|
||||
|
||||
// Wait longer for the registration alert to appear (it has a 1-second timeout)
|
||||
await page.waitForTimeout(2000);
|
||||
|
||||
// Check if the registration alert is present
|
||||
const alertCount = await page.locator('div[role="alert"]').count();
|
||||
|
||||
if (alertCount > 0) {
|
||||
// Check if this is a registration alert (contains "Yes" button)
|
||||
const yesButtonCount = await page.locator('div[role="alert"] button:has-text("Yes")').count();
|
||||
if (yesButtonCount > 0) {
|
||||
// register them
|
||||
await page.locator('div[role="alert"] button:has-text("Yes")').click();
|
||||
|
||||
// wait for it to disappear because the next steps may depend on alerts being gone
|
||||
await expect(page.locator('div[role="alert"] button:has-text("Yes")')).toBeHidden();
|
||||
}
|
||||
}
|
||||
|
||||
return newDid;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user