From 8bae65e0b6b1fbfd3adffe8374eda14d339923fc Mon Sep 17 00:00:00 2001 From: "devin-ai-integration[bot]" <158243242+devin-ai-integration[bot]@users.noreply.github.com> Date: Thu, 8 Oct 2026 15:55:22 -0700 Subject: [PATCH] test(ui-e2e): update usage page selectors after the #45221 redesign (#45347) * test(ui-e2e): update usage page selectors after the #45221 redesign * test(ui-e2e): drop the top keys locator comment --------- Co-authored-by: yuneng --- tests/e2e/ui/fixtures/migratedPages.ts | 2 +- tests/e2e/ui/tests/usage/usagePage.spec.ts | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/tests/e2e/ui/fixtures/migratedPages.ts b/tests/e2e/ui/fixtures/migratedPages.ts index d44dfc625aa..5fa1f9d2444 100644 --- a/tests/e2e/ui/fixtures/migratedPages.ts +++ b/tests/e2e/ui/fixtures/migratedPages.ts @@ -117,7 +117,7 @@ export const MIGRATED_E2E_PAGES: Readonly> = { linkName: "AI Hub", content: { role: "heading", name: "AI Hub" }, }, - new_usage: { segment: "usage", linkName: "Usage", content: { role: "heading", name: "Usage View" } }, + new_usage: { segment: "usage", linkName: "Usage", content: { role: "heading", name: "Usage" } }, usage: { segment: "old-usage", linkName: "Old Usage", diff --git a/tests/e2e/ui/tests/usage/usagePage.spec.ts b/tests/e2e/ui/tests/usage/usagePage.spec.ts index 3d057cfa2c9..d532042c7af 100644 --- a/tests/e2e/ui/tests/usage/usagePage.spec.ts +++ b/tests/e2e/ui/tests/usage/usagePage.spec.ts @@ -13,9 +13,8 @@ import { /** Covers /ui/usage. The legacy /ui/old-usage view is deprecated and deliberately not covered. */ -/** Stepping up from the title is exact; the page renders several other tables. */ const topKeysCard = (page: PlaywrightPage): Locator => - page.getByText("Top Virtual Keys", { exact: true }).locator("xpath=.."); + page.locator("section").filter({ has: page.getByRole("heading", { name: "Top Virtual Keys", exact: true }) }); async function openUsage(page: PlaywrightPage): Promise { await navigateToPage(page, Page.NewUsage);