Import e2e (#311)
This commit is contained in:
45
e2e-tests/import.spec.ts
Normal file
45
e2e-tests/import.spec.ts
Normal 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 });
|
||||
});
|
||||
Reference in New Issue
Block a user