File tree 4 files changed +16
-4
lines changed
4 files changed +16
-4
lines changed Original file line number Diff line number Diff line change 1
1
[caps]
2
2
platformName = "ios"
3
3
platformVersion = "10.3"
4
- deviceName = "iPhone Simulator"
5
- browserName = "Safari"
4
+ deviceName ="iPhone Simulator"
5
+ automationName = 'XCUITest'
6
+ app = "/absolute/path/to/UICatalog.app"
6
7
some_capability = "some_capability"
7
8
8
9
[appium_lib]
Original file line number Diff line number Diff line change 2
2
"capabilities" :
3
3
[
4
4
{
5
- "browserName" : " Safari " ,
5
+ "browserName" : " iPhone Simulator " ,
6
6
"version" :" 9.0" ,
7
7
"platform" :" MAC" ,
8
8
"maxInstances" : 1
Original file line number Diff line number Diff line change @@ -241,7 +241,8 @@ def app_installed?(app_id)
241
241
add_endpoint_method ( :background_app ) do
242
242
def background_app ( duration = 0 )
243
243
# https://github.com/appium/ruby_lib/issues/500, https://github.com/appium/appium/issues/7741
244
- if $driver. automation_name_is_xcuitest? && $driver. appium_server_status [ 'build' ] [ 'version' ] >= '1.6.4'
244
+ # `execute :background_app, {}, seconds: { timeout: duration_milli_sec }` works over Appium 1.6.4
245
+ if $driver. automation_name_is_xcuitest?
245
246
duration_milli_sec = duration . nil? ? nil : duration * 1000
246
247
execute :background_app , { } , seconds : { timeout : duration_milli_sec }
247
248
else
Original file line number Diff line number Diff line change @@ -502,13 +502,23 @@ def check_server_version_xcuitest
502
502
# }
503
503
# ```
504
504
#
505
+ # Returns blank hash for Selenium Grid since `remote_status` gets 500 error
506
+ #
507
+ # ```ruby
508
+ # {}
509
+ # ```
510
+ #
505
511
# @return [Hash]
506
512
def appium_server_version
507
513
driver . remote_status
508
514
rescue Selenium ::WebDriver ::Error ::WebDriverError => ex
509
515
raise unless ex . message . include? ( 'content-type=""' )
510
516
# server (TestObject for instance) does not respond to status call
511
517
{ }
518
+ rescue Selenium ::WebDriver ::Error ::ServerError => e
519
+ raise unless e . message . include? ( 'status code 500' )
520
+ # driver.remote_status returns 500 error for using selenium grid
521
+ { }
512
522
end
513
523
514
524
# Returns the client's version info
You can’t perform that action at this time.
0 commit comments