Skip to content

Commit 07a78b1

Browse files
authored
Merge branch 'master' into appium3
2 parents 76c0e7b + 1770174 commit 07a78b1

6 files changed

Lines changed: 70 additions & 19 deletions

File tree

.github/workflows/functional-test.yml

Lines changed: 36 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,27 +20,41 @@ jobs:
2020
test_targets:
2121
- target: test/functional/ios/driver_test.rb,test/functional/ios/patch_test.rb
2222
name: test1
23+
platform: ios
24+
wdaName: WebDriverAgentRunner-Runner.app
2325
- target: test/functional/ios/webdriver/create_session_test.rb,test/functional/ios/webdriver/w3c_actions_test.rb
2426
name: test2
27+
platform: ios
28+
wdaName: WebDriverAgentRunner-Runner.app
2529
- target: test/functional/ios/webdriver/device_test.rb
2630
name: test3
31+
platform: ios
32+
wdaName: WebDriverAgentRunner-Runner.app
2733
- target: test/functional/ios/ios/device_test.rb
2834
name: test4
35+
platform: ios
36+
wdaName: WebDriverAgentRunner-Runner.app
2937
- target: test/functional/ios/ios/device_wda_attachment_test.rb,test/functional/ios/ios/search_context_test.rb
3038
name: test5
39+
platform: ios
40+
wdaName: WebDriverAgentRunner-Runner.app
3141
- target: test/functional/ios/ios/image_comparison_test.rb
3242
name: test6
43+
platform: ios
44+
wdaName: WebDriverAgentRunner-Runner.app
3345
- target: test/functional/ios/tv_driver_test.rb
3446
name: test7
47+
platform: tvOS
48+
wdaName: WebDriverAgentRunner_tvOS-Runner.app
3549

36-
runs-on: macos-14
50+
runs-on: macos-15
3751

3852
# Please make sure the available Xcode versions and iOS versions
3953
# on the runner images. https://github.com/actions/runner-images
4054
env:
41-
XCODE_VERSION: 15.3
42-
IOS_VERSION: 17.4
43-
IOS_DEVICE_NAME: iPhone 15 Plus
55+
XCODE_VERSION: 16.4
56+
IOS_VERSION: 18.5
57+
IOS_DEVICE_NAME: iPhone 16 Plus
4458

4559
steps:
4660
- uses: actions/checkout@v3
@@ -71,6 +85,10 @@ jobs:
7185
# nohup appium --use-plugins=images,execute-driver --relaxed-security --log-timestamp --log-no-colors 2>&1 > appium.log &
7286
nohup appium --relaxed-security --log-timestamp --log-no-colors 2>&1 > appium.log &
7387
88+
- run: |
89+
appium driver run xcuitest download-wda-sim --platform=${{matrix.test_targets.platform}} --outdir=${{ github.workspace }}/wda
90+
name: Downloading prebuilt WDA
91+
7492
- name: Set up Ruby
7593
uses: ruby/setup-ruby@v1
7694
with:
@@ -84,6 +102,7 @@ jobs:
84102
env:
85103
IGNORE_VERSION_SKIP: true
86104
CI: true
105+
LOCAL_PREBUILT_WDA: ${{ github.workspace }}/wda/${{matrix.test_targets.wdaName}}
87106

88107
- name: Save server output
89108
if: ${{ always() }}
@@ -95,7 +114,14 @@ jobs:
95114
test/report/
96115
97116
ios_test_with_other_deps:
98-
runs-on: macos-14
117+
runs-on: macos-15
118+
119+
# Please make sure the available Xcode versions and iOS versions
120+
# on the runner images. https://github.com/actions/runner-images
121+
env:
122+
XCODE_VERSION: 16.4
123+
IOS_VERSION: 18.5
124+
IOS_DEVICE_NAME: iPhone 16 Plus
99125

100126
steps:
101127
- uses: actions/checkout@v3
@@ -135,6 +161,10 @@ jobs:
135161
# nohup appium --use-plugins=images,execute-driver --relaxed-security --log-timestamp --log-no-colors 2>&1 > appium.log &
136162
nohup appium --relaxed-security --log-timestamp --log-no-colors 2>&1 > appium.log &
137163
164+
- run: |
165+
appium driver run xcuitest download-wda-sim --platform=${{matrix.test_targets.platform}} --outdir=${{ github.workspace }}/wda
166+
name: Downloading prebuilt WDA
167+
138168
- name: Set up Ruby
139169
uses: ruby/setup-ruby@v1
140170
with:
@@ -147,6 +177,7 @@ jobs:
147177
env:
148178
IGNORE_VERSION_SKIP: true
149179
CI: true
180+
LOCAL_PREBUILT_WDA: ${{ github.workspace }}/wda/WebDriverAgentRunner-Runner.app
150181

151182
- name: Save server output
152183
if: ${{ always() }}

Gemfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ gem 'minitest', '~> 5.0'
88
gem 'minitest-reporters', '~> 1.1'
99
gem 'parallel_tests'
1010
gem 'rake', '~> 13.0'
11-
gem 'rubocop', '1.76.2'
11+
gem 'rubocop', '1.79.0'
1212
gem 'simplecov'
1313
gem 'steep', '~> 1.9.3'
1414
gem 'webmock', '~> 3.25.0'

README.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,26 @@ attached_driver.page_source
156156
Read [Appium/Core/Driver](https://rubydoc.info/github/appium/ruby_lib_core/Appium/Core/Driver) to catch up with available capabilities.
157157
Capabilities affect only ruby_lib is [Appium/Core/Options](https://rubydoc.info/github/appium/ruby_lib_core/Appium/Core/Options).
158158

159+
### Improvement ideas
160+
161+
- for iOS
162+
163+
```
164+
$ appium driver run xcuitest download-wda-sim --outdir=/path/to/download/prebuilt/wda/
165+
```
166+
167+
Then, adding capabilities below:
168+
169+
```json
170+
{
171+
"appium:usePreinstalledWDA": true,
172+
"appium:prebuiltWDAPath": "/path/to/download/prebuilt/wda/WebDriverAgentRunner-Runner.app"
173+
}
174+
```
175+
176+
It will improve initial new session request performance for iOS simulator.
177+
178+
`"appium:settings[respectSystemAlerts]" => true` for capability will also help to work with [permissions](https://appium.github.io/appium-xcuitest-driver/latest/guides/troubleshooting/#interact-with-dialogs-managed-by-comapplespringboard).
159179

160180
### Gives custom listener
161181

test/functional/android/android/mobile_commands_test.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ def test_webatom
224224
# Can use `atom` defined in https://developer.android.com/reference/android/support/test/espresso/web/webdriver/DriverAtoms
225225
# Locator: https://developer.android.com/reference/androidx/test/espresso/web/webdriver/Locator
226226
text = @driver.execute_script 'mobile: webAtoms', {
227-
webviewElement: el.id,
227+
webviewEl: el.id,
228228
forceJavascriptEnabled: true,
229229
methodChain: [{
230230
name: 'withElement',
@@ -238,7 +238,7 @@ def test_webatom
238238
# Raises an error if the method cannot find any DriverAtoms or necessary arguments
239239
error = assert_raises ::Selenium::WebDriver::Error::WebDriverError do
240240
@driver.execute_script 'mobile: webAtoms', {
241-
webviewElement: el.id,
241+
webviewEl: el.id,
242242
forceJavascriptEnabled: true,
243243
methodChain: [{
244244
name: 'withElement',

test/functional/ios/driver_test.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ def test_default_keyboard_pref
118118
@@driver.find_element(:accessibility_id, 'Keyboard').click
119119

120120
# to wait the animation
121-
auto_correction_name = over_ios26? @@driver ? 'KeyboardAutocorrection' : 'Auto-Correction'
121+
auto_correction_name = over_ios26?(@@driver) ? 'KeyboardAutocorrection' : 'Auto-Correction'
122122
@@driver.wait { |d| d.find_element :accessibility_id, auto_correction_name }
123123

124124
auto_correction = @@driver.wait do |d|

test/test_helper.rb

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ def self.mac2
131131

132132
# Require a simulator which OS version is 11.4, for example.
133133
def ios(platform_name = :ios)
134-
platform_version = '17.4'
134+
platform_version = ENV['IOS_VERSION'] || '18.5'
135135
wda_port = wda_local_port
136136

137137
real_device = ENV['REAL'] || false
@@ -142,7 +142,7 @@ def ios(platform_name = :ios)
142142
automationName: ENV['APPIUM_DRIVER'] || 'XCUITest',
143143
# udid: 'auto',
144144
platformVersion: platform_version,
145-
deviceName: device_name(platform_version, platform_name, wda_port),
145+
deviceName: device_name(platform_name, wda_port),
146146
useNewWDA: false,
147147
eventTimings: true,
148148
someCapability: 'some_capability',
@@ -184,6 +184,11 @@ def ios(platform_name = :ios)
184184
cap = add_xctestrun(real_device, cap.dup, xcode_org_id)
185185
end
186186

187+
if ENV['LOCAL_PREBUILT_WDA']
188+
cap[:caps][:usePreinstalledWDA] = true
189+
cap[:caps][:prebuiltWDAPath] = ENV['LOCAL_PREBUILT_WDA']
190+
end
191+
187192
cap
188193
end
189194

@@ -210,16 +215,11 @@ def test_app(os_version)
210215
end
211216
end
212217

213-
def device_name(os_version, platform_name, wda_local_port)
218+
def device_name(platform_name, wda_local_port)
214219
if platform_name.downcase == :tvos
215220
'Apple TV'
216221
else
217-
name = if over_ios13?(os_version)
218-
'iPhone 15 Plus'
219-
else
220-
'iPhone 15 Pro Max'
221-
end
222-
222+
name = ENV['IOS_DEVICE_NAME'] || 'iPhone 16 Plus'
223223
parallel? ? "#{name} - #{wda_local_port}" : name
224224
end
225225
end
@@ -315,7 +315,7 @@ def android(activity_name = nil)
315315
# https://developer.android.com/reference/androidx/test/uiautomator/Configurator#setActionAcknowledgmentTimeout(long)
316316
cap[:capabilities]['settings[actionAcknowledgmentTimeout]'] = 0
317317
# https://developer.android.com/reference/androidx/test/uiautomator/Configurator#setScrollAcknowledgmentTimeout(long)
318-
cap[:capabilities]['settings[scrollAcknowledgmentTimeout]'] = 0
318+
# cap[:capabilities]['settings[scrollAcknowledgmentTimeout]'] = 0
319319
cap[:capabilities]['settings[waitForIdleTimeout]'] = 0
320320
cap[:capabilities]['settings[waitForSelectorTimeout]'] = 0
321321
else

0 commit comments

Comments
 (0)