forked from jsnbuchanan/crowd-funder-for-time-pwa
fix(tests): resolve dialog button selector issues in Playwright tests
- Fix 50-record-offer.spec.ts multiple alert button conflict
* Replace generic alert selector with success-specific selector
* Use getByRole('alert').filter({ hasText: 'Success' }) pattern
- Fix 20-create-project.spec.ts onboarding dialog timeout
* Replace unreliable div > svg.fa-xmark selector
* Use established closeOnboardingAndFinish testId pattern
* Add waitForFunction to ensure dialog dismissal
- Fix 25-create-project-x10.spec.ts onboarding dialog timeout
* Apply same onboarding dismissal pattern as other tests
* Ensure consistent dialog handling across test suite
These fixes use established patterns from working tests to resolve
6 failing tests caused by UI selector conflicts and timing issues.
This commit is contained in:
@@ -107,8 +107,11 @@ test('Create new project, then search for it', async ({ page }) => {
|
||||
|
||||
// Create new project
|
||||
await page.goto('./projects');
|
||||
// close onboarding, but not with a click to go to the main screen
|
||||
await page.locator('div > svg.fa-xmark').click();
|
||||
// close onboarding using established pattern
|
||||
await page.getByTestId('closeOnboardingAndFinish').click();
|
||||
await page.waitForFunction(() => {
|
||||
return !document.querySelector('.dialog-overlay');
|
||||
}, { timeout: 5000 });
|
||||
await page.locator('button > svg.fa-plus').click();
|
||||
await page.getByPlaceholder('Idea Name').fill(finalTitle);
|
||||
await page.getByPlaceholder('Description').fill(finalDescription);
|
||||
|
||||
Reference in New Issue
Block a user