ConusAI vendor v0.1.0-dev.20261027+9b1131fb
ci / gate (push) Waiting to run

This commit is contained in:
ConusAI vendor v0.1.0-dev.20261027+9b1131fb
2026-10-27 18:05:17 +00:00
commit 3102273ec7
538 changed files with 80203 additions and 0 deletions
+39
View File
@@ -0,0 +1,39 @@
// SPDX-License-Identifier: LicenseRef-ConusAI-Template-1.0
// Read-only browser smoke for a built image or a live deployment. No account is needed.
// pnpm exec playwright install chromium
// node scripts/verify-shell.mjs https://your-app.example.test
import { strict as assert } from "node:assert"
import { chromium, expect } from "@playwright/test"
const base = new URL(process.argv[2] ?? "http://127.0.0.1:3000")
assert(["http:", "https:"].includes(base.protocol), "expected an HTTP(S) app URL")
const browser = await chromium.launch()
try {
const context = await browser.newContext({ locale: "en-US" })
const page = await context.newPage()
page.setDefaultTimeout(15_000)
const errors = []
page.on("pageerror", (error) => errors.push(error.message))
const response = await page.goto(new URL("/", base).href, { waitUntil: "networkidle" })
assert.equal(response?.status(), 200)
const root = page.locator("html")
await page.getByRole("button", { name: "Theme: Dark", exact: true }).click()
await expect(root).toHaveClass("light")
await page.reload()
await expect(root).toHaveClass("light")
await page.getByRole("combobox", { name: /^Language/ }).selectOption("lt")
await expect(root).toHaveAttribute("lang", "lt")
await expect(page.getByRole("button", { name: "Tema: Šviesi", exact: true })).toBeVisible()
await page.reload()
await expect(root).toHaveAttribute("lang", "lt")
await expect(root).toHaveClass("light")
await page.getByRole("button", { name: "Tema: Šviesi", exact: true }).click()
await expect(root).not.toHaveClass("light")
await page.getByRole("combobox", { name: /^Kalba/ }).selectOption("en")
await expect(root).toHaveAttribute("lang", "en")
await expect(page.getByRole("button", { name: "Theme: Dark", exact: true })).toBeVisible()
assert.deepEqual(errors, [], "browser runtime errors")
console.log("verify-shell: theme and language switch both ways and persist across reloads")
} finally {
await browser.close()
}