From 44839c254a812681deb43dbddf1664625c43b373 Mon Sep 17 00:00:00 2001 From: ToxicCrzay270 <185776014+ToxicCrzay270@users.noreply.github.com> Date: Tue, 19 May 2026 23:38:14 +0200 Subject: [PATCH] Add Gitea GUI smoke test --- .codex/project.md | 3 ++ .gitea/workflows/gui-smoke.yml | 87 ++++++++++++++++++++++++++++++++++ AGENTS.md | 2 +- README.md | 2 + docs/agent-handoff.md | 1 + 5 files changed, 94 insertions(+), 1 deletion(-) create mode 100644 .gitea/workflows/gui-smoke.yml diff --git a/.codex/project.md b/.codex/project.md index d55b612..438e29b 100644 --- a/.codex/project.md +++ b/.codex/project.md @@ -39,6 +39,7 @@ Build and test verification should run on the Gitea runner with: ```text .gitea/workflows/build.yml +.gitea/workflows/gui-smoke.yml ``` Project build, test, audit, package, installer, dependency setup, and release commands must run on Gitea Ubuntu runners only. Supported labels are `ubuntu-latest`, `ubuntu-24.04`, and `ubuntu-22.04` on `global-runner-1`, `global-runner-2`, and `global-runner-3`. @@ -67,6 +68,8 @@ dist/ The Gitea build workflow uploads `dist/` as the `league-of-legends-gui-overhaul-dist` workflow artifact. +The Gitea GUI smoke workflow uploads browser evidence as the `gui-smoke-artifacts` workflow artifact. + ## Security Rules - Do not commit secrets, tokens, `.env` files, certificates, or private keys. diff --git a/.gitea/workflows/gui-smoke.yml b/.gitea/workflows/gui-smoke.yml new file mode 100644 index 0000000..bd6f792 --- /dev/null +++ b/.gitea/workflows/gui-smoke.yml @@ -0,0 +1,87 @@ +name: GUI Smoke Test + +on: + push: + branches: + - master + - main + pull_request: + workflow_dispatch: + +jobs: + gui-smoke: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: "24" + cache: npm + + - name: Install dependencies + run: npm ci + + - name: Build web app + run: npm run build + + - name: Install Chromium for smoke test + run: npx --yes @playwright/test@1.56.1 install --with-deps chromium + + - name: Start preview server + shell: bash + run: | + npm run preview -- --host 127.0.0.1 --port 4173 > preview.log 2>&1 & + echo "$!" > preview.pid + + for attempt in {1..30}; do + if curl --fail --silent --show-error http://127.0.0.1:4173 > /dev/null; then + echo "Preview server is ready." + exit 0 + fi + sleep 1 + done + + echo "Preview server did not become ready." + cat preview.log + exit 1 + + - name: Run GUI smoke test + shell: bash + run: | + cat > gui-smoke.spec.ts <<'EOF' + import { expect, test } from "@playwright/test"; + + test("home GUI renders in browser", async ({ page }) => { + await page.goto("http://127.0.0.1:4173/", { waitUntil: "networkidle" }); + await expect(page.getByText("Nexus Overhaul")).toBeVisible(); + await expect(page.getByRole("heading", { name: "MOBA Interface Foundation" })).toBeVisible(); + await expect(page.getByRole("link", { name: "Play Prototype" })).toBeVisible(); + await expect(page.getByText("Status: local prototype")).toBeVisible(); + await page.screenshot({ path: "gui-smoke-home.png", fullPage: true }); + }); + EOF + + npx --yes @playwright/test@1.56.1 test gui-smoke.spec.ts --browser=chromium --reporter=line + + - name: Stop preview server + if: always() + shell: bash + run: | + if [ -f preview.pid ]; then + kill "$(cat preview.pid)" 2>/dev/null || true + fi + + - name: Upload GUI smoke artifacts + if: always() + uses: actions/upload-artifact@v3 + with: + name: gui-smoke-artifacts + path: | + gui-smoke-home.png + preview.log + playwright-report/ + test-results/ + if-no-files-found: ignore diff --git a/AGENTS.md b/AGENTS.md index 027b67c..4efd97b 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -45,7 +45,7 @@ git diff --check `npm run lint` runs `tsc --noEmit`. `npm run release:check` runs lint, tests, and build. -For build, test, audit, dependency setup, package, installer, and release verification, use the Gitea runner workflow `.gitea/workflows/build.yml`. Do not use this local machine for those heavy project commands. +For build, test, audit, dependency setup, package, installer, and release verification, use Gitea runner workflows such as `.gitea/workflows/build.yml` and `.gitea/workflows/gui-smoke.yml`. Do not use this local machine for those heavy project commands. Keep `.codex/project.md` and this `AGENTS.md` aligned when commands, artifact paths, or release rules change. diff --git a/README.md b/README.md index 619a8bc..9abb517 100644 --- a/README.md +++ b/README.md @@ -62,6 +62,8 @@ npm run audit CI verification runs on the Gitea runner through `.gitea/workflows/build.yml`. +GUI smoke verification runs on the Gitea runner through `.gitea/workflows/gui-smoke.yml`. It builds the app, starts `vite preview`, opens the UI in Chromium, and uploads a screenshot artifact. + ## Project Structure ```text diff --git a/docs/agent-handoff.md b/docs/agent-handoff.md index 15d1c00..2e02bdb 100644 --- a/docs/agent-handoff.md +++ b/docs/agent-handoff.md @@ -21,6 +21,7 @@ Codex Agent Repository Kit baseline applied. The project is a React/Vite/TypeScr - Added standard npm `lint`, `audit`, and `release:check` scripts from the Node kit profile. - Processed Agent Kit update `c0262b9`, including the repository-owner derivation rule. - Processed Agent Kit update `v1.0.6`, including safe fast-forward task starts, Gitea Ubuntu runner-only verification, follow-up issue guidance, and release artifact metadata exclusions. +- Added Gitea GUI smoke workflow that builds the app, runs `vite preview`, checks the rendered UI in Chromium, and uploads browser artifacts. ## Verification