Skip to content

Commit ffd119c

Browse files
test: remove duplicate Playwright e2e coverage (langflow-ai#13819)
* test: remove duplicate test coverage (safe dedup) LE-1620 Tier 3 (phase A) - three duplicate-coverage removals, each verified to lose no unique assertion: Delete outdated-message.spec.ts: its only assertion (the "components need updates" banner) is identical to the first assertion of outdated-actions.spec.ts. output-modal-copy-button.spec.ts: drop the "JSON output from API Request component" sub-test (duplicated by copy-button-in-output.spec.ts); keep the text-output icon-state test. general-bugs-move-flow-from-folder.spec.ts: drop the happy-path "move flow from folder" test (covered more thoroughly by folders.spec.ts change-flow-folder); keep the unique stale-cache regression test. No coverage loss: each removed assertion has a home in a surviving test. Refs LE-1620 (Tier 3 / phase A) * test: fold minimize handle-visibility check into the 5-cycle test minimize.spec.ts checked a single minimize/expand cycle and uniquely asserted that the node connection handles get the no-show class. general-bugs-minimize-state-error already runs 5 cycles but only checked hide-node-content; this migrates the no-show handle assertion into its toggle helper, then deletes minimize.spec.ts. Refs LE-1620 (Tier 3 / C1) * test: merge store share-button test into generalBugs-shard-13 store-shard-2 and generalBugs-shard-13 both exercised share-on-canvas but checked different things: store-shard-2 validated the share modal contents (labels, public checkbox, category tags, name/description inputs); generalBugs-shard-13 checked idempotency (re-share + replace). Move the modal-validation test into generalBugs-shard-13 (guard adapted to skipIfMissing.storeApiKey + loadDotenvIfLocal), preserving every modal assertion. store-shard-2 keeps its filter-by-tag test. Refs LE-1620 (Tier 3 / M4) * test: actually trigger share before asserting success toast The store share test (moved here from store-shard-2 in this PR) asserted the "Flow shared successfully" toast without ever clicking the share confirm button, so it never exercised the real share. It went unnoticed because the test is STORE_API_KEY-gated and skipped in CI. Add the share-modal-button-flow click + replace handling after the modal validation, matching the existing share test. Refs LE-1620 (Tier 3 / M4 review) * test: assert modal checks instead of ignoring their booleans The API-keys warning and the public checkbox in the moved store share test called .isVisible()/.isChecked() but ignored the returned booleans, so they asserted nothing. Make them real web-first assertions. Pre-existing from store-shard-2; flagged in review. Refs LE-1620 (Tier 3 / M4 review)
1 parent ce71c72 commit ffd119c

7 files changed

Lines changed: 96 additions & 314 deletions

File tree

Lines changed: 0 additions & 86 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
import * as dotenv from "dotenv";
22
import path from "path";
33
import { expect, test } from "../../fixtures";
4-
import { awaitBootstrapTest } from "../../utils/await-bootstrap-test";
54
import { TEXTS } from "../../utils/constants/texts";
6-
import { renameFlow } from "../../utils/rename-flow";
75

86
test(
97
"should filter by tag",
@@ -69,87 +67,3 @@ test(
6967
await expect(page.getByText(TEXTS.templateBasicRag)).toBeVisible();
7068
},
7169
);
72-
73-
test("should share component with share button", async ({ page }) => {
74-
test.skip(
75-
!process?.env?.STORE_API_KEY,
76-
"STORE_API_KEY required to run this test",
77-
);
78-
79-
if (!process.env.CI) {
80-
dotenv.config({ path: path.resolve(__dirname, "../../.env") });
81-
}
82-
83-
await page.goto("/");
84-
await page.waitForTimeout(1000);
85-
86-
await page.getByTestId("button-store").click();
87-
await page.waitForTimeout(1000);
88-
89-
await page.getByTestId("api-key-button-store").click({
90-
timeout: 200000,
91-
});
92-
93-
await page
94-
.getByPlaceholder(TEXTS.placeholderApiKey)
95-
.fill(process.env.STORE_API_KEY ?? "");
96-
97-
await page.getByTestId("api-key-save-button-store").click();
98-
99-
await page.waitForTimeout(1000);
100-
await expect(page.getByText(TEXTS.toastApiKeySaved)).toBeVisible();
101-
await page.waitForSelector('[data-testid="sidebar-search-input"]', {
102-
timeout: 100000,
103-
});
104-
105-
await page.getByTestId("icon-ChevronLeft").first().click();
106-
107-
await awaitBootstrapTest(page, {
108-
skipGoto: true,
109-
});
110-
111-
await page.waitForTimeout(1000);
112-
113-
const randomName = Math.random().toString(36).substring(2);
114-
115-
await page.getByTestId("side_nav_options_all-templates").click();
116-
await page
117-
.getByRole("heading", { name: TEXTS.templateBasicPrompting })
118-
.click();
119-
120-
await renameFlow(page, { flowName: randomName });
121-
122-
await page.waitForSelector('[data-testid="shared-button-flow"]', {
123-
timeout: 100000,
124-
});
125-
126-
await page.getByTestId("shared-button-flow").first().click();
127-
await expect(page.getByText("Name:")).toBeVisible();
128-
await expect(page.getByText("Description:")).toBeVisible();
129-
await expect(page.getByText("Set workflow status to public")).toBeVisible();
130-
await page
131-
.getByText(
132-
"Attention: API keys in specified fields are automatically removed upon sharing.",
133-
)
134-
.isVisible();
135-
await expect(page.getByText("Export").first()).toBeVisible();
136-
await expect(page.getByText("Share Flow").first()).toBeVisible();
137-
await page.waitForTimeout(3000);
138-
139-
await expect(page.getByText("Agent").first()).toBeVisible();
140-
await expect(page.getByText("Memory").first()).toBeVisible();
141-
await expect(page.getByText("Chain").first()).toBeVisible();
142-
await expect(page.getByText("Vector Store").first()).toBeVisible();
143-
await expect(page.getByText("Prompt").last()).toBeVisible();
144-
await page.getByTestId("public-checkbox").isChecked();
145-
146-
const flowName = await page.getByTestId("input-flow-name").inputValue();
147-
const flowDescription = await page
148-
.getByPlaceholder("Flow description")
149-
.inputValue();
150-
await expect(page.getByText(flowName).last()).toBeVisible();
151-
await expect(page.getByText(flowDescription).last()).toBeVisible();
152-
await page.waitForTimeout(1000);
153-
154-
await expect(page.getByText("Flow shared successfully").last()).toBeVisible();
155-
});

src/frontend/tests/extended/features/minimize.spec.ts

Lines changed: 0 additions & 72 deletions
This file was deleted.

src/frontend/tests/extended/features/outdated-message.spec.ts

Lines changed: 0 additions & 46 deletions
This file was deleted.

src/frontend/tests/extended/features/output-modal-copy-button.spec.ts

Lines changed: 0 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -78,61 +78,4 @@ test.describe("Output Modal Copy Button", () => {
7878
).toBeVisible();
7979
},
8080
);
81-
82-
test(
83-
"copy button should work with JSON output from API Request component",
84-
{ tag: ["@release", "@workspace"] },
85-
async ({ page }) => {
86-
await openBlankFlow(page);
87-
88-
await page.waitForSelector('[data-testid="disclosure-data sources"]', {
89-
timeout: 3000,
90-
state: "visible",
91-
});
92-
93-
await page.getByTestId("disclosure-data sources").click();
94-
95-
await page
96-
.getByTestId("data_sourceAPI Request")
97-
.hover()
98-
.then(async () => {
99-
await page.getByTestId("add-component-button-api-request").click();
100-
101-
await page.waitForTimeout(500);
102-
103-
await page
104-
.getByTestId("popover-anchor-input-url_input")
105-
.first()
106-
.fill("https://httpbin.org/json");
107-
});
108-
109-
await page.getByTestId("button_run_api request").click();
110-
111-
await page.waitForSelector("text=Running", {
112-
timeout: 30000,
113-
state: "visible",
114-
});
115-
116-
await page.waitForSelector(`text=${TEXTS.toastBuiltSuccessfully}`, {
117-
timeout: 30000,
118-
});
119-
120-
await page
121-
.getByTestId("output-inspection-api response-apirequest")
122-
.click();
123-
124-
await page.waitForSelector("text=Component Output", { timeout: 30000 });
125-
126-
// Verify the copy button exists and click it
127-
const copyButton = page.getByTestId("copy-output-button");
128-
await expect(copyButton).toBeVisible();
129-
130-
await copyButton.click();
131-
132-
// Verify the success message appears
133-
await page.waitForSelector("text=Copied to clipboard", {
134-
timeout: 5000,
135-
});
136-
},
137-
);
13881
});

src/frontend/tests/extended/regression/general-bugs-minimize-state-error.spec.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,15 @@ async function toggleNodeState(page: Page, action: "minimize" | "expand") {
1313
expect(await page.getByTestId("hide-node-content").count()).toBe(
1414
expectedCount,
1515
);
16+
// Minimizing also hides the node's connection handles via the `.no-show`
17+
// class; expanding removes it. (Migrated from the former minimize.spec.ts.)
18+
if (action === "minimize") {
19+
await expect(page.locator(".react-flow__handle.no-show")).not.toHaveCount(
20+
0,
21+
);
22+
} else {
23+
await expect(page.locator(".react-flow__handle.no-show")).toHaveCount(0);
24+
}
1625
}
1726

1827
test(

src/frontend/tests/extended/regression/general-bugs-move-flow-from-folder.spec.ts

Lines changed: 0 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -3,59 +3,6 @@ import { awaitBootstrapTest } from "../../utils/await-bootstrap-test";
33
import { TEXTS } from "../../utils/constants/texts";
44
import { renameFlow } from "../../utils/rename-flow";
55

6-
test("user must be able to move flow from folder", async ({ page }) => {
7-
/* This is the original, happy-path regression: the destination
8-
* project is BRAND NEW and has never been observed by React Query,
9-
* so its `useGetFolder` cache doesn't exist and the first visit
10-
* after the drop triggers a fresh fetch. It exercises drag-and-drop
11-
* plumbing but does not exercise stale cache invalidation. */
12-
const randomName = Math.random().toString(36).substring(2, 15);
13-
14-
await awaitBootstrapTest(page);
15-
16-
await page.getByTestId("side_nav_options_all-templates").click();
17-
await page
18-
.getByRole("heading", { name: TEXTS.templateBasicPrompting })
19-
.click();
20-
21-
await page.waitForTimeout(2000);
22-
23-
await renameFlow(page, { flowName: randomName });
24-
25-
await page.waitForTimeout(2000);
26-
27-
await page.getByTestId("icon-ChevronLeft").click();
28-
await page.waitForSelector('[data-testid="add-project-button"]', {
29-
timeout: 3000,
30-
});
31-
32-
await page.getByTestId("add-project-button").click();
33-
34-
//wait for the project to be created and changed to the new project
35-
await page.waitForTimeout(2000);
36-
37-
await page.getByTestId("sidebar-nav-Starter Project").click();
38-
39-
await page.waitForTimeout(2000);
40-
41-
await page.getByText(randomName).hover();
42-
43-
await page
44-
.getByTestId("list-card")
45-
.first()
46-
.dragTo(page.locator('//*[@id="sidebar-nav-New Project"]'));
47-
48-
//wait for the drag and drop to be completed
49-
await page.waitForTimeout(2000);
50-
51-
await page.getByTestId("sidebar-nav-New Project").click();
52-
53-
await page.waitForSelector('[data-testid="list-card"]');
54-
55-
const flowNameCount = await page.getByText(randomName).count();
56-
expect(flowNameCount).toBeGreaterThan(0);
57-
});
58-
596
test("moved flow must appear when destination project was visited while still empty", async ({
607
page,
618
}) => {

0 commit comments

Comments
 (0)