Give the trigger the same patience the click it replaced had

`.click()` carries Playwright's 30 s actionability wait. The visibility check
that replaced it ran on the default expect timeout, so the helper made the wait
shorter than the code it stood in for, and a dashboard that was slow to paint
failed on the trigger rather than on the menu.
This commit is contained in:
Marc-André Bombeck committed 2026-08-04 02:11:22 +02:00
1 parent 9eb5db4c35
commit 17a2ec3328
1 file changed
+5 -1
+5 -1
View File
@@ -28,7 +28,11 @@ import { expect, type Locator, type Page } from "@playwright/test";
* nothing.
*/
export async function openMenu(page: Page, trigger: Locator): Promise<void> {
await expect(trigger).toBeVisible();
// A bare `.click()` carries Playwright's own 30 s actionability wait, so the
// visibility check that replaces it has to be at least as patient. Left on
// the default expect timeout this helper made the wait SHORTER than the code
// it replaced, and a slow dashboard failed here instead of at the menu.
await expect(trigger).toBeVisible({ timeout: 30_000 });
for (let attempt = 0; attempt < 5; attempt++) {
await trigger.click();