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