1313# limitations under the License.
1414
1515require 'test_helper'
16+ require 'functional/common_w3c_actions'
1617
1718# $ rake test:func:ios TEST=test/functional/ios/ios/mobile_commands_test.rb
1819class AppiumLibCoreTest
@@ -83,26 +84,27 @@ def test_permission
8384 core = ::Appium ::Core . for ( caps )
8485 @driver = core . start_driver
8586
86- skip 'Permissions does not work well on iOS 14 yet' if over_ios14? ( @driver )
87-
87+ # skip 'Permissions does not work well on iOS 14 yet' if over_ios14?(@driver)
8888 assert @driver . execute_script ( 'mobile: getPermission' ,
8989 { service : 'calendar' , bundleId : 'com.example.apple-samplecode.UICatalog' } ) == 'yes'
9090 assert @driver . execute_script ( 'mobile: getPermission' ,
9191 { service : 'photos' , bundleId : 'com.example.apple-samplecode.UICatalog' } ) == 'no'
9292
9393 @driver . terminate_app ( 'com.apple.Preferences' ) # To ensure the app shows the top view
9494 @driver . activate_app ( 'com.apple.Preferences' )
95- @driver . find_element ( :accessibility_id , 'Privacy' ) . click
95+ @driver . settings . update ( { defaultActiveApplication : 'com.apple.Preferences' } )
96+ w3c_scroll @driver , duration : 1.0
97+ @driver . find_element ( :accessibility_id , 'com.apple.settings.privacyAndSecurity' ) . click
9698
9799 @driver . find_element ( :accessibility_id , 'Calendars' ) . click
98- el = @driver . find_element ( :accessibility_id , uicatalog )
99- assert_equal '1' , el . value
100-
100+ if over_ios26? @driver
101+ # without exceptions
102+ d . find_element :predicate , "label == 'UIKitCatalog, Full Access'"
103+ else
104+ el = @driver . find_element ( :accessibility_id , uicatalog )
105+ assert_equal '1' , el . value
106+ end
101107 @driver . back
102-
103- @driver . find_element ( :accessibility_id , 'Photos' ) . click
104- el = @driver . find_element ( :accessibility_id , 'Never' )
105- assert_equal 'Never' , el . value
106108 end
107109
108110 # @since Appium 1.10.0
@@ -118,6 +120,8 @@ def test_siri
118120
119121 @driver . execute_script 'mobile: siriCommand' , { text : 'hello, siri' }
120122
123+ # to expand the detection area
124+ @driver . settings . update ( { defaultActiveApplication : 'com.apple.springboard' } )
121125 if over_ios14? ( @driver )
122126 @core . wait { @driver . find_element :name , 'siri-interface-window' }
123127 else
@@ -126,6 +130,7 @@ def test_siri
126130 # name="...having a problem with the connection. Please try again in a little bit." ...>
127131 @core . wait { @driver . find_element :class_chain , '**/*[`name == "com.apple.ace.assistant"`]' }
128132 end
133+ @driver . settings . update ( { defaultActiveApplication : 'com.example.apple-samplecode.UICatalog' } )
129134 assert_equal :running_in_foreground , @driver . app_state ( 'com.example.apple-samplecode.UICatalog' )
130135
131136 @driver . activate_app 'com.example.apple-samplecode.UICatalog'
0 commit comments