File tree 5 files changed +27
-5
lines changed
lib/appium_lib_core/common
5 files changed +27
-5
lines changed Original file line number Diff line number Diff line change @@ -34,6 +34,10 @@ def action(async = false)
34
34
end
35
35
alias actions action
36
36
37
+ def get_timeouts
38
+ execute :get_timeouts
39
+ end
40
+
37
41
# For Appium
38
42
# override
39
43
def page_source
Original file line number Diff line number Diff line change @@ -68,6 +68,18 @@ def back
68
68
def logs
69
69
@logs ||= Logs . new ( @bridge )
70
70
end
71
+
72
+ # For W3C.
73
+ # Get the timeout related settings on the server side.
74
+ #
75
+ # @return [Hash]
76
+ #
77
+ # @example
78
+ # @driver.get_timeouts
79
+ #
80
+ def get_timeouts
81
+ @bridge . get_timeouts
82
+ end
71
83
end # class Driver
72
84
end # class Base
73
85
end # module Core
Original file line number Diff line number Diff line change @@ -89,6 +89,8 @@ module Commands
89
89
# The fix will be included in selenium-3.8.2
90
90
get_page_source : [ :get , 'session/:session_id/source' . freeze ] ,
91
91
92
+ get_timeouts : [ :get , 'session/:session_id/timeouts' . freeze ] ,
93
+
92
94
## Add OSS commands to W3C commands
93
95
### rotatable
94
96
get_screen_orientation : [ :get , 'session/:session_id/orientation' . freeze ] ,
Original file line number Diff line number Diff line change @@ -403,11 +403,6 @@ def extended(_mod)
403
403
add_endpoint_method method
404
404
end
405
405
406
- # Don't define selenium-side methods. We pick up from them.
407
- # ::Appium::Core::Base::Commands::MJSONWP.each_key do |method|
408
- # add_endpoint_method method
409
- # end
410
-
411
406
add_endpoint_method ( :available_contexts ) do
412
407
def available_contexts
413
408
# return empty array instead of nil on failure
Original file line number Diff line number Diff line change @@ -90,6 +90,15 @@ def test_active_element
90
90
91
91
assert_requested ( :get , "#{ SESSION } /element/active" , times : 1 )
92
92
end
93
+
94
+ def test_get_timeouts
95
+ stub_request ( :get , "#{ SESSION } /timeouts" )
96
+ . to_return ( headers : HEADER , status : 200 , body : { value : 'xxxx' } . to_json )
97
+
98
+ @driver . get_timeouts
99
+
100
+ assert_requested ( :get , "#{ SESSION } /timeouts" , times : 1 )
101
+ end
93
102
end
94
103
end
95
104
end
You can’t perform that action at this time.
0 commit comments