From cb95f95f022a95e4fc272cbff9d8eb4a73a1a9ae Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 13 Jul 2026 06:56:51 +0000 Subject: [PATCH 1/2] fix(qms-tests): make closeNewMessagePopup dismiss all lingering overlays The TESTS-206 test intermittently timed out clicking buttonComments because a modal-overlay from the add-message popup remained and intercepted pointer events. Escape only closes the topmost popup, so a single Escape + click left a second overlay behind when more than one popup was open. Dismiss popups in a loop until no modal-overlay remains and assert it is gone before returning, so subsequent clicks are not blocked. Co-Authored-By: Claude Opus 4.8 Claude-Session: https://claude.ai/code/session_012JGaU2EosGSuqyQCss1rh1 --- .../tests/model/documents/document-content-page.ts | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/qms-tests/sanity/tests/model/documents/document-content-page.ts b/qms-tests/sanity/tests/model/documents/document-content-page.ts index 5ebf3765ad..f700052d4f 100644 --- a/qms-tests/sanity/tests/model/documents/document-content-page.ts +++ b/qms-tests/sanity/tests/model/documents/document-content-page.ts @@ -825,8 +825,18 @@ export class DocumentContentPage extends DocumentCommonPage { } async closeNewMessagePopup (): Promise { - await this.textPageHeader.press('Escape', { delay: 300 }) + const overlay = this.page.locator('div.modal-overlay') + // Adding a message can leave one or more popups open, each rendering a modal + // overlay that intercepts pointer events for the following actions. Escape + // only closes the topmost popup, so keep dismissing until no overlay remains, + // otherwise a lingering overlay makes subsequent clicks time out. + for (let attempt = 0; attempt < 5; attempt++) { + if ((await overlay.count()) === 0) break + await this.textPageHeader.press('Escape', { delay: 300 }) + await overlay.first().waitFor({ state: 'detached', timeout: 1000 }).catch(() => {}) + } await this.textPageHeader.click({ force: true, delay: 300, position: { x: 1, y: 1 } }) + await expect(overlay).toHaveCount(0, { timeout: 5000 }) } async completeReview (): Promise { From 808d80cdbfe7785fecbd0762ba7779c468705de0 Mon Sep 17 00:00:00 2001 From: Artem Savchenko Date: Tue, 14 Jul 2026 15:16:52 +0700 Subject: [PATCH 2/2] Fix formatting Signed-off-by: Artem Savchenko --- .../sanity/tests/model/documents/document-content-page.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/qms-tests/sanity/tests/model/documents/document-content-page.ts b/qms-tests/sanity/tests/model/documents/document-content-page.ts index f700052d4f..93c2af9715 100644 --- a/qms-tests/sanity/tests/model/documents/document-content-page.ts +++ b/qms-tests/sanity/tests/model/documents/document-content-page.ts @@ -833,7 +833,10 @@ export class DocumentContentPage extends DocumentCommonPage { for (let attempt = 0; attempt < 5; attempt++) { if ((await overlay.count()) === 0) break await this.textPageHeader.press('Escape', { delay: 300 }) - await overlay.first().waitFor({ state: 'detached', timeout: 1000 }).catch(() => {}) + await overlay + .first() + .waitFor({ state: 'detached', timeout: 1000 }) + .catch(() => {}) } await this.textPageHeader.click({ force: true, delay: 300, position: { x: 1, y: 1 } }) await expect(overlay).toHaveCount(0, { timeout: 5000 })