diff --git a/e2e/pages/project.page.ts b/e2e/pages/project.page.ts index fd34814db..d47384f49 100644 --- a/e2e/pages/project.page.ts +++ b/e2e/pages/project.page.ts @@ -106,8 +106,12 @@ export class ProjectPage extends BasePage { } } - // Wait for the dialog to appear - await this.projectNameInput.waitFor({ state: 'visible' }); + // Wait for the dialog to appear and be fully initialized + await this.projectNameInput.waitFor({ state: 'visible', timeout: 10000 }); + + // Wait for Angular to fully initialize the form + await this.page.waitForTimeout(300); + await this.projectNameInput.fill(prefixedProjectName); await this.submitBtn.click(); diff --git a/e2e/pages/tag.page.ts b/e2e/pages/tag.page.ts index 3a287f39b..24285d805 100644 --- a/e2e/pages/tag.page.ts +++ b/e2e/pages/tag.page.ts @@ -52,7 +52,11 @@ export class TagPage extends BasePage { // Wait for create tag dialog (uses "Tag Name" label in sidebar create dialog) const tagNameInput = this.page.getByRole('textbox', { name: 'Tag Name' }); - await tagNameInput.waitFor({ state: 'visible', timeout: 5000 }); + await tagNameInput.waitFor({ state: 'visible', timeout: 10000 }); + + // Wait for Angular to fully initialize the form + await this.page.waitForTimeout(300); + await tagNameInput.fill(tagName); // Submit the form - click the Save button @@ -81,8 +85,11 @@ export class TagPage extends BasePage { await toggleTagsBtn.waitFor({ state: 'visible', timeout: 5000 }); await toggleTagsBtn.click(); - // Wait for tag submenu to appear - await this.page.waitForTimeout(300); + // Wait for tag submenu to appear by waiting for any submenu button + await this.page + .locator('.mat-mdc-menu-panel') + .nth(1) + .waitFor({ state: 'visible', timeout: 3000 }); // Find and click the tag in the submenu const tagOption = this.page.locator('.mat-mdc-menu-content button', { @@ -115,6 +122,10 @@ export class TagPage extends BasePage { // Wait for all overlays to close to ensure clean state for next operation await this.ensureOverlaysClosed(); + + // Wait for the tag to actually appear on the task + const tagOnTask = this.getTagOnTask(task, tagName); + await tagOnTask.waitFor({ state: 'visible', timeout: 5000 }); } /** diff --git a/e2e/tests/issue-provider-panel/issue-provider-panel.spec.ts b/e2e/tests/issue-provider-panel/issue-provider-panel.spec.ts index ad33f95e0..78c537b70 100644 --- a/e2e/tests/issue-provider-panel/issue-provider-panel.spec.ts +++ b/e2e/tests/issue-provider-panel/issue-provider-panel.spec.ts @@ -45,9 +45,24 @@ test.describe('Issue Provider Panel', () => { .catch(() => null); if (dialogOpened) { - await page.click(CANCEL_BTN); - // Wait for dialog to close - await page.waitForSelector(CANCEL_BTN, { state: 'detached' }); + // Wait for dialog to be stable before clicking + await page.waitForTimeout(500); + + // Try to click cancel, but handle case where dialog auto-closes + const cancelClicked = await page + .click(CANCEL_BTN, { timeout: 5000 }) + .catch(() => false); + + if (cancelClicked !== false) { + // Wait for dialog to close + await page.waitForSelector(CANCEL_BTN, { state: 'detached' }); + } + + // Ensure we're back on the issue provider panel + await page.waitForSelector('issue-provider-setup-overview', { + state: 'visible', + timeout: 3000, + }); } } }