Refactor API generation tests
This commit is contained in:
parent
a3924d657c
commit
76dbaf3b21
5 changed files with 104 additions and 84 deletions
|
|
@ -1,17 +1,17 @@
|
|||
import { test, expect } from '@playwright/test';
|
||||
import { expect, test } from "@playwright/test";
|
||||
|
||||
|
||||
test('python_api_generation', async ({ page,context }) => {
|
||||
test("python_api_generation", async ({ page, context }) => {
|
||||
await page.goto("/");
|
||||
await page.locator('//*[@id="new-project-btn"]').click();
|
||||
await context.grantPermissions(["clipboard-read", "clipboard-write"]);
|
||||
await page.getByRole('heading', { name: 'Data Ingestion' }).click();
|
||||
await page.getByRole("heading", { name: "Data Ingestion" }).click();
|
||||
await page.waitForTimeout(2000);
|
||||
await page.getByText('API', { exact: true }).click();
|
||||
await page.getByRole('tab', { name: 'Python API' }).click();
|
||||
await page.getByRole('button', { name: 'Copy Code' }).click();
|
||||
const handle = await page.evaluateHandle(() => navigator.clipboard.readText());
|
||||
await page.getByText("API", { exact: true }).click();
|
||||
await page.getByRole("tab", { name: "Python API" }).click();
|
||||
await page.getByRole("button", { name: "Copy Code" }).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