Skip to content

Commit

Permalink
Make tests run only in suitable environments
Browse files Browse the repository at this point in the history
GOV.UK Chat is not yet available in production and service.gov.uk
redirects aren't configured in staging and integration.
  • Loading branch information
theseanything committed Oct 21, 2024
1 parent 167143f commit f35ecd7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion tests/cdn.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ test.describe("CDN", { tag: ["@domain-www"] }, () => {
expect(response.headers()["location"]).toBe(expectedURL);
});

test("redirect service domain to www domain", { tag: ["@production"] }, async ({ page }) => {
test("redirect service domain to www domain", { tag: ["@not-staging", "@not-integration"] }, async ({ page }) => {
const response = await page.request.get("https://service.gov.uk", { maxRedirects: 0 });
expect(response.status()).toBe(302);
expect(response.headers()["location"]).toBe("https://www.gov.uk");
Expand Down
2 changes: 1 addition & 1 deletion tests/chat.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ 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.describe("GOV.UK Chat", { tag: ["@app-govuk-chat", "@not-production"] }, () => {
test("Can view a static page", async ({ page }) => {
await page.goto("/chat/about");
await expect(page.getByRole("heading", { name: "About GOV.UK Chat" })).toBeVisible();
Expand Down

0 comments on commit f35ecd7

Please sign in to comment.