|
@@ -1,152 +1,57 @@
|
|
|
-# ArozOS — end-to-end tests
|
|
|
|
|
|
|
+# Cine Studio — end-to-end tests
|
|
|
|
|
|
|
|
-Browser-driven Playwright tests for ArozOS, organized into two suites:
|
|
|
|
|
|
|
+Browser-driven Playwright tests for the **Cine Studio** WebApp
|
|
|
|
|
+(`src/web/Cine Studio`). They drive the real app in headless Chromium,
|
|
|
|
|
+generating their own media in-page (canvas → MediaRecorder WebM, synthesized
|
|
|
|
|
+WAV) and asserting on actual rendered pixels, so they exercise the full
|
|
|
|
|
+compositor/playback/export pipeline rather than mocking it.
|
|
|
|
|
|
|
|
-- **static** (`specs/`) — front-end-only specs for the **Cine Studio**
|
|
|
|
|
- WebApp, served by a tiny static file server. No Go involved.
|
|
|
|
|
-- **system** (`specs-system/`) — full-stack critical-path specs driven
|
|
|
|
|
- against a **real ArozOS server** (the Go binary built from `src/`),
|
|
|
|
|
- covering sign in / sign out, the desktop shell, the file explorer,
|
|
|
|
|
- system settings, and user management / permission control.
|
|
|
|
|
-
|
|
|
|
|
-Everything lives outside `src/` so it never interferes with the Go module.
|
|
|
|
|
|
|
+These tests are front-end only. They do **not** build or run any Go code and
|
|
|
|
|
+live outside `src/` so they never interfere with the Go module.
|
|
|
|
|
|
|
|
## Layout
|
|
## Layout
|
|
|
|
|
|
|
|
```
|
|
```
|
|
|
test/e2e/playwright/
|
|
test/e2e/playwright/
|
|
|
-├── package.json Playwright dependency + npm test scripts
|
|
|
|
|
-├── run.js orchestrator: runs the static and system suites
|
|
|
|
|
|
|
+├── package.json Playwright dependency + `npm test`
|
|
|
|
|
+├── run.js orchestrator: serves src/web, runs each spec
|
|
|
├── lib/
|
|
├── lib/
|
|
|
│ ├── static-server.js minimal static server for the ArozOS web root
|
|
│ ├── static-server.js minimal static server for the ArozOS web root
|
|
|
-│ ├── harness.js Cine Studio helpers (browser launch, ok/fail)
|
|
|
|
|
-│ ├── arozos-server.js boots a disposable real ArozOS instance
|
|
|
|
|
-│ └── system-harness.js login/API helpers for the system suite
|
|
|
|
|
-├── specs/ Cine Studio specs (static suite)
|
|
|
|
|
-│ ├── functional.js media probe, playback, edit, round-trip, export
|
|
|
|
|
-│ ├── features.js effects, titles, transitions, elements, filters
|
|
|
|
|
-│ ├── interaction.js preview drag/resize, auto tracks, project import
|
|
|
|
|
-│ └── editing.js multi-select, copy/paste, speed, JKL, markers…
|
|
|
|
|
-└── specs-system/ full-stack critical-path specs (system suite)
|
|
|
|
|
- ├── 010-auth.js login page, bad credentials, form login,
|
|
|
|
|
- │ session persistence, logout, gated redirects
|
|
|
|
|
- ├── 020-desktop.js desktop shell, start menu, module list,
|
|
|
|
|
- │ quick access panel, desktop sign-out
|
|
|
|
|
- ├── 021-desktop-api.js every /system/desktop endpoint: host, user
|
|
|
|
|
- │ (self/target/noicon), theme, preference, icon
|
|
|
|
|
- │ location, shortcut create/list/rename
|
|
|
|
|
- ├── 022-desktop-ui.js clock, wallpaper frame, panels, start-menu
|
|
|
|
|
- │ search filtering, notifications, launch icons
|
|
|
|
|
- ├── 023-desktop-windows.js float window lifecycle (launch, focus/
|
|
|
|
|
- │ z-order, max/restore, minimize, close) and
|
|
|
|
|
- │ wallpaper + icon context menus
|
|
|
|
|
- ├── 030-file-explorer.js File Manager UI + full file lifecycle:
|
|
|
|
|
- │ create/rename/copy/move/properties/trash, CSRF
|
|
|
|
|
- ├── 035-file-transfer.js upload / download round-trip, search,
|
|
|
|
|
- │ share-link lifecycle (create/list/public
|
|
|
|
|
- │ download/delete)
|
|
|
|
|
- ├── 040-system-settings.js System Setting UI + settings catalogue
|
|
|
|
|
- ├── 055-account.js account settings UI + password change (wrong
|
|
|
|
|
- │ old password refused, old password stops
|
|
|
|
|
- │ working, new password signs in)
|
|
|
|
|
- ├── 050-users-permissions.js group + user CRUD, module visibility,
|
|
|
|
|
- │ admin-only endpoint enforcement
|
|
|
|
|
- ├── 060-webapps-core.js WebApp wave 1: NotepadA (incl. real file
|
|
|
|
|
- │ open), Text, Photo, Music, Video, PDF Viewer,
|
|
|
|
|
- │ Zip File Manager
|
|
|
|
|
- ├── 070-webapps-office.js WebApp wave 2: Code Studio, MDEditor
|
|
|
|
|
- │ (incl. real file open), Calendar, Notes, Memo,
|
|
|
|
|
- │ Reminders, OfficeViewer, Dashboard
|
|
|
|
|
- ├── 080-webapps-media.js WebApp wave 3: Musicify, Movie, Manga,
|
|
|
|
|
- │ Paint, Pixel Studio, Audio Studio, Camera,
|
|
|
|
|
- │ Recorder, FFmpeg Factory
|
|
|
|
|
- └── 090-webapps-utilities.js WebApp wave 4: Calculator (incl. a
|
|
|
|
|
- real calculation), Clock, Browser, Speedtest,
|
|
|
|
|
- Web Downloader, Web Builder, SQLite Admin,
|
|
|
|
|
- Terminal, AGIForge, AIChat, OTPAuth,
|
|
|
|
|
- Productivity, OnScreenKeyboard, Arozcast,
|
|
|
|
|
- Management Gateway, UnitTest, CronDemo,
|
|
|
|
|
- Serverless
|
|
|
|
|
|
|
+│ └── harness.js browser launch, app navigation, ok()/fail()
|
|
|
|
|
+└── specs/
|
|
|
|
|
+ ├── functional.js media probe, playback, edit, round-trip, WebM export
|
|
|
|
|
+ ├── features.js effects, titles, transitions, elements, filters
|
|
|
|
|
+ ├── interaction.js preview drag/resize, auto tracks, .pxs/.asproj import
|
|
|
|
|
+ └── editing.js multi-select, copy/paste, speed, JKL, markers, autosave…
|
|
|
```
|
|
```
|
|
|
|
|
|
|
|
-## WebApp coverage
|
|
|
|
|
-
|
|
|
|
|
-All 44 WebApps under `src/web` were inventoried (name, group, file
|
|
|
|
|
-associations) and ranked into four waves, now all covered:
|
|
|
|
|
-
|
|
|
|
|
-1. **Core daily drivers** *(`060-webapps-core.js`)* - NotepadA, Text,
|
|
|
|
|
- Photo, Music, Video, PDF Viewer, Zip File Manager - the default
|
|
|
|
|
- openers for everyday file types.
|
|
|
|
|
-2. **Office / productivity** *(`070-webapps-office.js`)* - Code Studio,
|
|
|
|
|
- MDEditor, Calendar, Notes, Memo, Reminders, OfficeViewer, Dashboard.
|
|
|
|
|
-3. **Media / creative** *(`080-webapps-media.js`)* - Musicify, Movie,
|
|
|
|
|
- Manga, Paint, Pixel Studio, Audio Studio, Camera, Recorder, FFmpeg
|
|
|
|
|
- Factory. Cine Studio keeps its own deep static suite under `specs/`.
|
|
|
|
|
-4. **Utilities / dev / network** *(`090-webapps-utilities.js`)* -
|
|
|
|
|
- Calculator, Clock, Browser, Speedtest, Web Downloader, Web Builder,
|
|
|
|
|
- SQLite Admin, Terminal, AGIForge, AIChat, OTPAuth, Productivity,
|
|
|
|
|
- OnScreenKeyboard, Arozcast, Management Gateway, UnitTest, CronDemo,
|
|
|
|
|
- Serverless.
|
|
|
|
|
-
|
|
|
|
|
-The WebApp specs are load-and-render smoke tests (plus a few real
|
|
|
|
|
-interactions: opening files in NotepadA / MDEditor, a Calculator sum);
|
|
|
|
|
-they guard against apps that break outright. Deeper per-app behavioural
|
|
|
|
|
-coverage can grow inside each wave spec over time.
|
|
|
|
|
-
|
|
|
|
|
-## How the system suite works
|
|
|
|
|
-
|
|
|
|
|
-`lib/arozos-server.js` boots the real server in an isolated throwaway
|
|
|
|
|
-folder (`.instance/`, gitignored): `web/` is a symlink to `src/web`,
|
|
|
|
|
-`system/` is a private copy of the `src/system` template, and the user
|
|
|
|
|
-files / database are created fresh by the server itself. Because every
|
|
|
|
|
-run starts at the zero-user state, the harness registers a
|
|
|
|
|
-deterministic `admin` account through the same endpoint the first-boot
|
|
|
|
|
-wizard uses, then hands specs a base URL plus those credentials.
|
|
|
|
|
-
|
|
|
|
|
-The server binary is `src/arozos` (or `AROZOS_BIN`); when missing it is
|
|
|
|
|
-built automatically with `go build`.
|
|
|
|
|
-
|
|
|
|
|
## Running locally
|
|
## Running locally
|
|
|
|
|
|
|
|
```bash
|
|
```bash
|
|
|
cd test/e2e/playwright
|
|
cd test/e2e/playwright
|
|
|
npm install
|
|
npm install
|
|
|
npx playwright install chromium
|
|
npx playwright install chromium
|
|
|
-npm test # both suites
|
|
|
|
|
-npm run test:static # Cine Studio only (no Go needed)
|
|
|
|
|
-npm run test:system # full-stack critical paths only
|
|
|
|
|
-```
|
|
|
|
|
-
|
|
|
|
|
-Run a single system spec (it boots its own private server):
|
|
|
|
|
-
|
|
|
|
|
-```bash
|
|
|
|
|
-node specs-system/010-auth.js
|
|
|
|
|
|
|
+npm test
|
|
|
```
|
|
```
|
|
|
|
|
|
|
|
-Or point specs at an already-running test instance:
|
|
|
|
|
-
|
|
|
|
|
-```bash
|
|
|
|
|
-AROZ_BASE_URL=http://127.0.0.1:8126 \
|
|
|
|
|
-AROZ_ADMIN_USER=admin AROZ_ADMIN_PASS=... node specs-system/020-desktop.js
|
|
|
|
|
-```
|
|
|
|
|
|
|
+`run.js` starts a static server for `src/web` (default port 8123) and runs
|
|
|
|
|
+every spec in `specs/` in its own process, exiting non-zero if any fails.
|
|
|
|
|
|
|
|
### Useful env vars
|
|
### Useful env vars
|
|
|
|
|
|
|
|
| Var | Purpose |
|
|
| Var | Purpose |
|
|
|
| --- | --- |
|
|
| --- | --- |
|
|
|
-| `E2E_SUITE` | `static`, `system` or `all` (default `all`) |
|
|
|
|
|
-| `CS_BASE_URL` | Point a Cine Studio spec at an already-running static server |
|
|
|
|
|
|
|
+| `CS_BASE_URL` | Point a spec at an already-running server instead of starting one |
|
|
|
| `WEB_PORT` | Port for the built-in static server (default `8123`) |
|
|
| `WEB_PORT` | Port for the built-in static server (default `8123`) |
|
|
|
-| `AROZ_PORT` | Port for the disposable ArozOS instance (default `8126`) |
|
|
|
|
|
-| `AROZ_BASE_URL` | Reuse an already-running ArozOS test instance |
|
|
|
|
|
-| `AROZOS_BIN` | Prebuilt arozos binary (default `src/arozos`, auto-built) |
|
|
|
|
|
-| `PW_CHROMIUM_PATH` | Use a preinstalled Chromium binary |
|
|
|
|
|
|
|
+| `PW_CHROMIUM_PATH` | Use a preinstalled Chromium binary instead of Playwright's own |
|
|
|
|
|
+
|
|
|
|
|
+Run a single spec against the running server:
|
|
|
|
|
|
|
|
-When a system spec fails, check `.instance/server.log` for the server
|
|
|
|
|
-side of the story.
|
|
|
|
|
|
|
+```bash
|
|
|
|
|
+CS_BASE_URL=http://127.0.0.1:8123 node specs/functional.js
|
|
|
|
|
+```
|
|
|
|
|
|
|
|
## CI
|
|
## CI
|
|
|
|
|
|
|
|
-`.github/workflows/e2e-playwright.yml` builds the Go binary and runs
|
|
|
|
|
-both suites on any push or pull request touching `src/` or this
|
|
|
|
|
-harness, and uploads `.instance/server.log` as an artifact on failure.
|
|
|
|
|
|
|
+`.github/workflows/e2e-playwright.yml` runs the suite on pushes and pull
|
|
|
|
|
+requests that touch the app or this harness.
|