-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
29 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,24 @@ | ||
import { test, expect } from "@chromatic-com/playwright"; | ||
import { test, expect } from "@playwright/test"; | ||
|
||
test( | ||
"Chat", | ||
{ | ||
tag: "@admin", | ||
}, | ||
async ({ page }, testInfo) => { | ||
// Test simple loading | ||
await page.goto("http://localhost:3000/chat"); | ||
|
||
// Check for the "General" text in the new UI element | ||
await expect( | ||
page.locator("div.flex.items-center span.font-bold") | ||
).toHaveText("General"); | ||
|
||
// 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(); | ||
} | ||
); | ||
test("test", async ({ page }) => { | ||
await page.goto("http://localhost:3000/chat"); | ||
await page.hover("body", { position: { x: 0, y: 100 } }); | ||
await page.getByRole("link", { name: "Manage Assistants" }).click(); | ||
await expect(page).toHaveURL("http://localhost:3000/assistants/mine"); | ||
await page.getByRole("button", { name: "Create New Assistant" }).click(); | ||
await expect(page).toHaveURL("http://localhost:3000/assistants/new"); | ||
await page.getByTestId("name").click(); | ||
await page.getByTestId("name").fill("Test"); | ||
await page.getByTestId("description").click(); | ||
await page.getByTestId("description").fill("Test"); | ||
await page.getByTestId("system_prompt").click(); | ||
await page.getByTestId("system_prompt").fill("Test"); | ||
await page.getByRole("button", { name: "Logo GPT 4o", exact: true }).click(); | ||
await page.getByRole("button", { name: "Create!" }).click(); | ||
await page.waitForURL("http://localhost:3000/chat"); | ||
await expect(page).toHaveURL("http://localhost:3000/chat"); | ||
await page.getByPlaceholder("Send a message or try using").click(); | ||
await page.getByPlaceholder("Send a message or try using").fill("Hello"); | ||
await expect(page.locator("#danswer-ai-message")).toBeVisible(); | ||
await page.locator("#danswer-human-message").click(); | ||
}); |