So tried the new Playwright testing, doesn't seem ...
# webassembly
c
So tried the new Playwright testing, doesn't seem to support wasm right now: https://youtrack.jetbrains.com/issue/KT-87082
🧑‍🍳 1
😞 1
k
this is normal because wasm is rendered on a single element like canvas, But there's a workaround ! When a screen reader (or an automation tool) connects to the browser, Compose generates an invisible Accessibility DOM Tree behind the canvas. It injects transparent, empty HTML elements matching the positions of your Compose buttons and text fields so a blind user's screen reader can read them. You can use Playwright to target this hidden tree right now, but it requires a very specific approach: • You cannot use standard visual selectors like CSS classes or IDs (as they don't exist). • You can use ARIA role selectors, which tap directly into that accessibility tree. The Code (What works today in Playwright):
Copy code
// Instead of looking for a class or ID, you look for the accessibility "Role"
// Compose wasmJs maps an internal Button component to an accessible 'button' role
await page.getByRole('button', { name: 'Login' }).click();
for future: JetBrains and the Google Chrome team are working on exposing the internal composition tree of frameworks directly to the browser's debugging protocols.
c
nothing that complex, it just doesnt support esmodules
😞 1
k
ahh I see, legacy CommonJS issues
c
although the lack of dom tree for accessabilty and autofill is crap
k
same for selenium, out of luck for now ...... but Native "HTML-in-Canvas" API is already in Chrome Canary, when Jetbrains probably integrates this support before end of 2026 automations should start working with proper support in canvas as well things are moving
c
Oh that would be nice, wasm testing is so slow and flakey, probably have more test harness than tests on the web side lol