2026-03-25 09:27:12 +08:00
|
|
|
import { expect, getTestImagePath, test } from "./helpers";
|
2026-03-22 19:28:57 +08:00
|
|
|
|
|
|
|
|
test.describe("Automate Page", () => {
|
2026-03-24 20:37:14 +08:00
|
|
|
// Retry flaky tests caused by dev server timing
|
|
|
|
|
test.describe.configure({ retries: 3 });
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Navigate to /automate and wait for the page to fully render.
|
|
|
|
|
* Uses multiple retry strategies for blank-page flakes.
|
|
|
|
|
*/
|
|
|
|
|
async function gotoAutomate(page: import("@playwright/test").Page) {
|
|
|
|
|
const heading = page.getByRole("heading", {
|
|
|
|
|
name: /automation pipeline/i,
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
for (let attempt = 0; attempt < 3; attempt++) {
|
|
|
|
|
if (attempt === 0) {
|
|
|
|
|
await page.goto("/automate", { waitUntil: "networkidle" });
|
|
|
|
|
} else {
|
|
|
|
|
// On retry, wait then reload
|
|
|
|
|
await page.waitForTimeout(500);
|
|
|
|
|
await page.goto("/automate", { waitUntil: "networkidle" });
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
await expect(heading).toBeVisible({ timeout: 8_000 });
|
|
|
|
|
return; // Page loaded successfully
|
|
|
|
|
} catch {
|
|
|
|
|
// Continue to next attempt
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2026-03-28 18:34:05 +08:00
|
|
|
// Final attempt - let it throw if it fails
|
2026-03-24 20:37:14 +08:00
|
|
|
await page.goto("/automate", { waitUntil: "networkidle" });
|
|
|
|
|
await expect(heading).toBeVisible({ timeout: 10_000 });
|
|
|
|
|
}
|
|
|
|
|
|
2026-03-28 18:34:05 +08:00
|
|
|
/** Wait for pipeline steps to render. */
|
2026-03-25 09:27:12 +08:00
|
|
|
async function waitForSteps(page: import("@playwright/test").Page, count: number) {
|
2026-03-24 20:37:14 +08:00
|
|
|
await expect(page.getByTitle("Remove")).toHaveCount(count, {
|
|
|
|
|
timeout: 5_000,
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
2026-03-28 18:34:05 +08:00
|
|
|
/** Open the tool picker, search for a tool by name, and click it. */
|
|
|
|
|
async function addToolStep(
|
|
|
|
|
page: import("@playwright/test").Page,
|
|
|
|
|
name: string,
|
|
|
|
|
expectedCount: number,
|
|
|
|
|
) {
|
|
|
|
|
await page.getByRole("button", { name: /add step/i }).click();
|
|
|
|
|
await expect(page.getByText("Add a step")).toBeVisible();
|
|
|
|
|
await page.getByPlaceholder("Search tools...").fill(name);
|
|
|
|
|
await page
|
|
|
|
|
.getByRole("button", { name: new RegExp(name, "i") })
|
|
|
|
|
.first()
|
|
|
|
|
.click();
|
|
|
|
|
await waitForSteps(page, expectedCount);
|
|
|
|
|
}
|
|
|
|
|
|
2026-03-24 20:37:14 +08:00
|
|
|
const testImagePath = getTestImagePath();
|
|
|
|
|
|
|
|
|
|
/** Upload the test image via file chooser. */
|
|
|
|
|
async function uploadTestFile(page: import("@playwright/test").Page) {
|
|
|
|
|
const fileChooserPromise = page.waitForEvent("filechooser");
|
2026-03-25 09:27:12 +08:00
|
|
|
await page.getByRole("button", { name: /upload image to process/i }).click();
|
2026-03-24 20:37:14 +08:00
|
|
|
const fileChooser = await fileChooserPromise;
|
|
|
|
|
await fileChooser.setFiles(testImagePath);
|
|
|
|
|
await page.waitForTimeout(500);
|
|
|
|
|
}
|
|
|
|
|
|
2026-03-28 18:34:05 +08:00
|
|
|
// --- Page Rendering ---
|
2026-03-24 20:37:14 +08:00
|
|
|
|
2026-03-25 09:27:12 +08:00
|
|
|
test("automate page renders pipeline builder", async ({ loggedInPage: page }) => {
|
2026-03-24 20:37:14 +08:00
|
|
|
await gotoAutomate(page);
|
2026-03-25 09:27:12 +08:00
|
|
|
await expect(page.getByText(/chain multiple tools/i).first()).toBeVisible();
|
2026-03-22 19:28:57 +08:00
|
|
|
});
|
|
|
|
|
|
2026-03-25 09:27:12 +08:00
|
|
|
test("shows empty state message when no steps", async ({ loggedInPage: page }) => {
|
2026-03-24 20:37:14 +08:00
|
|
|
await gotoAutomate(page);
|
2026-03-25 09:27:12 +08:00
|
|
|
await expect(page.getByText(/add steps to build your automation pipeline/i)).toBeVisible();
|
2026-03-22 19:28:57 +08:00
|
|
|
});
|
|
|
|
|
|
2026-03-24 20:37:14 +08:00
|
|
|
test("shows upload image button", async ({ loggedInPage: page }) => {
|
|
|
|
|
await gotoAutomate(page);
|
2026-03-25 09:27:12 +08:00
|
|
|
await expect(page.getByRole("button", { name: /upload image to process/i })).toBeVisible();
|
2026-03-24 20:37:14 +08:00
|
|
|
});
|
2026-03-22 19:28:57 +08:00
|
|
|
|
2026-03-24 20:37:14 +08:00
|
|
|
test("has Add Step button", async ({ loggedInPage: page }) => {
|
|
|
|
|
await gotoAutomate(page);
|
2026-03-25 09:27:12 +08:00
|
|
|
await expect(page.getByRole("button", { name: /add step/i })).toBeVisible();
|
2026-03-24 20:37:14 +08:00
|
|
|
});
|
|
|
|
|
|
2026-03-25 09:27:12 +08:00
|
|
|
test("has Process button (disabled when no steps or file)", async ({ loggedInPage: page }) => {
|
2026-03-24 20:37:14 +08:00
|
|
|
await gotoAutomate(page);
|
|
|
|
|
const processBtn = page.getByRole("button", {
|
|
|
|
|
name: "Process",
|
|
|
|
|
exact: true,
|
|
|
|
|
});
|
|
|
|
|
await expect(processBtn).toBeVisible();
|
|
|
|
|
await expect(processBtn).toBeDisabled();
|
|
|
|
|
});
|
|
|
|
|
|
2026-03-25 09:27:12 +08:00
|
|
|
test("has Save Pipeline button (disabled when no steps)", async ({ loggedInPage: page }) => {
|
2026-03-24 20:37:14 +08:00
|
|
|
await gotoAutomate(page);
|
|
|
|
|
const saveBtn = page.getByRole("button", { name: "Save Pipeline" });
|
2026-03-22 19:28:57 +08:00
|
|
|
await expect(saveBtn).toBeVisible();
|
2026-03-24 20:37:14 +08:00
|
|
|
await expect(saveBtn).toBeDisabled();
|
|
|
|
|
});
|
|
|
|
|
|
2026-03-28 18:34:05 +08:00
|
|
|
// --- Add Step ---
|
2026-03-24 20:37:14 +08:00
|
|
|
|
2026-03-25 09:27:12 +08:00
|
|
|
test("clicking Add Step opens tool picker", async ({ loggedInPage: page }) => {
|
2026-03-24 20:37:14 +08:00
|
|
|
await gotoAutomate(page);
|
|
|
|
|
await page.getByRole("button", { name: /add step/i }).click();
|
|
|
|
|
await expect(page.getByText("Add a step")).toBeVisible();
|
|
|
|
|
});
|
|
|
|
|
|
2026-03-25 09:27:12 +08:00
|
|
|
test("tool picker shows available tools", async ({ loggedInPage: page }) => {
|
2026-03-24 20:37:14 +08:00
|
|
|
await gotoAutomate(page);
|
|
|
|
|
await page.getByRole("button", { name: /add step/i }).click();
|
2026-03-28 18:34:05 +08:00
|
|
|
const pickerArea = page.locator(".max-h-80.overflow-y-auto");
|
2026-03-24 20:37:14 +08:00
|
|
|
await expect(pickerArea.getByText("Resize").first()).toBeVisible();
|
|
|
|
|
await expect(pickerArea.getByText("Convert").first()).toBeVisible();
|
|
|
|
|
});
|
|
|
|
|
|
2026-03-25 09:27:12 +08:00
|
|
|
test("selecting a tool from picker adds a step", async ({ loggedInPage: page }) => {
|
2026-03-24 20:37:14 +08:00
|
|
|
await gotoAutomate(page);
|
2026-03-28 18:34:05 +08:00
|
|
|
await addToolStep(page, "Resize", 1);
|
|
|
|
|
// Verify empty state is gone
|
|
|
|
|
await expect(page.getByText(/add steps to build your automation pipeline/i)).not.toBeVisible();
|
2026-03-24 20:37:14 +08:00
|
|
|
});
|
|
|
|
|
|
|
|
|
|
test("can add multiple steps", async ({ loggedInPage: page }) => {
|
|
|
|
|
await gotoAutomate(page);
|
2026-03-28 18:34:05 +08:00
|
|
|
await addToolStep(page, "Resize", 1);
|
|
|
|
|
await addToolStep(page, "Convert", 2);
|
2026-03-24 20:37:14 +08:00
|
|
|
});
|
|
|
|
|
|
2026-03-28 18:34:05 +08:00
|
|
|
test("can add resize, remove-background, then compress without drops", async ({
|
|
|
|
|
loggedInPage: page,
|
|
|
|
|
}) => {
|
|
|
|
|
await gotoAutomate(page);
|
|
|
|
|
await addToolStep(page, "Resize", 1);
|
|
|
|
|
await addToolStep(page, "Remove Background", 2);
|
|
|
|
|
await addToolStep(page, "Compress", 3);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
// --- Step Controls ---
|
2026-03-24 20:37:14 +08:00
|
|
|
|
|
|
|
|
test("can remove a step", async ({ loggedInPage: page }) => {
|
|
|
|
|
await gotoAutomate(page);
|
2026-03-28 18:34:05 +08:00
|
|
|
await addToolStep(page, "Resize", 1);
|
|
|
|
|
await addToolStep(page, "Compress", 2);
|
2026-03-24 20:37:14 +08:00
|
|
|
|
|
|
|
|
await page.getByTitle("Remove").first().click();
|
|
|
|
|
await waitForSteps(page, 1);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
test("can expand step settings", async ({ loggedInPage: page }) => {
|
|
|
|
|
await gotoAutomate(page);
|
2026-03-28 18:34:05 +08:00
|
|
|
await addToolStep(page, "Resize", 1);
|
|
|
|
|
// Adding a second step collapses the first (only one expanded at a time)
|
|
|
|
|
await addToolStep(page, "Compress", 2);
|
2026-03-24 20:37:14 +08:00
|
|
|
|
2026-03-28 18:34:05 +08:00
|
|
|
// Expand the first step's settings
|
2026-03-24 20:37:14 +08:00
|
|
|
await page.getByTitle("Settings").first().click();
|
2026-03-28 18:34:05 +08:00
|
|
|
await expect(page.getByText("Custom Size").first()).toBeVisible();
|
2026-03-24 20:37:14 +08:00
|
|
|
});
|
|
|
|
|
|
2026-03-25 09:27:12 +08:00
|
|
|
test("move up button disabled on first step", async ({ loggedInPage: page }) => {
|
2026-03-24 20:37:14 +08:00
|
|
|
await gotoAutomate(page);
|
2026-03-28 18:34:05 +08:00
|
|
|
await addToolStep(page, "Resize", 1);
|
|
|
|
|
await addToolStep(page, "Compress", 2);
|
2026-03-24 20:37:14 +08:00
|
|
|
|
|
|
|
|
await expect(page.getByTitle("Move up").first()).toBeDisabled();
|
|
|
|
|
});
|
|
|
|
|
|
2026-03-25 09:27:12 +08:00
|
|
|
test("move down button disabled on last step", async ({ loggedInPage: page }) => {
|
2026-03-24 20:37:14 +08:00
|
|
|
await gotoAutomate(page);
|
2026-03-28 18:34:05 +08:00
|
|
|
await addToolStep(page, "Resize", 1);
|
|
|
|
|
await addToolStep(page, "Compress", 2);
|
2026-03-24 20:37:14 +08:00
|
|
|
|
|
|
|
|
await expect(page.getByTitle("Move down").last()).toBeDisabled();
|
|
|
|
|
});
|
|
|
|
|
|
2026-03-28 18:34:05 +08:00
|
|
|
// --- File Upload ---
|
2026-03-24 20:37:14 +08:00
|
|
|
|
2026-03-25 09:27:12 +08:00
|
|
|
test("can upload a file via file chooser", async ({ loggedInPage: page }) => {
|
2026-03-24 20:37:14 +08:00
|
|
|
await gotoAutomate(page);
|
|
|
|
|
await uploadTestFile(page);
|
|
|
|
|
|
|
|
|
|
// File name and size should be visible in the upload area
|
|
|
|
|
await expect(page.getByText("test-image.png")).toBeVisible();
|
|
|
|
|
// The file size text is inside the dashed border area
|
|
|
|
|
const uploadArea = page.locator("[class*='border-dashed']").first();
|
|
|
|
|
await expect(uploadArea.getByText(/KB\)/)).toBeVisible();
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
test("can remove uploaded file", async ({ loggedInPage: page }) => {
|
|
|
|
|
await gotoAutomate(page);
|
|
|
|
|
await uploadTestFile(page);
|
|
|
|
|
await expect(page.getByText("test-image.png")).toBeVisible();
|
|
|
|
|
|
2026-03-28 18:34:05 +08:00
|
|
|
// Remove file - the X button inside the dashed upload area
|
2026-03-24 20:37:14 +08:00
|
|
|
const uploadArea = page.locator("[class*='border-dashed']").first();
|
|
|
|
|
await uploadArea.locator("button").click();
|
|
|
|
|
|
2026-03-25 09:27:12 +08:00
|
|
|
await expect(page.getByRole("button", { name: /upload image to process/i })).toBeVisible();
|
2026-03-24 20:37:14 +08:00
|
|
|
});
|
|
|
|
|
|
2026-03-28 18:34:05 +08:00
|
|
|
// --- Save Pipeline ---
|
2026-03-24 20:37:14 +08:00
|
|
|
|
2026-03-25 09:27:12 +08:00
|
|
|
test("Save Pipeline button enables after adding steps", async ({ loggedInPage: page }) => {
|
2026-03-24 20:37:14 +08:00
|
|
|
await gotoAutomate(page);
|
2026-03-28 18:34:05 +08:00
|
|
|
await addToolStep(page, "Resize", 1);
|
2026-03-24 20:37:14 +08:00
|
|
|
|
2026-03-25 09:27:12 +08:00
|
|
|
await expect(page.getByRole("button", { name: "Save Pipeline" })).toBeEnabled();
|
2026-03-24 20:37:14 +08:00
|
|
|
});
|
|
|
|
|
|
2026-03-25 09:27:12 +08:00
|
|
|
test("clicking Save Pipeline shows name input form", async ({ loggedInPage: page }) => {
|
2026-03-24 20:37:14 +08:00
|
|
|
await gotoAutomate(page);
|
2026-03-28 18:34:05 +08:00
|
|
|
await addToolStep(page, "Resize", 1);
|
2026-03-24 20:37:14 +08:00
|
|
|
|
|
|
|
|
await page.getByRole("button", { name: "Save Pipeline" }).click();
|
2026-03-25 09:27:12 +08:00
|
|
|
await expect(page.getByPlaceholder("Pipeline name")).toBeVisible();
|
2026-03-24 20:37:14 +08:00
|
|
|
});
|
|
|
|
|
|
2026-03-25 09:27:12 +08:00
|
|
|
test("Save button disabled when name is empty", async ({ loggedInPage: page }) => {
|
2026-03-24 20:37:14 +08:00
|
|
|
await gotoAutomate(page);
|
2026-03-28 18:34:05 +08:00
|
|
|
await addToolStep(page, "Resize", 1);
|
2026-03-24 20:37:14 +08:00
|
|
|
|
|
|
|
|
await page.getByRole("button", { name: "Save Pipeline" }).click();
|
|
|
|
|
const saveSubmitBtn = page.getByRole("button", {
|
|
|
|
|
name: "Save",
|
|
|
|
|
exact: true,
|
|
|
|
|
});
|
|
|
|
|
await expect(saveSubmitBtn).toBeDisabled();
|
|
|
|
|
});
|
|
|
|
|
|
2026-03-25 09:27:12 +08:00
|
|
|
test("can save a pipeline with name and see it in sidebar", async ({ loggedInPage: page }) => {
|
2026-03-24 20:37:14 +08:00
|
|
|
await gotoAutomate(page);
|
2026-03-28 18:34:05 +08:00
|
|
|
await addToolStep(page, "Resize", 1);
|
|
|
|
|
await addToolStep(page, "Compress", 2);
|
2026-03-24 20:37:14 +08:00
|
|
|
|
|
|
|
|
const uniqueName = `E2E Pipeline ${Date.now()}`;
|
|
|
|
|
await page.getByRole("button", { name: "Save Pipeline" }).click();
|
|
|
|
|
await page.getByPlaceholder("Pipeline name").fill(uniqueName);
|
2026-03-25 09:27:12 +08:00
|
|
|
await page.getByRole("button", { name: "Save", exact: true }).click();
|
2026-03-24 20:37:14 +08:00
|
|
|
|
|
|
|
|
// Wait for the pipeline to appear in sidebar
|
|
|
|
|
await expect(page.getByText(uniqueName).first()).toBeVisible({
|
|
|
|
|
timeout: 5_000,
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
|
2026-03-25 09:27:12 +08:00
|
|
|
test("can close save form without saving", async ({ loggedInPage: page }) => {
|
2026-03-24 20:37:14 +08:00
|
|
|
await gotoAutomate(page);
|
2026-03-28 18:34:05 +08:00
|
|
|
await addToolStep(page, "Resize", 1);
|
2026-03-24 20:37:14 +08:00
|
|
|
|
|
|
|
|
await page.getByRole("button", { name: "Save Pipeline" }).click();
|
2026-03-25 09:27:12 +08:00
|
|
|
await expect(page.getByPlaceholder("Pipeline name")).toBeVisible();
|
2026-03-24 20:37:14 +08:00
|
|
|
|
2026-03-28 18:34:05 +08:00
|
|
|
// Close the form - the last button in the save form row
|
2026-03-24 20:37:14 +08:00
|
|
|
const formRow = page.locator(".flex.items-center.gap-2.flex-1");
|
|
|
|
|
await formRow.locator("button").last().click();
|
|
|
|
|
|
2026-03-25 09:27:12 +08:00
|
|
|
await expect(page.getByRole("button", { name: "Save Pipeline" })).toBeVisible();
|
2026-03-24 20:37:14 +08:00
|
|
|
});
|
|
|
|
|
|
2026-03-28 18:34:05 +08:00
|
|
|
// --- Pipeline Execution ---
|
2026-03-24 20:37:14 +08:00
|
|
|
|
2026-03-25 09:27:12 +08:00
|
|
|
test("Process button enables when steps and file are set", async ({ loggedInPage: page }) => {
|
2026-03-24 20:37:14 +08:00
|
|
|
await gotoAutomate(page);
|
2026-03-28 18:34:05 +08:00
|
|
|
await addToolStep(page, "Compress", 1);
|
2026-03-24 20:37:14 +08:00
|
|
|
await uploadTestFile(page);
|
|
|
|
|
|
2026-03-25 09:27:12 +08:00
|
|
|
await expect(page.getByRole("button", { name: "Process", exact: true })).toBeEnabled();
|
2026-03-24 20:37:14 +08:00
|
|
|
});
|
|
|
|
|
|
2026-03-25 09:27:12 +08:00
|
|
|
test("executing pipeline shows success result", async ({ loggedInPage: page }) => {
|
2026-03-24 20:37:14 +08:00
|
|
|
await gotoAutomate(page);
|
2026-03-28 18:34:05 +08:00
|
|
|
await addToolStep(page, "Strip Metadata", 1);
|
|
|
|
|
await addToolStep(page, "Compress", 2);
|
2026-03-24 20:37:14 +08:00
|
|
|
await uploadTestFile(page);
|
|
|
|
|
|
2026-03-25 09:27:12 +08:00
|
|
|
await page.getByRole("button", { name: "Process", exact: true }).click();
|
2026-03-24 20:37:14 +08:00
|
|
|
|
|
|
|
|
// Wait for result (pipeline completed text)
|
2026-03-25 09:27:12 +08:00
|
|
|
await expect(page.getByText(/pipeline completed/i)).toBeVisible({ timeout: 30_000 });
|
2026-03-24 20:37:14 +08:00
|
|
|
|
|
|
|
|
// Should show original/processed sizes
|
|
|
|
|
await expect(page.getByText(/original/i)).toBeVisible();
|
|
|
|
|
await expect(page.getByText(/processed/i)).toBeVisible();
|
|
|
|
|
|
|
|
|
|
// Should show download button
|
2026-03-25 09:27:12 +08:00
|
|
|
await expect(page.getByRole("link", { name: /download result/i })).toBeVisible();
|
2026-03-24 20:37:14 +08:00
|
|
|
});
|
|
|
|
|
|
2026-03-28 18:34:05 +08:00
|
|
|
// --- Saved Pipeline Interactions ---
|
2026-03-24 20:37:14 +08:00
|
|
|
|
2026-03-25 09:27:12 +08:00
|
|
|
test("can load a saved pipeline into builder", async ({ loggedInPage: page }) => {
|
2026-03-24 20:37:14 +08:00
|
|
|
await gotoAutomate(page);
|
|
|
|
|
|
|
|
|
|
const uniqueName = `Load Pipeline ${Date.now()}`;
|
|
|
|
|
|
2026-03-28 18:34:05 +08:00
|
|
|
// Build and save a 2-step pipeline
|
|
|
|
|
await addToolStep(page, "Resize", 1);
|
|
|
|
|
await addToolStep(page, "Compress", 2);
|
2026-03-24 20:37:14 +08:00
|
|
|
|
|
|
|
|
await page.getByRole("button", { name: "Save Pipeline" }).click();
|
|
|
|
|
await page.getByPlaceholder("Pipeline name").fill(uniqueName);
|
2026-03-25 09:27:12 +08:00
|
|
|
await page.getByRole("button", { name: "Save", exact: true }).click();
|
2026-03-24 20:37:14 +08:00
|
|
|
await expect(page.getByText(uniqueName).first()).toBeVisible({
|
|
|
|
|
timeout: 5_000,
|
|
|
|
|
});
|
|
|
|
|
|
2026-03-28 18:34:05 +08:00
|
|
|
// Remove a step so we can tell loading worked
|
|
|
|
|
await page.getByTitle("Remove").first().click();
|
|
|
|
|
await waitForSteps(page, 1);
|
2026-03-24 20:37:14 +08:00
|
|
|
|
|
|
|
|
// Click on the saved pipeline to load it
|
2026-03-25 09:27:12 +08:00
|
|
|
await page.getByRole("button", { name: uniqueName }).first().click();
|
2026-03-28 18:34:05 +08:00
|
|
|
await waitForSteps(page, 2);
|
2026-03-24 20:37:14 +08:00
|
|
|
});
|
|
|
|
|
|
|
|
|
|
test("can delete a saved pipeline", async ({ loggedInPage: page }) => {
|
|
|
|
|
await gotoAutomate(page);
|
|
|
|
|
|
|
|
|
|
const uniqueName = `Delete Pipeline ${Date.now()}`;
|
|
|
|
|
|
2026-03-28 18:34:05 +08:00
|
|
|
// Build and save a pipeline
|
|
|
|
|
await addToolStep(page, "Resize", 1);
|
2026-03-24 20:37:14 +08:00
|
|
|
|
|
|
|
|
await page.getByRole("button", { name: "Save Pipeline" }).click();
|
|
|
|
|
await page.getByPlaceholder("Pipeline name").fill(uniqueName);
|
2026-03-25 09:27:12 +08:00
|
|
|
await page.getByRole("button", { name: "Save", exact: true }).click();
|
2026-03-24 20:37:14 +08:00
|
|
|
await expect(page.getByText(uniqueName).first()).toBeVisible({
|
|
|
|
|
timeout: 5_000,
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
// Hover to reveal delete, then click
|
2026-03-25 09:27:12 +08:00
|
|
|
const pipelineEntry = page.locator(".group").filter({ hasText: uniqueName }).first();
|
2026-03-24 20:37:14 +08:00
|
|
|
await pipelineEntry.hover();
|
|
|
|
|
await pipelineEntry
|
|
|
|
|
.locator("button")
|
|
|
|
|
.filter({ has: page.locator("svg") })
|
|
|
|
|
.last()
|
|
|
|
|
.click();
|
|
|
|
|
|
|
|
|
|
await expect(pipelineEntry).not.toBeVisible({ timeout: 5_000 });
|
|
|
|
|
});
|
|
|
|
|
|
2026-03-28 18:34:05 +08:00
|
|
|
// --- Sidebar ---
|
2026-03-24 20:37:14 +08:00
|
|
|
|
2026-03-25 09:27:12 +08:00
|
|
|
test("sidebar shows Saved Automations when pipelines exist", async ({ loggedInPage: page }) => {
|
2026-03-24 20:37:14 +08:00
|
|
|
await gotoAutomate(page);
|
2026-03-28 18:34:05 +08:00
|
|
|
await addToolStep(page, "Resize", 1);
|
2026-03-24 20:37:14 +08:00
|
|
|
|
|
|
|
|
const uniqueName = `Sidebar Pipeline ${Date.now()}`;
|
|
|
|
|
await page.getByRole("button", { name: "Save Pipeline" }).click();
|
|
|
|
|
await page.getByPlaceholder("Pipeline name").fill(uniqueName);
|
2026-03-25 09:27:12 +08:00
|
|
|
await page.getByRole("button", { name: "Save", exact: true }).click();
|
2026-03-24 20:37:14 +08:00
|
|
|
|
|
|
|
|
await expect(page.getByText("Saved Automations")).toBeVisible({
|
|
|
|
|
timeout: 5_000,
|
|
|
|
|
});
|
2026-03-22 19:28:57 +08:00
|
|
|
});
|
|
|
|
|
});
|