Fix E2E specs for onboarding name step and Heute reload route
Co-authored-by: cynarAI <cynarAI@users.noreply.github.com>
This commit is contained in:
parent
b2c80e3119
commit
e5e378a11a
@ -21,6 +21,7 @@ test("onboarding names the first Oo and shows it in chat", async ({ page }) => {
|
|||||||
test("German UI keeps Deutsch on language skip label", async ({ page }) => {
|
test("German UI keeps Deutsch on language skip label", async ({ page }) => {
|
||||||
await page.addInitScript(() => {
|
await page.addInitScript(() => {
|
||||||
Object.defineProperty(navigator, "language", { value: "de-DE", configurable: true });
|
Object.defineProperty(navigator, "language", { value: "de-DE", configurable: true });
|
||||||
|
localStorage.setItem("rakazo.uiLocale", "de");
|
||||||
});
|
});
|
||||||
const stamp = Date.now();
|
const stamp = Date.now();
|
||||||
await signup(page, `de-skip-${stamp}@rakazo.test`, "password12", "Deutsch");
|
await signup(page, `de-skip-${stamp}@rakazo.test`, "password12", "Deutsch");
|
||||||
@ -35,6 +36,7 @@ test("German UI keeps Deutsch on language skip label", async ({ page }) => {
|
|||||||
test("German voice step lists German voices after choosing Deutsch", async ({ page }) => {
|
test("German voice step lists German voices after choosing Deutsch", async ({ page }) => {
|
||||||
await page.addInitScript(() => {
|
await page.addInitScript(() => {
|
||||||
Object.defineProperty(navigator, "language", { value: "de-DE", configurable: true });
|
Object.defineProperty(navigator, "language", { value: "de-DE", configurable: true });
|
||||||
|
localStorage.setItem("rakazo.uiLocale", "de");
|
||||||
});
|
});
|
||||||
const stamp = Date.now();
|
const stamp = Date.now();
|
||||||
await signup(page, `de-voice-${stamp}@rakazo.test`, "password12", "Stimme");
|
await signup(page, `de-voice-${stamp}@rakazo.test`, "password12", "Stimme");
|
||||||
@ -52,6 +54,7 @@ test("German voice step lists German voices after choosing Deutsch", async ({ pa
|
|||||||
test("main conversation does not show a group subtitle for one Oo", async ({ page }) => {
|
test("main conversation does not show a group subtitle for one Oo", async ({ page }) => {
|
||||||
await page.addInitScript(() => {
|
await page.addInitScript(() => {
|
||||||
Object.defineProperty(navigator, "language", { value: "de-DE", configurable: true });
|
Object.defineProperty(navigator, "language", { value: "de-DE", configurable: true });
|
||||||
|
localStorage.setItem("rakazo.uiLocale", "de");
|
||||||
});
|
});
|
||||||
const stamp = Date.now();
|
const stamp = Date.now();
|
||||||
await signup(page, `main-1-1-${stamp}@rakazo.test`, "password12", "Solo");
|
await signup(page, `main-1-1-${stamp}@rakazo.test`, "password12", "Solo");
|
||||||
|
|||||||
@ -87,6 +87,12 @@ async function visible(locator: Locator, timeout: number) {
|
|||||||
return locator.isVisible({ timeout }).catch(() => false);
|
return locator.isVisible({ timeout }).catch(() => false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** After the look picker, skip the optional Oo naming step (keeps the default name). */
|
||||||
|
export async function skipOnboardingNameStep(page: Page) {
|
||||||
|
await expect(page.getByTestId("onboarding-name-step")).toBeVisible();
|
||||||
|
await page.getByRole("button", { name: "Skip", exact: true }).click();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Walks the first-run wizard, which lands in the main conversation with the main bot's first
|
* Walks the first-run wizard, which lands in the main conversation with the main bot's first
|
||||||
* onboarding question pending (the composer works regardless). Unless `mainConversation` is
|
* onboarding question pending (the composer works regardless). Unless `mainConversation` is
|
||||||
|
|||||||
@ -85,7 +85,8 @@ test("Heute shows the coach's brief, habits and goals, checks habits off and set
|
|||||||
await captureScreenshot(page, testInfo, "heute-coach");
|
await captureScreenshot(page, testInfo, "heute-coach");
|
||||||
|
|
||||||
await page.reload();
|
await page.reload();
|
||||||
await openHeute(page);
|
await expect(page).toHaveURL(/\/app\/heute$/);
|
||||||
|
await expect(page.getByTestId("heute-brief")).toBeVisible();
|
||||||
await expect(page.getByTestId(`heute-habit-${habit.id}`).getByRole("checkbox")).toBeChecked();
|
await expect(page.getByTestId(`heute-habit-${habit.id}`).getByRole("checkbox")).toBeChecked();
|
||||||
|
|
||||||
// Check-in times live behind one compact control.
|
// Check-in times live behind one compact control.
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
import { expect, test } from "@playwright/test";
|
import { expect, test } from "@playwright/test";
|
||||||
import { captureScreenshot, signup } from "./helpers";
|
import { captureScreenshot, signup, skipOnboardingNameStep } from "./helpers";
|
||||||
|
|
||||||
test.beforeEach(async ({ page }) => {
|
test.beforeEach(async ({ page }) => {
|
||||||
await page.route("**/rpc/integrationSetup/get", (route) =>
|
await page.route("**/rpc/integrationSetup/get", (route) =>
|
||||||
@ -49,11 +49,12 @@ test("emoji-first onboarding: shape + color selection with live preview", async
|
|||||||
|
|
||||||
if (testInfo) await captureScreenshot(page, testInfo, "02-shape-color-preview");
|
if (testInfo) await captureScreenshot(page, testInfo, "02-shape-color-preview");
|
||||||
|
|
||||||
// Click Continue → goes to the language step
|
// Click Continue → naming, then language.
|
||||||
await page
|
await page
|
||||||
.getByRole("button", { name: /Continue/i })
|
.getByRole("button", { name: /Continue/i })
|
||||||
.first()
|
.first()
|
||||||
.click();
|
.click();
|
||||||
|
await skipOnboardingNameStep(page);
|
||||||
|
|
||||||
// Step 2: Language selection
|
// Step 2: Language selection
|
||||||
await expect(page.getByRole("heading", { name: /Choose your language/i })).toBeVisible();
|
await expect(page.getByRole("heading", { name: /Choose your language/i })).toBeVisible();
|
||||||
@ -96,6 +97,7 @@ test("onboarding: skip language defaults to English", async ({ page }) => {
|
|||||||
.getByRole("button", { name: /Continue/i })
|
.getByRole("button", { name: /Continue/i })
|
||||||
.first()
|
.first()
|
||||||
.click();
|
.click();
|
||||||
|
await skipOnboardingNameStep(page);
|
||||||
|
|
||||||
// Language step — click Skip, then skip voice.
|
// Language step — click Skip, then skip voice.
|
||||||
await expect(page.getByRole("heading", { name: /Choose your language/i })).toBeVisible();
|
await expect(page.getByRole("heading", { name: /Choose your language/i })).toBeVisible();
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
import type { Page } from "@playwright/test";
|
import type { Page } from "@playwright/test";
|
||||||
import { expect, test } from "@playwright/test";
|
import { expect, test } from "@playwright/test";
|
||||||
import { captureScreenshot, signup } from "./helpers";
|
import { captureScreenshot, signup, skipOnboardingNameStep } from "./helpers";
|
||||||
|
|
||||||
test.beforeEach(async ({ page }) => {
|
test.beforeEach(async ({ page }) => {
|
||||||
await page.route("**/rpc/integrationSetup/get", (route) =>
|
await page.route("**/rpc/integrationSetup/get", (route) =>
|
||||||
@ -77,5 +77,6 @@ test("mobile onboarding: category pick and swipe look previews", async ({ page }
|
|||||||
.getByRole("button", { name: /Continue/i })
|
.getByRole("button", { name: /Continue/i })
|
||||||
.first()
|
.first()
|
||||||
.click();
|
.click();
|
||||||
|
await skipOnboardingNameStep(page);
|
||||||
await expect(page.getByRole("heading", { name: /Choose your language/i })).toBeVisible();
|
await expect(page.getByRole("heading", { name: /Choose your language/i })).toBeVisible();
|
||||||
});
|
});
|
||||||
|
|||||||
@ -4,7 +4,14 @@
|
|||||||
* with its origin, confirms a pending one, and forgets one or all of them.
|
* with its origin, confirms a pending one, and forgets one or all of them.
|
||||||
*/
|
*/
|
||||||
import { expect, test } from "@playwright/test";
|
import { expect, test } from "@playwright/test";
|
||||||
import { captureScreenshot, openUserSettings, rpc, signup, waitForChatComposer } from "./helpers";
|
import {
|
||||||
|
captureScreenshot,
|
||||||
|
openUserSettings,
|
||||||
|
rpc,
|
||||||
|
signup,
|
||||||
|
skipOnboardingNameStep,
|
||||||
|
waitForChatComposer,
|
||||||
|
} from "./helpers";
|
||||||
|
|
||||||
test.use({ timezoneId: "Europe/Vienna" });
|
test.use({ timezoneId: "Europe/Vienna" });
|
||||||
|
|
||||||
@ -34,6 +41,7 @@ test("onboarding feeds the profile; facts can be confirmed and forgotten", async
|
|||||||
timeout: 30_000,
|
timeout: 30_000,
|
||||||
});
|
});
|
||||||
await page.getByRole("button", { name: "Continue", exact: true }).click();
|
await page.getByRole("button", { name: "Continue", exact: true }).click();
|
||||||
|
await skipOnboardingNameStep(page);
|
||||||
|
|
||||||
await expect(page.getByRole("heading", { name: /Choose your language/i })).toBeVisible();
|
await expect(page.getByRole("heading", { name: /Choose your language/i })).toBeVisible();
|
||||||
await page.getByRole("button", { name: "English", exact: true }).click();
|
await page.getByRole("button", { name: "English", exact: true }).click();
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user