Skip to content

Commit

Permalink
refactor: improve test speed for Blog Writer integration
Browse files Browse the repository at this point in the history
  • Loading branch information
anovazzi1 authored and ogabrielluiz committed Nov 23, 2024
1 parent a670edd commit 593c318
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions src/frontend/tests/core/integrations/Blog Writer.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,17 @@ test("Blog Writer", async ({ page }) => {

while (modalCount === 0) {
await page.getByText("New Flow", { exact: true }).click();
await page.waitForTimeout(3000);
await page.waitForSelector('[data-testid="modal-title"]', {
timeout: 3000,
});
modalCount = await page.getByTestId("modal-title")?.count();
}

await page.getByTestId("side_nav_options_all-templates").click();
await page.getByRole("heading", { name: "Blog Writer" }).click();
await page.waitForTimeout(1000);
await page.waitForSelector('[data-testid="fit_view"]', {
timeout: 1000,
});

await page.getByTestId("fit_view").click();
await page.getByTestId("zoom_out").click();
Expand All @@ -50,14 +54,12 @@ test("Blog Writer", async ({ page }) => {

while (outdatedComponents > 0) {
await page.getByTestId("icon-AlertTriangle").first().click();
await page.waitForTimeout(1000);
outdatedComponents = await page.getByTestId("icon-AlertTriangle").count();
}

let filledApiKey = await page.getByTestId("remove-icon-badge").count();
while (filledApiKey > 0) {
await page.getByTestId("remove-icon-badge").first().click();
await page.waitForTimeout(1000);
filledApiKey = await page.getByTestId("remove-icon-badge").count();
}

Expand All @@ -71,7 +73,6 @@ test("Blog Writer", async ({ page }) => {
await page.getByTestId("dropdown_str_model_name").click();
await page.getByTestId("gpt-4o-1-option").click();

await page.waitForTimeout(1000);
await page
.getByTestId("inputlist_str_urls_0")
.nth(0)
Expand All @@ -90,7 +91,6 @@ test("Blog Writer", async ({ page }) => {
);

await page.getByTestId("button_run_chat output").click();
await page.waitForTimeout(5000);

await page.waitForSelector("text=built successfully", { timeout: 30000 });

Expand All @@ -107,8 +107,6 @@ test("Blog Writer", async ({ page }) => {
.last()
.isVisible();

await page.waitForTimeout(3000);

await page.getByText("turtles").last().isVisible();
await page.getByText("sea").last().isVisible();
await page.getByText("survival").last().isVisible();
Expand Down

0 comments on commit 593c318

Please sign in to comment.