2023-10-09 16:23:24 +03:00
|
|
|
import { Page } from "@playwright/test";
|
2024-01-23 04:37:45 +03:00
|
|
|
|
2023-10-09 16:23:24 +03:00
|
|
|
import { getEditor } from "./getEditor";
|
|
|
|
|
|
|
|
export const testSelectBrain = async (page: Page): Promise<void> => {
|
|
|
|
const randomMessage = Math.random().toString(36).substring(7);
|
|
|
|
|
|
|
|
const editor = getEditor(page);
|
|
|
|
|
|
|
|
await editor.fill("@");
|
|
|
|
|
|
|
|
await page.getByText("Test brain").first().click();
|
|
|
|
|
|
|
|
await editor.fill(randomMessage);
|
|
|
|
|
|
|
|
await page.getByTestId("submit-button").click();
|
|
|
|
|
|
|
|
await page
|
|
|
|
.getByTestId("chat-message-text")
|
|
|
|
.getByText(`${randomMessage}`)
|
|
|
|
.isVisible();
|
|
|
|
|
|
|
|
await page.getByTestId("brain-tags").getByText("Test brain").isVisible();
|
|
|
|
};
|