From e108125e9b87c479d3b14af04d6e99e88ad80e1f Mon Sep 17 00:00:00 2001 From: "Richard Kuo (Danswer)" Date: Wed, 20 Nov 2024 18:15:56 -0800 Subject: [PATCH] test search and chat --- web/tests/e2e/chat.spec.ts | 19 +++++++++++++++++++ web/tests/e2e/search.spec.ts | 19 +++++++++++++++++++ 2 files changed, 38 insertions(+) create mode 100644 web/tests/e2e/chat.spec.ts create mode 100644 web/tests/e2e/search.spec.ts diff --git a/web/tests/e2e/chat.spec.ts b/web/tests/e2e/chat.spec.ts new file mode 100644 index 00000000000..e1e720f3dfd --- /dev/null +++ b/web/tests/e2e/chat.spec.ts @@ -0,0 +1,19 @@ +import { test, expect } from "@chromatic-com/playwright"; + +test( + "Chat", + { + tag: "@admin", + }, + async ({ page }, testInfo) => { + // Test simple loading + await page.goto("http://localhost:3000/chat"); + await expect(page.locator("div.text-2xl").nth(0)).toHaveText("General"); + await expect(page.getByRole("button", { name: "Search S" })).toHaveClass( + /text-text-application-untoggled/ + ); + await expect(page.getByRole("button", { name: "Chat D" })).toHaveClass( + /text-text-application-toggled/ + ); + } +); diff --git a/web/tests/e2e/search.spec.ts b/web/tests/e2e/search.spec.ts new file mode 100644 index 00000000000..2b4a212479e --- /dev/null +++ b/web/tests/e2e/search.spec.ts @@ -0,0 +1,19 @@ +import { test, expect } from "@chromatic-com/playwright"; + +test( + "Search", + { + tag: "@admin", + }, + async ({ page }, testInfo) => { + // Test simple loading + await page.goto("http://localhost:3000/search"); + await expect(page.locator("div.text-3xl")).toHaveText("Unlock Knowledge"); + await expect(page.getByRole("button", { name: "Search S" })).toHaveClass( + /text-text-application-toggled/ + ); + await expect(page.getByRole("button", { name: "Chat D" })).toHaveClass( + /text-text-application-untoggled/ + ); + } +);