test(e2e): smoke covers double-click dialog and label persistence
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import { test, expect } from "@playwright/test";
|
||||
|
||||
test("login → create workflow → drop node → save", async ({ page }) => {
|
||||
test("login → create workflow → drop node → edit in dialog → save → reload persists label", async ({ page }) => {
|
||||
await page.goto("/login");
|
||||
await page.getByLabel(/password/i).fill("hunter2");
|
||||
await page.getByRole("button", { name: /sign in/i }).click();
|
||||
@@ -20,8 +20,27 @@ test("login → create workflow → drop node → save", async ({ page }) => {
|
||||
await tile.dragTo(canvas);
|
||||
await expect(page.locator(".react-flow__node")).toHaveCount(1);
|
||||
|
||||
// Double-click the just-dropped node to open the editor dialog.
|
||||
const nodeEl = page.locator(".react-flow__node").first();
|
||||
await nodeEl.dblclick();
|
||||
|
||||
// Dialog appears with the three column headings.
|
||||
await expect(page.getByRole("heading", { name: /^input$/i })).toBeVisible();
|
||||
await expect(page.getByRole("heading", { name: /^parameters$/i })).toBeVisible();
|
||||
await expect(page.getByRole("heading", { name: /^output$/i })).toBeVisible();
|
||||
|
||||
// Edit the label to something distinctive.
|
||||
const label = page.getByLabel(/node label/i);
|
||||
await label.fill("Custom smoke node");
|
||||
|
||||
// Close the dialog with the Done button.
|
||||
await page.getByRole("button", { name: /^done$/i }).click();
|
||||
await expect(page.getByRole("heading", { name: /^parameters$/i })).not.toBeVisible();
|
||||
|
||||
await page.getByRole("button", { name: /save/i }).click();
|
||||
// No visible confirmation — reload and assert the node persisted.
|
||||
await page.reload();
|
||||
await expect(page.locator(".react-flow__node")).toHaveCount(1);
|
||||
// The canvas should show the custom label on the node.
|
||||
await expect(page.locator(".react-flow__node")).toContainText("Custom smoke node");
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user