File tree Expand file tree Collapse file tree 3 files changed +16
-3
lines changed Expand file tree Collapse file tree 3 files changed +16
-3
lines changed Original file line number Diff line number Diff line change @@ -5,6 +5,10 @@ All notable changes to this project will be documented in this file.
5
5
The format is based on [ Keep a Changelog] ( https://keepachangelog.com/en/1.1.0/ ) ,
6
6
and this project adheres to [ Semantic Versioning] ( https://semver.org/spec/v2.0.0.html ) .
7
7
8
+ ## [ tbd]
9
+ ### Fixed
10
+ - ` refute_has/3 ` add retry, don't fail if element initially found
11
+
8
12
## [ 0.7.0] 2025-06-16
9
13
### Added
10
14
- Dialog handling
Original file line number Diff line number Diff line change @@ -608,9 +608,11 @@ defmodule PhoenixTest.Playwright do
608
608
609
609
@ doc false
610
610
def refute_has ( conn , selector , opts ) do
611
- if found? ( conn , selector , opts ) do
612
- flunk ( "Found element #{ selector } #{ inspect ( opts ) } " )
613
- end
611
+ retry ( fn ->
612
+ if found? ( conn , selector , opts ) do
613
+ flunk ( "Found element #{ selector } #{ inspect ( opts ) } " )
614
+ end
615
+ end )
614
616
615
617
conn
616
618
end
Original file line number Diff line number Diff line change @@ -703,6 +703,13 @@ defmodule PhoenixTest.PlaywrightTest do
703
703
|> refute_has ( ".multiple_links" , count: 2 )
704
704
end
705
705
end
706
+
707
+ test "retries if element initially visible" , % { conn: conn } do
708
+ conn
709
+ |> visit ( "/live/index" )
710
+ |> click_button ( "Button with push navigation" )
711
+ |> refute_has ( "h1" , text: "main page" )
712
+ end
706
713
end
707
714
708
715
describe "refute_has/3" do
You can’t perform that action at this time.
0 commit comments