mirror of
https://github.com/openclaw/clawhub.git
synced 2026-08-14 00:47:57 +00:00
- Enhanced AGENTS.md with clearer project structure and development commands. - Updated CHANGELOG.md to reflect recent fixes and additions. - Improved formatting in CONTRIBUTING.md for better readability. - Adjusted package.json and configuration files for consistent command structure. - Refined README.md and VISION.md for clarity and organization. - Standardized code formatting in various TypeScript files for consistency. These changes aim to enhance documentation clarity and maintainability across the repository.
49 lines
1.8 KiB
TypeScript
49 lines
1.8 KiB
TypeScript
import { stat } from "node:fs/promises";
|
|
import { expect, test } from "@playwright/test";
|
|
import { expectHealthyPage, trackRuntimeErrors } from "./helpers/runtimeErrors";
|
|
|
|
async function hasAuthStorageState() {
|
|
const path = process.env.PLAYWRIGHT_AUTH_STORAGE_STATE?.trim();
|
|
if (!path) return null;
|
|
try {
|
|
const file = await stat(path);
|
|
return file.isFile() ? path : null;
|
|
} catch {
|
|
return null;
|
|
}
|
|
}
|
|
|
|
test("authenticated upload preflight stays healthy", async ({ browser, baseURL }) => {
|
|
const storageState = await hasAuthStorageState();
|
|
test.skip(!storageState, "Set PLAYWRIGHT_AUTH_STORAGE_STATE to run authenticated smoke.");
|
|
if (!storageState) return;
|
|
|
|
const context = await browser.newContext({ baseURL, storageState });
|
|
const page = await context.newPage();
|
|
const errors = trackRuntimeErrors(page);
|
|
|
|
await page.goto("/upload?updateSlug=gifgrep", { waitUntil: "domcontentloaded" });
|
|
await expect(page.getByRole("heading", { name: /publish a skill/i })).toBeVisible();
|
|
await expect(page.locator("#slug")).toHaveValue("gifgrep");
|
|
await expectHealthyPage(page, errors);
|
|
|
|
await context.close();
|
|
});
|
|
|
|
test("authenticated import preflight stays healthy", async ({ browser, baseURL }) => {
|
|
const storageState = await hasAuthStorageState();
|
|
test.skip(!storageState, "Set PLAYWRIGHT_AUTH_STORAGE_STATE to run authenticated smoke.");
|
|
if (!storageState) return;
|
|
|
|
const context = await browser.newContext({ baseURL, storageState });
|
|
const page = await context.newPage();
|
|
const errors = trackRuntimeErrors(page);
|
|
|
|
await page.goto("/import", { waitUntil: "domcontentloaded" });
|
|
await expect(page.getByRole("heading", { name: "Import from GitHub" })).toBeVisible();
|
|
await expect(page.getByPlaceholder("owner/repo")).toBeVisible();
|
|
await expectHealthyPage(page, errors);
|
|
|
|
await context.close();
|
|
});
|