From 4663f3e40f29007afa17b8e2e1fd75ef1f66d38e Mon Sep 17 00:00:00 2001 From: "paseo-bot[bot]" <266920839+paseo-bot[bot]@users.noreply.github.com> Date: Thu, 19 Nov 2026 03:00:38 +0000 Subject: [PATCH] Find a plugin toast in e2e while the previous toast still fades out (#10168) * test(app): find a plugin toast while the previous one still fades A toast that times out stays in the page during its 140 ms fade. When the next toast appears in that window, the plugin helper's locator matched both and failed in strict mode. Wait for the toast that carries the message. Co-Authored-By: Claude Opus 5.5 * test(app): match toast text with case so Installed differs from Uninstalled A string passed to hasText matches part of the text and ignores case, so "Installed e2e-plugin" also matched the "Uninstalled e2e-plugin" toast that the spec shows just before it reinstalls. Use a case-sensitive pattern, as toContainText did before. Co-Authored-By: Claude Opus 5.5 * test(app): find a plugin toast while a toast with the same text fades Two "Reloaded e2e-plugin" toasts can share the screen during the 140 ms fade, and the filtered locator then matched both. Either one shows the message, so take the first. Co-Authored-By: Claude Opus 5.5 --------- Co-authored-by: paseo-bot[bot] <266920839+paseo-bot[bot]@users.noreply.github.com> Co-authored-by: Claude Opus 5.5 --- packages/app/e2e/support/helpers/plugin-gallery.ts | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/packages/app/e2e/support/helpers/plugin-gallery.ts b/packages/app/e2e/support/helpers/plugin-gallery.ts index 129f92488..1f6fd4e4e 100644 --- a/packages/app/e2e/support/helpers/plugin-gallery.ts +++ b/packages/app/e2e/support/helpers/plugin-gallery.ts @@ -2,6 +2,7 @@ import { buildSettingsHostSectionRoute } from "@/utils/host-routes"; import { expect, type Page } from "../fixtures"; import { getServerId } from "./server-id"; import { expectAppRoute } from "./route-assertions"; +import { escapeRegex } from "./regex"; /** * Settings → Host → Plugins: the Installed and Browse tabs, the page menu, the install sheet and a @@ -28,8 +29,17 @@ function pluginSwitch(page: Page, name: string, action: "Disable" | "Enable") { }); } +/** + * A toast that times out stays in the page while it fades, so the next toast can share the screen + * with it, even when both have the same text. The pattern matches case, so "Installed x" does not + * match "Uninstalled x". + */ export async function expectToast(page: Page, message: string): Promise { - await expect(page.getByTestId("app-toast-message")).toContainText(message); + const toast = page + .getByTestId("app-toast-message") + .filter({ hasText: new RegExp(escapeRegex(message)) }) + .first(); + await expect(toast).toBeVisible(); } // Tabs and search