(codeAreaModalComponent.spec.ts): comment out unused code and remove unused import to improve code readability and maintainability

 (store.spec.ts): add a delay before selecting the "Alphabetical" option to ensure the dropdown is fully loaded before interacting with it
This commit is contained in:
cristhianzl 2024-04-19 15:51:19 -03:00
commit 00b7bbae3c
2 changed files with 11 additions and 6 deletions

View file

@ -1,4 +1,4 @@
import { expect, test } from "@playwright/test";
import { test } from "@playwright/test";
test("CodeAreaModalComponent", async ({ page }) => {
await page.goto("/");
@ -63,16 +63,20 @@ class PythonFunctionComponent(CustomComponent):
await page.locator("textarea").press("Control+a");
await page.locator("textarea").fill(wCode);
await page.locator('//*[@id="checkAndSaveBtn"]').click();
await page.waitForTimeout(1000);
// expect(
// await page.getByText("invalid syntax (<unknown>, line 1)").isVisible()
// ).toBeTruthy();
await page.locator("textarea").press("Control+a");
await page.locator("textarea").fill(wCode);
await page.locator("textarea").fill(customComponentCode);
await page.locator('//*[@id="checkAndSaveBtn"]').click();
await page.waitForTimeout(1000);
await page.getByTestId("code-button-modal").click();
const inputCodeValue = await page
.locator('//*[@id="codeValue"]')
.inputValue();
// await page.getByTestId("code-button-modal").click();
// const inputCodeValue = await page
// .locator('//*[@id="codeValue"]')
// .inputValue();
expect(inputCodeValue).toContain("def python_function(text: str) -> str");
// expect(inputCodeValue).toContain("def python_function(text: str) -> str");
});

View file

@ -75,6 +75,7 @@ test("should order the visualization", async ({ page }) => {
await page.getByText("Basic RAG").isVisible();
await page.getByTestId("select-order-store").click();
await page.waitForTimeout(2000);
await page.getByText("Alphabetical").click();
await page.getByText("Album Cover Builder").isVisible();