From 9cb668eabb185c8288f00f072e0fa677adf40845 Mon Sep 17 00:00:00 2001 From: "Timo K." Date: Thu, 26 Nov 2026 11:43:58 +0100 Subject: [PATCH] Fix toast timeout bug Always waited 5s on every test to dismiss the toast. --- playwright/widget/test-helpers.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/playwright/widget/test-helpers.ts b/playwright/widget/test-helpers.ts index 38e61f49c..28fa05895 100644 --- a/playwright/widget/test-helpers.ts +++ b/playwright/widget/test-helpers.ts @@ -206,8 +206,11 @@ export class TestHelpers { await expect(dialog).toBeHidden({ timeout: 5000 }); } // The same element shows the next toast a moment after the click, so - // reading it straight away acts on the dismissed one a second time - await expect(toastTitle).not.toHaveText(title, { timeout: 5000 }); + // reading it straight away acts on the dismissed one a second time. + // Counted rather than read, as the last toast leaves no title behind. + await expect(toastTitle.filter({ hasText: title })).toHaveCount(0, { + timeout: 5000, + }); } else { // Unknown toast. We don't want to act on unknown toasts break;