About Waiting For HTMX to Be Applied in Playwright Tests
Waiting for a load event in Playwright doesn't guarantee that HTMX has been applied when you want to trigger a click on a dynamic element. Here's how to wait for the HTMX to be applied to a DOM element:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
|
DOM elements with data-hx-*
or hx-*
attributes get the htmx-internal-data
property when htmx event handling is applied to them. That's how we can recognize that in Playwright tests.
Tips and Tricks Programming Testing Django 5.x Django 4.2 Django 3.2 htmx Playwright
Also by me
Django Paddle Subscriptions app
For Django-based SaaS projects.
Django GDPR Cookie Consent app
For Django websites that use cookies.