fix tests on CI
This commit is contained in:
parent
f1aa857ae1
commit
694fa549dd
36 changed files with 36 additions and 9 deletions
30
src/frontend/tests/end-to-end/python_api_generation.spec.ts
Normal file
30
src/frontend/tests/end-to-end/python_api_generation.spec.ts
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
import { expect, test } from "@playwright/test";
|
||||
|
||||
test("python_api_generation", async ({ page, context }) => {
|
||||
await page.goto("/");
|
||||
let modalCount = 0;
|
||||
try {
|
||||
const modalTitleElement = await page?.getByTestId("modal-title");
|
||||
if (modalTitleElement) {
|
||||
modalCount = await modalTitleElement.count();
|
||||
}
|
||||
} catch (error) {
|
||||
modalCount = 0;
|
||||
}
|
||||
|
||||
while (modalCount === 0) {
|
||||
await page.getByText("New Project", { exact: true }).click();
|
||||
await page.waitForTimeout(5000);
|
||||
modalCount = await page.getByTestId("modal-title")?.count();
|
||||
}
|
||||
await page.getByRole("heading", { name: "Basic Prompting" }).click();
|
||||
await page.waitForTimeout(2000);
|
||||
await page.getByText("API", { exact: true }).click();
|
||||
await page.getByRole("tab", { name: "Python API" }).click();
|
||||
await page.getByTestId("icon-Copy").click();
|
||||
const handle = await page.evaluateHandle(() =>
|
||||
navigator.clipboard.readText(),
|
||||
);
|
||||
const clipboardContent = await handle.jsonValue();
|
||||
expect(clipboardContent.length).toBeGreaterThan(0);
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue