carbon-tokenization / backend /e2e /publish.test.ts
tfrere's picture
tfrere HF Staff
test(backend): add Playwright E2E suite + deps for editor basics, chat persistence and publish
6a34a48
Raw
History Blame Contribute Delete
1.2 kB
/**
* E2E: Publish workflow.
*
* Validates: open publish dialog -> publish -> success feedback -> published HTML accessible.
*/
import { test, expect } from "./fixtures.js";
test.describe("Publish", () => {
test("publish creates accessible HTML page", async ({ appPage, serverUrl }) => {
// Wait for editor content to load
await appPage.waitForSelector("[aria-label='Undo']", { timeout: 15_000 });
// Open publish dialog
await appPage.click("[aria-label='Publish article']");
// Look for the publish button inside the dialog
const publishDialog = appPage.locator("dialog");
const publishButton = publishDialog.getByRole("button", { name: /publish/i });
await publishButton.click();
// Wait for success (the dialog should update or close)
await appPage.waitForSelector("text=Published", { timeout: 15_000 });
// Verify published HTML is accessible at /published/default/index.html
const response = await appPage.request.get(`${serverUrl}/published/default/index.html`);
expect(response.status()).toBe(200);
const html = await response.text();
expect(html).toContain("<!DOCTYPE html");
expect(html).toContain("</html>");
});
});