View Source Changelog
Noteworthy changes are included here. For a full version of changes, see git history.
To see dates a version was published, see the hex package page
0.8.2
Fixes
- Fix: keep provided selector in
click_button/397f664d
0.8.1
Fixes
0.8.0
Improvements
Support LiveView 1.1 (9ced344), and replace Floki with LazyHTML (c6c2483, 1c45a80)
Add credo NoOpenBrowser check b1add28
Support phx-value and JS command values with uncheck 63c0c2a
Fixes
- Preserve order of appearance for array inputs 5fd0f32
0.7.1
Improvements
- Updated deps versions (Phoenix 1.8 support) 03fb661
- Use Floki 0.38 and fix deprecations 26575bc, c479154
Fixes
- Fix phx-trigger-action handling for dynamically rendered forms fe5e986
- Fix:
assert_pathhandles nested query params 6a56cf9
0.7.0
Potentially breaking change
- If you test uploads. PhoenixTest will now automatically trigger
phx-changeonupload. If you were previously triggeringphx-changeafter yourupload, you might now get duplicatephx-changeevents. See PR #162 or commit 8edd7b4 for more information.
New
- Adds: asserting by value and label (#204). Commit 515242d
- Adds asserting & refuting by
:value(#199). Commit 6271e81
Improvements
- Allow
JS.patchinphx-clickbindings. Commit 6012517 - Handles LiveView forms that remove elements (#202). Commit 6f610f2
- Allow empty maps to be passed into
assert_pathasquery_params(#196). Commit 04ca498 assert_pathhandles query params with [] (#195). Commit ac52f8b- Include simple
phx-*attributes in selectors (#193). Commit a327ccf
Fixes
- Do not raise non-existent path if URL is external (#206). Commits 891733f
- Pass the original filter text from
click_button/2when callingclick_button/3(#222). Commit dc17378 - Fix: Find select nested in label (#210). Commit 450ad7d
- return empty value for button if name is present and no value is found (#220). Commit 45ee501
- Use Jason instead of native JSON to support < 1.18. Commit 632a5c6
- Fix: pass view to assert_redirect. Commit 2b73714
- Fix: Handle prefilled values for type=email etc. Commit ec4440d
- Test all "simple-value" input defaults. Commit 45b62ca
- Check local path's endpoint at runtime to fix warning. Commit 1dbf12e
0.6.0
Breaking changes & deprecations
- (potentially breaking) Raise error when visiting an defined route. Commit 668448a
- Deprecate select with
:fromin favor of:option(#191). Commit 071c3f3
For a more detailed explanation, see the Upgrade guides
Improvements
Simplify timeout logic. Attempt faster checks. Commits 24b31e5, a053b51, d17baef, 1819f52, 1182dba
Allow nesting of
within/3(#189). Commit 94c716fAllow calling
visit/2sequentially. Commit 230c6a1Include default email input fields in form data (#180). Commit 5e36c09
Add mix benchmark alias to run benchmarks. Commit 0642aeb
Support role="button" for
click_button/2. Commit 1dec249Document reason behind
fill_inneeding a label (#188). Commit 74732abDocs: Mention playwright driver (#179). Commit 7619257
Fixes
- Fix documentation typo on docs. Commit 756cc4c
- Throw nice error messages for
render_uploaderrors (#177). Commit a1cf133
0.5.2
Improvements
Allow wildcards in
assert_path(#163). Commit aec2a0dAdd assertion benchmarks (#165). Commit 549cd49
Improve
:timeoutimplementation for assertion helpers.
Fixes
- Catch exits when checking async pids. Commit 7f34790
- Use LiveView.Channel to fetch async pids. Commit 8721948
Docs
0.5.1
Fixes
- Fix race condition. Ping LiveView instead of using "buffer". Commit 3d78969
0.5.0
Added
Adds
assert_has/3|refute_has/3:timeoutoption Commit 7cb6a41.- Support phx-trigger-action. Commit f46ebc1.
Improvements
- Allow LiveView 1.0. Commit 6e121c8.
- Allow labels to have line breaks. Commit 5949951.
- Make all functions part of the
Driverprotocol to allow for external drivers. Commits 8c9e3be, af5d011, ef3fca0. - Raise error if implicit + explicit label found. Commit 9502fc7.
Fixes
- Keep flash across Live -> Static redirects. Commit ca7edf5.
- Make sure live redirect copy headers. Commit ce490d3.
- Don't fail form when present disabled select. Commit 14b7bf0.
- Update current path on static submit. Commit 46d30bb.
0.4.2
Fixes
- Fix: do not recycle fresh conn. Commit 24192e2
0.4.1
Added
Fixes
- 🛠️ Fix active form vs form data loading . Commit 37302b9
- Update
phx_click?to check for valid JS commands. Commit 0d54b49 - Deduplicate data passed to FormPayload (multi checkbox fix). Commit e950ae4
0.4.0
Breaking
Select options were previously matched inexactly (as a substring match). That made it impossible to differentiate between two options where one was a subset of the other.
For example, using
select(session, "Email", from: "Contact")could not differentiate between theEmailandEmail and SMSoptions. Select options are now matched exactly. Commits dc7ba01 and e675561.This is a technically a bug fix, but it's also a potentially breaking change for existing tests that accidentally relied on that behavior. If you need inexact matches on options, please open an issue describing your use case.
Added
- Adds
PhoenixTest.upload/3to test file uploads. Commit d717970 - ✨ Form helpers now take
:exactoption. Commits c4f9164 and cb19f86 - Form helpers now allow passing CSS selectors to target inputs. Commits 30b4eca, 12934b8, bd595f8, 250e25e, ef2999e
Improvements
- Raise nice error if field is missing
nameattribute. Commit bb6950f - Docs: Add syntax highlighting for heex and html. Commit e308f9f
Fixes
- Ignore
phx-*attrs when inferring selector. Commit b5d28c8 - Don't error on default form input without name attribute. Commit 3bd6d7a
0.3.2
Added
- Check/uncheck works with phx-click outside forms. Commit 82fa973
- Select works with phx-click outside forms. Commit 1493897
- Radio buttons work with phx-click outside forms. Commit 8745ee1
Improvements
- Send
_targetevent with phx-change events. Commit ce093f1 - Use
[id=<id>]when querying by ID. Commits 5dd10f5 and b79e8a3 - Allow non-string data types as inputs to fields. Commit 5cc0936
- Support default values on textareas. Commit 41c70e0
Fixes
- Fix
refute_has/2to handle:atoption withouttext. Commit 33a02bf
0.3.1
Improvements
- Do not assume first option to be selected by default for multiple select. Commit f146186
- Handle multiple select in forms. Commit 6b6512d
- Support pre-filled number inputs. Commit 81f03aa
Fixes
- Fix
open_browser/1doc example. Commit 8f39959 - Deep merge form data in nested/prefixed forms. Commit 34b73b0
- Fix uncheck/2 in nested forms. Commit e1a2408
- Fix: Preserve '?' in checkbox name. Commit 2e032ef
- Fix: Deep merge nested form button value (static). Commit 4303b4a
0.3.0
Added
- Adds
PhoenixTest.unwrap/2as an escape hatch. Commit 87be9c5.
Improvements
- We now handle redirects on
phx-changeevents. Commit cf1687c. - Click button can submit forms when not nested in form. Commit e173f5b.
Fixes
- Fix
assert_pathlive navigation with query params. Commit 6c58f27.
Removed
- Removes deprecated
fill_form/3andsubmit_form/3. Commit fef7e82. - Removes deprecated
assert_has/refute_haswith text as positional argument. Commit 82f4170.
0.2.13
Deprecations
- Deprecates
fill_form/3andsubmit_form/3. Commit 996458a. See upgrade guides for more info.
Additions
- Adds
fill_in/3helper. Commit 6c7a1d2. - Adds
select/3helper. Commit 6efeadf. - Adds
choose/2helper. Commit 5f58604. - Adds
within/3helper. Commit 10b7269. - Adds
submit/1helper. Commit fff82d1. - Adds
check/2anduncheck/2helpers. Commit 58110b4.
0.2.12
Fixes
- Fix checked checkbox being overridden by hidden input. Commit a621f34
- Handle multiple checkboxes inside a label. Commit a8fc877
- Fix
assert_path/refute_pathto handle live patching. Commit 48a29a3 - Fix
assert_path/refute_pathto handle Live Navigation. Commit 842ab36 - Fix
assert_has/refute_hastitle matching exactly. Commit 7b2f243 - Update
assert_hasexamples in README to new API. Commit cb7529b
0.2.11
Improvements
- Add
assert_pathandrefute_pathassertions helpers. Commit f2ab02c - Include pre-selected text input values, selects, radio buttons, and checkboxes in form submissions. Commits 32a8da5, d253eba, ebba679
- Include button's
nameandvalueif present. Commit e54c64f click_buttonsubmits form without having tofill_formbefore it does. Commit 8d16b7e
Fixes
- Follow multiple redirects in
Live.click_link. Commit 28de102
0.2.10
Improvements
- Add
countoption in assertions. Commit 16fd0a4 - Add
exactoption in assertions. Commit da772f1 - Add
atoption in assertions. Commit 5da74ec
Deprecations
- Deprecate
assert_has/3wheretextis the third argument (positional). Useassert_has/3withtext:option instead. Commit 193c21a
0.2.9
Improvements
- Adds
assert_has/2andrefute_has/2. Commits 3756a47 and 9709b7a. - Follows redirect on
visit/2. Commit b4f49be
Fixes
- Do not always assume
submit_buttonafterfill_formis for submitting the form. Commit e193a07
0.2.8
Added
- Adds WSL2 for
open_browser/2. Commit b852014. - Relax Elixir version requirement to 1.15. Commit 3cb9586
- Support visiting non-200 pages in Static implementation. Commit 4964ab2.
0.2.7
Fixes
- Fixes
open_browser/1not existing. Commit 7407b19.
0.2.6
Added
- Adds
open_browser/1function to both Live and Static implementations. Commit b9d8347. - Handle forms that use
dataattributes andPhoenix.HTML.jsto submit forms. Commit d699792.
Fixes
- Correctly handles forms that PUT/DELETE (through hidden inputs). Commit 3efa4c0.
0.2.5
Added
- Introduce ability to assert and refute on page title. Commit 8552ec7.
- Handle regular form submission from LiveView pages when using
submit_form. Commit fc4d3ef.
Fixes
- Improve Live validation of form fields to properly handle nested fields in forms. Commits 180dc0d and c275c0c.
0.2.4
Added
- Handle form redirects from static pages. Commit 4c39920
- Handle regular form submission from LiveView pages with
fill_form+click_button. Commit fe755de
Fixes
- Use Html.raw/1 for more errors to handle nested buttons. 82e7415
0.2.3
Added
- Handle form redirects (to Live and static pages) from Live pages. Commit 531e5e9
- Expand documentation on nested forms. Commit 6809389
Fixes
- Allow multiple matching elements in
assert_has. Commit ac0e167
0.2.2
Added
- Raise
AssertionErrorinstead ofRuntimeErrorin assertions for more consistent ExUnit error messages. Commit 117bc59 - Update
fill_formto handle that aren't direct children of theformelement. Commit 46d6229
0.2.1
Added
- Improve printing of complex nested content in assertions. Commit 7151834
- Better error messages in forms when multiple submit buttons/inputs are found. Commit 82492c6
Fixes
- Allow using
refute_hasin pipes in the same wayassert_hasalready works. Commit 0484979
0.2.0
Breaking changes
- Update our static implementation to raise when we find many elements. That brings it in line with how our LiveView implementation works. Commit daa4dca
Improved
- Improves error messages in assertions. Commit c995fc1
0.1.1
Added
- Adds
click_link/3andclick_button/3which allow for specifying a CSS selector. Commit c7401b6.
0.1.0
- Initial version of the library.