Delete app E2E (#313)
Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>
This commit is contained in:
28
e2e-tests/delete_app.spec.ts
Normal file
28
e2e-tests/delete_app.spec.ts
Normal file
@@ -0,0 +1,28 @@
|
||||
import fs from "fs";
|
||||
import { test } from "./helpers/test_helper";
|
||||
import { expect } from "@playwright/test";
|
||||
test("delete app", async ({ po }) => {
|
||||
await po.setUp();
|
||||
await po.sendPrompt("hi");
|
||||
const appName = await po.getCurrentAppName();
|
||||
if (!appName) {
|
||||
throw new Error("App name not found");
|
||||
}
|
||||
const appPath = await po.getCurrentAppPath();
|
||||
await po.getTitleBarAppNameButton().click();
|
||||
await expect(po.getAppListItem({ appName })).toBeVisible();
|
||||
|
||||
// Delete app
|
||||
await po.clickAppDetailsMoreOptions();
|
||||
// Open delete dialog
|
||||
await po.page.getByRole("button", { name: "Delete" }).click();
|
||||
// Confirm delete
|
||||
await po.page.getByRole("button", { name: "Delete App" }).click();
|
||||
|
||||
// Make sure the app is deleted
|
||||
await expect(async () => {
|
||||
expect(await po.getCurrentAppName()).toBe("(no app selected)");
|
||||
}).toPass();
|
||||
expect(fs.existsSync(appPath)).toBe(false);
|
||||
expect(po.getAppListItem({ appName })).not.toBeVisible();
|
||||
});
|
||||
Reference in New Issue
Block a user