Skip to content

Commit c9062c4

Browse files
authored
add mobile command on espresso driver (#213)
* add mobile command on espresso driver * fix rubocop * relax assertions
1 parent 75e3d16 commit c9062c4

File tree

2 files changed

+24
-0
lines changed

2 files changed

+24
-0
lines changed

ci-jobs/functional_test.yml

+17
Original file line numberDiff line numberDiff line change
@@ -228,3 +228,20 @@ jobs:
228228
- template: ./functional/publish_test_result.yml
229229
parameters:
230230
xcodeVersion: 'func_test_android_android4'
231+
232+
- job: func_test_android_mobile_command_espresso
233+
pool:
234+
vmImage: ${{ parameters.vmImage }}
235+
variables:
236+
CI: true
237+
ANDROID_SDK_VERSION: 28
238+
AUTOMATION_NAME_DROID: espresso
239+
steps:
240+
- template: ./functional/android_setup.yml
241+
- template: ./functional/run_appium.yml
242+
- script: |
243+
bundle exec rake test:func:android TEST=test/functional/android/android/mobile_commands_test.rb
244+
displayName: Run tests
245+
- template: ./functional/publish_test_result.yml
246+
parameters:
247+
xcodeVersion: 'func_test_android_mobile_command_espresso'

test/functional/android/android/mobile_commands_test.rb

+7
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,13 @@ def test_backdoor
183183

184184
assert_mobile_command_error 'mobile: backdoor', { target: :activity, methods: [{ name: 'noMethod', args: [] }] },
185185
'No public method noMethod definded on class io.appium.android.apis.view.TextSwitcher1'
186+
187+
e = @driver.find_elements :class, 'android.widget.TextView'
188+
assert_equal '0', e.last.text
189+
190+
type = @driver.execute_script('mobile: backdoor',
191+
{ target: :element, elementId: e.last.ref, methods: [{ name: 'getTypeface' }] })
192+
assert type['mStyle']
186193
end
187194

188195
# @since Appium 1.12.0 (Espresso driver 1.8.0~)

0 commit comments

Comments
 (0)