From cb3f54aafbeb0a1d14715a30a50e241c9e2c25c9 Mon Sep 17 00:00:00 2001 From: Olga Bulat Date: Fri, 18 Oct 2024 07:29:11 +0300 Subject: [PATCH] Fix flaky e2e preferences test --- frontend/src/pages/preferences.vue | 2 +- frontend/test/playwright/e2e/preferences.spec.ts | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/frontend/src/pages/preferences.vue b/frontend/src/pages/preferences.vue index 078d5cd524b..1331676aca3 100644 --- a/frontend/src/pages/preferences.vue +++ b/frontend/src/pages/preferences.vue @@ -124,7 +124,7 @@ const doneHydrating = computed(() => useHydrating()) @change="handleChange" >
- {{ flag.name }} + {{ flag.name }}{{ ` : ${flag.state}` }}
{{ flag.description }}
diff --git a/frontend/test/playwright/e2e/preferences.spec.ts b/frontend/test/playwright/e2e/preferences.spec.ts index 74d69d52631..84000ffa6fa 100644 --- a/frontend/test/playwright/e2e/preferences.spec.ts +++ b/frontend/test/playwright/e2e/preferences.spec.ts @@ -1,4 +1,4 @@ -import { type Page, test } from "@playwright/test" +import { type Page, expect, test } from "@playwright/test" import { preparePageForTests } from "~~/test/playwright/utils/navigation" @@ -104,6 +104,8 @@ const toggleChecked = async ( }, [name, !originalChecked ? "bg-tertiary" : "bg-default"] as const ) + const textRe = new RegExp(`${name}: ${!originalChecked ? "on" : "off"}`) + await expect(page.getByText(textRe).first()).toBeVisible() } test.describe("switchable features", () => {