Import e2e (#311)

This commit is contained in:
Will Chen
2025-06-02 21:39:51 -07:00
committed by GitHub
parent 4997a8f2ff
commit 667fc42af4
31 changed files with 2513 additions and 3 deletions

45
e2e-tests/import.spec.ts Normal file
View File

@@ -0,0 +1,45 @@
import path from "path";
import { test } from "./helpers/test_helper";
import * as eph from "electron-playwright-helpers";
test("import app", async ({ po }) => {
await po.setUp();
await po.page.getByRole("button", { name: "Import App" }).click();
await eph.stubDialog(po.electronApp, "showOpenDialog", {
filePaths: [path.join(__dirname, "fixtures", "import-app", "minimal")],
});
await po.page.getByRole("button", { name: "Select Folder" }).click();
await po.page.getByRole("textbox", { name: "Enter new app name" }).click();
await po.page
.getByRole("textbox", { name: "Enter new app name" })
.fill("minimal-imported-app");
await po.page.getByRole("button", { name: "Import" }).click();
await po.snapshotPreview();
await po.snapshotMessages();
});
test("import app with AI rules", async ({ po }) => {
await po.setUp();
await po.page.getByRole("button", { name: "Import App" }).click();
await eph.stubDialog(po.electronApp, "showOpenDialog", {
filePaths: [
path.join(__dirname, "fixtures", "import-app", "minimal-with-ai-rules"),
],
});
await po.page.getByRole("button", { name: "Select Folder" }).click();
await po.page.getByRole("textbox", { name: "Enter new app name" }).click();
await po.page
.getByRole("textbox", { name: "Enter new app name" })
.fill("minimal-imported-app");
await po.page.getByRole("button", { name: "Import" }).click();
await po.snapshotPreview();
await po.sendPrompt("[dump]");
await po.snapshotServerDump();
await po.snapshotMessages({ replaceDumpPath: true });
});