JavaScript in Tests
Assrt lets tests drop into JavaScript for escape-hatch cases: reading computed state, interacting with third-party widgets that expose a JS API, or feeding custom data into the page.
Inline snippets
yaml
- javascript:
code: |
return window.__APP__.featureFlags;
as: flagsExternal files
For longer helpers, extract the snippet to a file and reference it from the step.
yaml
- javascript:
file: ./tests/helpers/seed-cart.js
args:
items: 3
total: 42.00