How it works
After the setup, every time you run your Playwright tests, the @test2doc/playwright reporter will attempt to cleanup previously generated files and directories and automatically generate a new markdown file in your specified Docusaurus docs directory for each test file and/or top-level describe block found in your Playwright test files.
Using describe blocks
You can use Playwright describe function to add metadata and configure how the directory structure is generated for the Docusaurus output.
Test Steps
Test2Doc automatically captures and documents test steps defined using Playwright's test.step() function. These steps appear as text entries in your generated documentation, helping readers understand the test flow.
Screenshots
2 items
Inject Markdown
Test2Doc has a helper function to inject arbitrary markdown content into your documentation directly from your test steps.
Debugging Failing Doc Generation
Sometimes your tests might be passing, but failing when generating documentation. Here are some tips to help debug what is happening.
Versioning Your Docs
Docusaurus has built-in versioning support that lets you snapshot your documentation at a point in time, preserving the docs for a specific release while the current docs continue to evolve.