[app] PlanetGarden: e2e passes the gardener question, opens the ring, and pours by tilting the can

This commit is contained in:
2026-11-17 19:15:24 +01:00
parent 5576af4fac
commit 52d8c0bfd1
7 changed files with 137 additions and 12 deletions
+21
View File
@@ -0,0 +1,21 @@
import { expect, type Page } from '@playwright/test';
import { en } from '@rosea/ui/copy';
/**
* The first open asks *Who tends her?* (planet-garden.md §1). Tests that are not about the
* gardener answer it with the first look, so they reach the garden as a returning player does.
*/
export async function pastGardener(page: Page): Promise<void> {
const question = page.getByRole('heading', { level: 2, name: en.gardener.question });
const garden = page.getByRole('button', { name: en.rose.care });
await expect(question.or(garden)).toBeVisible({ timeout: 20_000 });
if (await question.isVisible()) await page.getByRole('button', { name: en.gardener.done }).click();
await expect(garden).toBeVisible();
}
/** Opens the ring of care, as Enter on her (or a tap) does (planet-garden.md G7). */
export async function openRing(page: Page): Promise<void> {
const ring = page.getByRole('group', { name: en.scene.ring });
if (!(await ring.isVisible())) await page.getByRole('button', { name: en.rose.care }).press('Enter');
await expect(ring).toBeVisible();
}