mirror of
https://github.com/danswer-ai/danswer.git
synced 2025-09-19 20:24:32 +02:00
Update Chromatic Tests (#3300)
* remove / update search tests * minor update
This commit is contained in:
@@ -6,9 +6,9 @@ import { TEST_CREDENTIALS } from "./constants";
|
|||||||
setup("authenticate", async ({ page }) => {
|
setup("authenticate", async ({ page }) => {
|
||||||
const { email, password } = TEST_CREDENTIALS;
|
const { email, password } = TEST_CREDENTIALS;
|
||||||
|
|
||||||
await page.goto("http://localhost:3000/search");
|
await page.goto("http://localhost:3000/chat");
|
||||||
|
|
||||||
await page.waitForURL("http://localhost:3000/auth/login?next=%2Fsearch");
|
await page.waitForURL("http://localhost:3000/auth/login?next=%2Fchat");
|
||||||
|
|
||||||
await expect(page).toHaveTitle("Danswer");
|
await expect(page).toHaveTitle("Danswer");
|
||||||
|
|
||||||
@@ -18,7 +18,7 @@ setup("authenticate", async ({ page }) => {
|
|||||||
// Click the login button
|
// Click the login button
|
||||||
await page.click('button[type="submit"]');
|
await page.click('button[type="submit"]');
|
||||||
|
|
||||||
await page.waitForURL("http://localhost:3000/search");
|
await page.waitForURL("http://localhost:3000/chat");
|
||||||
|
|
||||||
await page.context().storageState({ path: "admin_auth.json" });
|
await page.context().storageState({ path: "admin_auth.json" });
|
||||||
});
|
});
|
||||||
|
@@ -8,12 +8,20 @@ test(
|
|||||||
async ({ page }, testInfo) => {
|
async ({ page }, testInfo) => {
|
||||||
// Test simple loading
|
// Test simple loading
|
||||||
await page.goto("http://localhost:3000/chat");
|
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(
|
// Check for the "General" text in the new UI element
|
||||||
/text-text-application-untoggled/
|
await expect(
|
||||||
);
|
page.locator("div.flex.items-center span.font-bold")
|
||||||
await expect(page.getByRole("button", { name: "Chat D" })).toHaveClass(
|
).toHaveText("General");
|
||||||
/text-text-application-toggled/
|
|
||||||
);
|
// Check for the presence of the new UI element
|
||||||
|
await expect(
|
||||||
|
page.locator("div.flex.justify-center div.bg-black.rounded-full")
|
||||||
|
).toBeVisible();
|
||||||
|
|
||||||
|
// Check for the SVG icon
|
||||||
|
await expect(
|
||||||
|
page.locator("div.flex.justify-center svg.w-5.h-5")
|
||||||
|
).toBeVisible();
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
@@ -12,9 +12,9 @@ test(
|
|||||||
// Test redirect to login, and redirect to search after login
|
// Test redirect to login, and redirect to search after login
|
||||||
const { email, password } = TEST_CREDENTIALS;
|
const { email, password } = TEST_CREDENTIALS;
|
||||||
|
|
||||||
await page.goto("http://localhost:3000/search");
|
await page.goto("http://localhost:3000/chat");
|
||||||
|
|
||||||
await page.waitForURL("http://localhost:3000/auth/login?next=%2Fsearch");
|
await page.waitForURL("http://localhost:3000/auth/login?next=%2Fchat");
|
||||||
|
|
||||||
await expect(page).toHaveTitle("Danswer");
|
await expect(page).toHaveTitle("Danswer");
|
||||||
|
|
||||||
@@ -26,6 +26,6 @@ test(
|
|||||||
// Click the login button
|
// Click the login button
|
||||||
await page.click('button[type="submit"]');
|
await page.click('button[type="submit"]');
|
||||||
|
|
||||||
await page.waitForURL("http://localhost:3000/search");
|
await page.waitForURL("http://localhost:3000/chat");
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
@@ -1,19 +0,0 @@
|
|||||||
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/
|
|
||||||
);
|
|
||||||
}
|
|
||||||
);
|
|
Reference in New Issue
Block a user