1.0.1 • Published 6 months ago
playdocs v1.0.1
Install Playdocs
run
npm install playdocs
Example usage in a test file:
// example.test.ts
import { playdocs } from "playwright-playdocs";
import { expect } from "@playwright/test";
const test = playdocs({
enabled: true,
defaultDuration: 2000,
});
test("example test", async ({ page, playdocs }) => {
await playdocs({
text: "Loading page",
metadata: { step: 1, category: "navigation" },
});
await page.goto("https://example.com");
await playdocs({
text: "Clicking login button",
duration: 4000,
metadata: { step: 2, category: "auth" },
});
await page.click("#login");
});
// Example playwright.config.ts configuration:
import { defineConfig } from "@playwright/test";
import { PlaydocsReporter } from "playwright-playdocs";
export default defineConfig({
reporter: [
["html"],
["playwright-playdocs/reporter", {}], // or pass config options here
],
use: {
video: "on",
},
});