import { test, expect, type Page } from '@playwright/test'; import { openSpaceTab } from './helpers/spaceTabs'; // ── Automations (scheduled task CRUD) E2E ───────────────────────────────────── // // REQUIRES `npm run test:e2e` + a running server (ui/playwright.config.ts boots // the real orchestrator with auth OFF → synthetic 'local' user). This does NOT // run in the sandbox — there is no live server here. // // WHERE the page lives: commit e6733e58 retired the top-level Automations tab // and moved automations inside each workspace — `?page=schedules` now falls back // to the spaces view, so the old `page.goto('/ui?page=schedules')` never reached // the page and both tests in this file had been failing since (issue #1338). The // screen itself is unchanged: SpaceDetail renders the SAME SchedulesPage // component under its 自動実行 tab, which lives in the 「その他」 overflow menu // (helpers/spaceTabs.ts). So this spec drives it there instead, and the // selectors below still hold. Neither the workspaces view nor the automations // screen is auth-gated. The cronForm lib is partially unit-covered; this proves // the create/list/edit UI wiring that has no other e2e. // // Selector grounding (read from SchedulesPage.tsx + i18n locales en/ja): // - List: a "New automation" / "新しい自動実行" button (list.new) opens the editor. // - Editor: a Title input (placeholder "Weekly news roundup" / "週次ニュースまとめ"), // a Prompt textarea (placeholder "Enter the prompt to run" / "実行するプロンプトを入力"), // and a submit button "Create"/"作成" (gated on a non-empty prompt body). // - Each schedule renders as a list