Files
kandev/apps/web/e2e/tests/plugins/plugin-test-helpers.ts
T
Alassane 96c48d0517 feat(plugins): surface plugin update checks and manual updates (#2513)
Co-authored-by: ayattara <alassane.yattara@savoirfairelinux.com>
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
Co-authored-by: Carlos Florencio <carlosmflorencio@gmail.com>
2026-08-23 17:35:46 +00:00

28 lines
1.0 KiB
TypeScript

import path from "node:path";
import type { Page } from "@playwright/test";
import { expect } from "../../fixtures/test-base";
import type { ApiClient } from "../../helpers/api-client";
export const PLUGIN_ID = "kandev-plugin-e2e";
export const PACKAGE_PATH = path.resolve(
__dirname,
"../../../../../apps/backend/.build/kandev-plugin-e2e-1.0.0.tar.gz",
);
export async function openInstallDialog(page: Page) {
await page.goto("/settings/plugins");
await page.getByTestId("install-plugin-trigger").click();
await expect(page.getByTestId("install-plugin-dialog")).toBeVisible();
}
export async function uploadPackage(page: Page, filePath: string) {
await page.getByTestId("install-plugin-tab-upload").click();
await page.getByTestId("install-plugin-file-input").setInputFiles(filePath);
await page.getByTestId("install-plugin-upload-submit").click();
}
export async function uninstallPluginFixture(apiClient: ApiClient) {
await apiClient.rawRequest("DELETE", `/api/plugins/${PLUGIN_ID}`).catch(() => undefined);
}