File tree 2 files changed +18
-2
lines changed
2 files changed +18
-2
lines changed Original file line number Diff line number Diff line change @@ -79,7 +79,7 @@ def test_context_related
79
79
@@driver . set_context webview_context
80
80
assert @@driver . current_context . start_with? 'WEBVIEW'
81
81
82
- @@driver . set_context 'NATIVE_APP'
82
+ @@driver . switch_to_default_context
83
83
assert_equal 'NATIVE_APP' , @@driver . current_context
84
84
end
85
85
@@ -266,6 +266,14 @@ def test_ime_available_engins
266
266
assert_equal available_ime , @@driver . ime_active_engine
267
267
end
268
268
269
+ def test_within_context
270
+ result = @@driver . within_context ( 'NATIVE_APP' ) do
271
+ @@core . wait { @@driver . find_element :accessibility_id , 'App' } . click
272
+ end
273
+
274
+ assert_equal 'App' , result . text
275
+ end
276
+
269
277
private
270
278
271
279
def scroll_to ( text )
Original file line number Diff line number Diff line change @@ -74,7 +74,7 @@ def test_context_related
74
74
@@driver . set_context contexts . last
75
75
assert_match 'NATIVE_APP' , @@driver . current_context
76
76
77
- @@driver . set_context 'NATIVE_APP'
77
+ @@driver . switch_to_default_context
78
78
assert_equal 'NATIVE_APP' , @@driver . current_context
79
79
80
80
@@driver . back # go to top
@@ -183,6 +183,14 @@ def test_hidekeyboard
183
183
184
184
@@driver . back
185
185
end
186
+
187
+ def test_within_context
188
+ result = @@driver . within_context ( 'NATIVE_APP' ) do
189
+ @@core . wait { @@driver . find_element :accessibility_id , 'Buttons' } . click
190
+ end
191
+
192
+ assert_equal 'Buttons' , result . name
193
+ end
186
194
end
187
195
end
188
196
end
You can’t perform that action at this time.
0 commit comments