Sure, you can use Playwright's trace viewer to ensure that canvases are rendered correctly. The trace viewer lets you inspect and debug your tests in UI mode.
In the Actions tab, you can see the locator used for each action and the time it took to run. Hover over each action to see the change in the DOM snapshot.
The Before and After tabs let you see what happened before and after an action.
The Metadata tab provides more information on your test, like the Browser, viewport size, test duration, and more.
To inspect the canvas element, click on the pop-out icon above the DOM snapshot to open it in its own window. From there, you can open up DevTools and inspect HTML, CSS, or Console logs.
If you need to compare multiple canvases on a page or debug them individually, you can do this with Playwright's trace viewer UI mode.
If CI failures occur, it's recommended to use Playwright's trace viewer instead of videos or screenshots. It provides a full trace of your tests as a local Progressive Web App (PWA) that can be easily shared. You can view network requests made during the rendering of canvas elements, which can help identify issues with rendering consistency across different environments or browsers.
If you still have questions, please ask a question and I will try to answer it.
Rayrun is a community for QA engineers. I am constantly looking for new ways to add value to people learning Playwright and other browser automation frameworks. If you have feedback, email [email protected].