From 75ac0ce3293631d75e978a30f84ba1215d615e1b Mon Sep 17 00:00:00 2001 From: Sean Rankine Date: Thu, 3 Oct 2024 11:32:23 +0100 Subject: [PATCH] Add govuk-chat tests --- tests/chat.spec.js | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 tests/chat.spec.js diff --git a/tests/chat.spec.js b/tests/chat.spec.js new file mode 100644 index 0000000..2c643c4 --- /dev/null +++ b/tests/chat.spec.js @@ -0,0 +1,19 @@ +import { expect } from "@playwright/test"; +import { test } from "../lib/cachebust-test"; +import { publishingAppUrl } from "../lib/utils"; + +test.describe("GOV.UK Chat", { tag: ["@app-govuk-chat"] }, () => { + test("Can view a static page", async ({ page }) => { + await page.goto("/chat/about"); + await expect(page.getByRole("heading", { name: "About GOV.UK Chat" })).toBeVisible(); + }); +}); + +test.describe("GOV.UK Chat Admin", { tag: ["@app-govuk-chat"] }, () => { + test.use({ baseURL: publishingAppUrl("chat") }); + + test("Can log in to chat admin", async ({ page }) => { + await page.goto("/admin"); + await expect(page.getByRole("heading", { name: "GOV.UK Chat Admin" })).toBeVisible(); + }); +});