@@ -18,7 +18,7 @@ def test_appears_and_positions_on_focus_of_button
1818 assert_selector ( "tool-tip.position-absolute.sr-only" , visible : :hidden )
1919 assert ( !find ( "tool-tip" , visible : :hidden ) [ "style" ] . present? ) # position not set on initial load
2020
21- find ( "button" ) . send_keys ( "tab" ) # sends focus to button
21+ find ( "button" ) . hover
2222
2323 assert_selector ( "tool-tip.position-absolute" , visible : true )
2424 refute_selector ( "tool-tip.position-absolute.sr-only" , visible : true )
@@ -45,7 +45,7 @@ def test_appears_and_positions_on_hover_of_button
4545 def test_hides_tooltip_on_escape
4646 visit_preview ( :default )
4747
48- find ( "button" ) . send_keys ( "tab" ) # focus
48+ find ( "button" ) . hover
4949 assert_selector ( "tool-tip" , visible : true )
5050
5151 find ( "button" ) . send_keys ( :escape )
@@ -83,7 +83,7 @@ def test_never_aria_hidden_when_tooltip_is_description
8383 assert_selector ( "tool-tip.sr-only" , visible : :hidden )
8484 refute_selector ( "tool-tip.sr-only[aria-hidden]" , visible : :hidden )
8585
86- find ( "button" ) . send_keys ( "tab" ) # focus
86+ find ( "button" ) . hover
8787
8888 refute_selector ( "tool-tip.sr-only" , visible : :hidden )
8989 assert_selector ( "tool-tip" , visible : :visible )
@@ -108,7 +108,7 @@ def test_only_one_visible_at_a_time
108108 assert_selector ( "tool-tip.sr-only[for='button-2']" , visible : :hidden )
109109 assert_selector ( "tool-tip.sr-only[for='button-3']" , visible : :hidden )
110110
111- find ( "button#button-1" ) . send_keys ( "tab" ) # focus
111+ find ( "button#button-1" ) . hover
112112
113113 assert_selector ( "tool-tip[for='button-1']" , visible : :visible )
114114 assert_selector ( "tool-tip.sr-only[for='button-2']" , visible : :hidden )
@@ -150,7 +150,7 @@ def test_tooltip_escape_hides_only_tooltip
150150
151151 assert_selector ( "tool-tip[for='overlay-button']" , visible : :visible )
152152
153- find ( "button#overlay-button" ) . send_keys ( :escape )
153+ page . driver . browser . keyboard . type ( :Escape )
154154
155155 assert_selector ( "tool-tip[for='overlay-button']" , visible : :hidden )
156156
0 commit comments