appium_lib_core 4.1.0 → 9.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (102) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +357 -270
  3. data/README.md +68 -16
  4. data/Rakefile +8 -20
  5. data/Steepfile +11 -0
  6. data/appium_lib_core.gemspec +13 -15
  7. data/bin/console +0 -4
  8. data/lib/appium_lib_core/android/device/auth_finger_print.rb +4 -1
  9. data/lib/appium_lib_core/android/device/clipboard.rb +4 -2
  10. data/lib/appium_lib_core/android/device/emulator.rb +11 -5
  11. data/lib/appium_lib_core/android/device/network.rb +10 -0
  12. data/lib/appium_lib_core/android/device/performance.rb +3 -0
  13. data/lib/appium_lib_core/android/device/screen.rb +5 -1
  14. data/lib/appium_lib_core/android/device.rb +83 -20
  15. data/lib/appium_lib_core/common/base/bridge.rb +238 -95
  16. data/lib/appium_lib_core/common/base/capabilities.rb +21 -8
  17. data/lib/appium_lib_core/common/{command/mjsonwp.rb → base/device_ime.rb} +33 -12
  18. data/lib/appium_lib_core/common/base/driver.rb +260 -334
  19. data/lib/appium_lib_core/common/base/driver_settings.rb +51 -0
  20. data/lib/appium_lib_core/common/base/has_location.rb +80 -0
  21. data/lib/appium_lib_core/common/base/has_network_connection.rb +56 -0
  22. data/lib/appium_lib_core/common/base/http_default.rb +22 -38
  23. data/lib/appium_lib_core/{ios/uiautomation/bridge.rb → common/base/remote_status.rb} +9 -8
  24. data/lib/appium_lib_core/common/base/rotable.rb +62 -0
  25. data/lib/appium_lib_core/common/base/screenshot.rb +10 -10
  26. data/lib/appium_lib_core/common/base/search_context.rb +98 -172
  27. data/lib/appium_lib_core/common/base.rb +1 -5
  28. data/lib/appium_lib_core/common/command.rb +244 -4
  29. data/lib/appium_lib_core/common/device/app_management.rb +2 -26
  30. data/lib/appium_lib_core/common/device/context.rb +1 -5
  31. data/lib/appium_lib_core/common/device/image_comparison.rb +27 -10
  32. data/lib/appium_lib_core/common/device/keyevent.rb +4 -4
  33. data/lib/appium_lib_core/common/device/{touch_actions.rb → orientation.rb} +6 -10
  34. data/lib/appium_lib_core/common/device/screen_record.rb +8 -2
  35. data/lib/appium_lib_core/common/error.rb +5 -5
  36. data/lib/appium_lib_core/common/log.rb +5 -4
  37. data/lib/appium_lib_core/common/wait.rb +38 -6
  38. data/lib/appium_lib_core/device.rb +3 -9
  39. data/lib/appium_lib_core/driver.rb +193 -182
  40. data/lib/appium_lib_core/{patch.rb → element.rb} +64 -26
  41. data/lib/appium_lib_core/ios/device/clipboard.rb +4 -2
  42. data/lib/appium_lib_core/ios/xcuitest/device.rb +2 -0
  43. data/lib/appium_lib_core/{common/base/command.rb → mac2/bridge.rb} +9 -8
  44. data/lib/appium_lib_core/mac2/device/screen.rb +48 -0
  45. data/lib/appium_lib_core/mac2/device.rb +92 -0
  46. data/lib/appium_lib_core/{ios.rb → mac2.rb} +2 -5
  47. data/lib/appium_lib_core/support/event_firing_bridge.rb +57 -0
  48. data/lib/appium_lib_core/version.rb +2 -2
  49. data/lib/appium_lib_core.rb +23 -10
  50. data/rbs_collection.lock.yaml +252 -0
  51. data/rbs_collection.yaml +15 -0
  52. data/sig/gems/selenium/abstract_event_listener.rbs +8 -0
  53. data/sig/gems/selenium/capabilities.rbs +8 -0
  54. data/sig/gems/selenium/common.rbs +10 -0
  55. data/sig/gems/selenium/default.rbs +10 -0
  56. data/sig/gems/selenium/driver.rbs +7 -0
  57. data/sig/gems/selenium/has_session_id.rbs +8 -0
  58. data/sig/gems/selenium/has_web_storage.rbs +8 -0
  59. data/sig/gems/selenium/uploads_files.rbs +8 -0
  60. data/sig/lib/appium_lib_core/common/base/capabilities.rbs +9 -0
  61. data/sig/lib/appium_lib_core/common/base/driver.rbs +167 -0
  62. data/sig/lib/appium_lib_core/common/base/driver_settings.rbs +15 -0
  63. data/sig/lib/appium_lib_core/common/base/has_location.rbs +13 -0
  64. data/sig/lib/appium_lib_core/common/base/has_network_connection.rbs +19 -0
  65. data/sig/lib/appium_lib_core/common/base/http_default.rbs +38 -0
  66. data/sig/lib/appium_lib_core/common/base/platform.rbs +7 -0
  67. data/sig/lib/appium_lib_core/common/base/remote_status.rbs +9 -0
  68. data/sig/lib/appium_lib_core/common/base/rotable.rbs +17 -0
  69. data/sig/lib/appium_lib_core/common/base/screenshot.rbs +19 -0
  70. data/sig/lib/appium_lib_core/common/device/battery_status.rbs +13 -0
  71. data/sig/lib/appium_lib_core/common/wait.rbs +31 -0
  72. data/sig/lib/appium_lib_core/device.rbs +21 -0
  73. data/sig/lib/appium_lib_core/driver.rbs +196 -0
  74. data/sig/lib/appium_lib_core/ios/xcuitest/device/battery.rbs +15 -0
  75. data/sig/lib/appium_lib_core/version.rbs +7 -0
  76. data/sig/lib/appium_lib_core.rbs +8 -0
  77. metadata +88 -111
  78. data/.github/ISSUE_TEMPLATE/issue-report.md +0 -29
  79. data/.github/contributing.md +0 -26
  80. data/.github/issue_template.md +0 -20
  81. data/.github/workflows/unittest.yml +0 -68
  82. data/.gitignore +0 -18
  83. data/.rubocop.yml +0 -58
  84. data/azure-pipelines.yml +0 -15
  85. data/ci-jobs/functional/android_setup.yml +0 -3
  86. data/ci-jobs/functional/ios_setup.yml +0 -7
  87. data/ci-jobs/functional/publish_test_result.yml +0 -18
  88. data/ci-jobs/functional/run_appium.yml +0 -25
  89. data/ci-jobs/functional/start-emulator.sh +0 -26
  90. data/ci-jobs/functional_test.yml +0 -298
  91. data/docs/mobile_command.md +0 -34
  92. data/lib/appium_lib_core/common/base/bridge/mjsonwp.rb +0 -81
  93. data/lib/appium_lib_core/common/base/bridge/w3c.rb +0 -252
  94. data/lib/appium_lib_core/common/command/common.rb +0 -110
  95. data/lib/appium_lib_core/common/command/w3c.rb +0 -56
  96. data/lib/appium_lib_core/common/device/value.rb +0 -52
  97. data/lib/appium_lib_core/common/touch_action/multi_touch.rb +0 -56
  98. data/lib/appium_lib_core/common/touch_action/touch_actions.rb +0 -203
  99. data/lib/appium_lib_core/ios/uiautomation/device.rb +0 -44
  100. data/lib/appium_lib_core/ios/uiautomation/patch.rb +0 -34
  101. data/release_notes.md +0 -816
  102. data/script/commands.rb +0 -200
@@ -1,26 +0,0 @@
1
- # Contributing
2
-
3
- For features or bug fixes, please submit a pull request. Ideally there would be a test as well. The remainder of this doc details how to run the tests.
4
-
5
- ## Tests
6
- ### Unit Tests
7
- - `rake test:unit` run on Travis automatically
8
-
9
- ### Functional Tests
10
- - iOS
11
- - `rake test:func:ios`
12
- - Android
13
- - `rake test:func:android`
14
-
15
- ## Merge
16
- - Squash and merge when we merge PRs to the master
17
-
18
- ## Publishing on rubygems
19
-
20
- 0. Ensure you have `~/.gem/credentials` If not run [the following command](http://guides.rubygems.org/make-your-own-gem/) (replace username with your rubygems user)
21
- > $ curl -u username https://rubygems.org/api/v1/api_key.yaml >
22
- ~/.gem/credentials; chmod 0600 ~/.gem/credentials
23
-
24
- 1. Bump the version number `thor bump`
25
- 2. Generate release note, build and publish gem with `thor release`
26
- 3. Update `changelog.md`
@@ -1,20 +0,0 @@
1
- ## This is a
2
- * [ ] Bug report
3
- * [ ] Question
4
- * [ ] Feature Request
5
-
6
- ## Summary
7
-
8
- ## Environment
9
- * `ruby_lib_core` version:
10
- * Mobile platform/version/device under test:
11
-
12
- ## Actual behaviour and steps to reproduce
13
-
14
- ## Expected behaviour
15
-
16
- ## Link to Appium/Ruby logs
17
-
18
- Create a [GIST](https://gist.github.com) which is a paste of your _full_ Appium logs, and link them here.
19
-
20
- ## Any additional comments
@@ -1,68 +0,0 @@
1
- name: Runs lint and unit tests
2
-
3
- on:
4
- push:
5
- branches: [ master ]
6
- pull_request:
7
- branches: [ master ]
8
-
9
- jobs:
10
- test:
11
- strategy:
12
- fail-fast: false
13
- matrix:
14
- ruby: [2.4, 2.5, 2.6, 2.7, 3.0]
15
-
16
- runs-on: ubuntu-latest
17
-
18
- env:
19
- UNIT_TEST: true
20
-
21
- steps:
22
- - uses: actions/checkout@v2
23
- - name: Set up Ruby
24
- uses: ruby/setup-ruby@v1
25
- with:
26
- ruby-version: ${{ matrix.ruby }}
27
- - name: Install dependencies
28
- run: bundle install
29
- - name: Run tests
30
- run: |
31
- bundle exec rake rubocop
32
- bundle exec parallel_test test/unit/ -n 4
33
- AUTOMATION_NAME_DROID=espresso bundle exec parallel_test test/unit/android -n 4
34
- AUTOMATION_NAME_DROID=appium AUTOMATION_NAME_IOS=appium bundle exec parallel_test test/unit -n 4
35
-
36
- test-win:
37
- strategy:
38
- fail-fast: false
39
- matrix:
40
- # Does not add 2.7 on Windows so far since a command fails only on Windows
41
- ruby: [2.4, 2.5, 2.6]
42
-
43
- runs-on: windows-latest
44
-
45
- env:
46
- UNIT_TEST: true
47
-
48
- steps:
49
- - uses: actions/checkout@v2
50
- - name: Set up Ruby
51
- uses: ruby/setup-ruby@v1
52
- with:
53
- ruby-version: ${{ matrix.ruby }}
54
- - name: Install dependencies
55
- run: |
56
- gem install ffi
57
- bundle install
58
- gem uninstall --force eventmachine && gem install eventmachine --platform ruby
59
- - name: Run tests
60
- run: |
61
- parallel_test test/unit/ -n 4
62
-
63
- setx AUTOMATION_NAME_DROID espresso
64
- parallel_test test/unit/android -n 4
65
-
66
- setx AUTOMATION_NAME_DROID appium
67
- setx AUTOMATION_NAME_IOS appium
68
- parallel_test test/unit -n 4
data/.gitignore DELETED
@@ -1,18 +0,0 @@
1
- /.bundle/
2
- /.yardoc
3
- /Gemfile.lock
4
- /_yardoc/
5
- /coverage/
6
- /doc/
7
- /docs/
8
- /pkg/
9
- /spec/reports/
10
- /tmp/
11
-
12
- # for Mac
13
- .DS_Store
14
-
15
- # for IDE
16
- .idea
17
-
18
- .coverage
data/.rubocop.yml DELETED
@@ -1,58 +0,0 @@
1
- AllCops:
2
- TargetRubyVersion: 2.4
3
- Layout/LineLength:
4
- Max: 128
5
- Layout/RescueEnsureAlignment:
6
- Enabled: false
7
- Layout/EmptyLinesAroundAttributeAccessor:
8
- Enabled: false
9
- Layout/EmptyLineBetweenDefs:
10
- Enabled: false
11
- Layout/HashAlignment:
12
- Enabled: false
13
- Metrics/MethodLength:
14
- Enabled: false
15
- Metrics/ModuleLength:
16
- Enabled: false
17
- Metrics/ClassLength:
18
- Enabled: false
19
- Metrics/AbcSize:
20
- Enabled: false
21
- Metrics/CyclomaticComplexity:
22
- Max: 14
23
- Metrics/PerceivedComplexity:
24
- Max: 14
25
- Metrics/ParameterLists:
26
- Enabled: false
27
- Lint/NestedMethodDefinition:
28
- Enabled: false
29
- Style/ZeroLengthPredicate:
30
- Enabled: false
31
- Style/Documentation:
32
- Enabled: false
33
- Style/CommentedKeyword:
34
- Enabled: false
35
- Style/PercentLiteralDelimiters:
36
- Enabled: false
37
- Style/SymbolArray:
38
- Enabled: false
39
- Style/UnpackFirst:
40
- Enabled: false
41
- Naming/AccessorMethodName:
42
- Enabled: false
43
- Naming/MemoizedInstanceVariableName:
44
- Enabled: true
45
- Exclude:
46
- - test/**/*
47
- Naming/RescuedExceptionsVariableName:
48
- Enabled: false
49
- Style/CaseLikeIf:
50
- Enabled: false
51
- Style/RedundantRegexpEscape:
52
- Enabled: false
53
- Style/OptionalBooleanParameter:
54
- Enabled: false
55
- Style/ExplicitBlockArgument:
56
- Enabled: false
57
- Style/KeywordParametersOrder:
58
- Enabled: false
data/azure-pipelines.yml DELETED
@@ -1,15 +0,0 @@
1
- # Ruby
2
- # Package your Ruby project.
3
- # Add steps that install rails, analyze code, save build artifacts, deploy, and more:
4
- # https://docs.microsoft.com/azure/devops/pipelines/languages/ruby
5
- jobs:
6
- - template: ./ci-jobs/functional_test.yml
7
-
8
- # Runs tests nightly to make sure they works against appium@beta
9
- schedules:
10
- - cron: "0 0 * * *"
11
- displayName: Daily Nightly build (UTC)
12
- branches:
13
- include:
14
- - master
15
- always: true
@@ -1,3 +0,0 @@
1
- steps:
2
- - script: bash ci-jobs/functional/start-emulator.sh
3
- displayName: Create and run Emulator
@@ -1,7 +0,0 @@
1
- steps:
2
- - script: sudo xcode-select -s /Applications/Xcode_${{ parameters.xcodeVersion }}.app/Contents/Developer
3
- displayName: Xcode Select ${{ parameters.xcodeVersion }}
4
- - script: xcrun simctl list
5
- displayName: List Installed Simulators
6
- - script: defaults write com.apple.iphonesimulator PasteboardAutomaticSync -bool false
7
- displayName: Disable pasteboard automatic sync
@@ -1,18 +0,0 @@
1
- steps:
2
- - task: PublishTestResults@2
3
- condition: always()
4
- inputs:
5
- testResultsFiles: 'test/reports/TEST-AppiumLibCoreTest*.xml'
6
- testRunTitle: '$(Agent.JobName)'
7
- - task: ArchiveFiles@2
8
- condition: always()
9
- inputs:
10
- rootFolderOrFile: 'test/report'
11
- archiveType: 'zip'
12
- archiveFile: '$(Build.ArtifactStagingDirectory)/$(Build.BuildId).zip'
13
- replaceExistingArchive: true
14
- - task: PublishBuildArtifacts@1
15
- condition: always()
16
- inputs:
17
- pathtoPublish: '$(Build.ArtifactStagingDirectory)'
18
- artifactName: '$(Agent.JobName)'
@@ -1,25 +0,0 @@
1
- steps:
2
- - task: NodeTool@0
3
- inputs:
4
- versionSpec: 10.x
5
- displayName: Install Node 10.x
6
- - script: npm install -g appium@${APPIUM_VERSION}
7
- displayName: Install appium beta
8
- - script: npm install -g mjpeg-consumer
9
- displayName: Install MJPEG Consumer
10
- - script: npm list --depth 2 -g || echo 'ok'
11
- displayName: Installed node dependencies
12
- - task: UseRubyVersion@0
13
- inputs:
14
- versionSpec: '2.7'
15
- - script: |
16
- mkdir -p test/report
17
- nohup appium --relaxed-security --log-timestamp --log-no-colors > test/report/appium.out 2>&1 &
18
- displayName: Run Appium in background
19
- env:
20
- JAVA_HOME: $(JAVA_HOME_11_X64)
21
- PATH: $(JAVA_HOME_11_X64)/bin:$(PATH)
22
- - script: |
23
- gem install bundler;
24
- bundle install --retry=3 --jobs=4 --path vendor/bundle;
25
- displayName: Install Gems
@@ -1,26 +0,0 @@
1
- #!/usr/bin/env bash
2
-
3
- # This script was copy-pasted from https://docs.microsoft.com/en-us/azure/devops/pipelines/languages/android?view=azure-devops#test-on-the-android-emulator
4
- # with some changes
5
-
6
- # Install AVD files
7
- declare -r emulator="system-images;android-${ANDROID_SDK_VERSION};google_apis;x86"
8
- echo "y" | ${ANDROID_HOME}/tools/bin/sdkmanager --install "$emulator"
9
-
10
- # Show a list of emulators
11
- ${ANDROID_HOME}/tools/bin/avdmanager list
12
-
13
- # Create emulator
14
- echo "no" | ${ANDROID_HOME}/tools/bin/avdmanager create avd -d "Nexus 5X" -n testemulator -k "${emulator}" --force
15
-
16
- echo ${ANDROID_HOME}/emulator/emulator -list-avds
17
-
18
- echo "Starting emulator"
19
-
20
- # Start emulator in background
21
- nohup ${ANDROID_HOME}/emulator/emulator -avd testemulator -accel auto -no-boot-anim -gpu auto -no-snapshot > /dev/null 2>&1 &
22
- ${ANDROID_HOME}/platform-tools/adb wait-for-device shell 'while [[ -z $(getprop sys.boot_completed | tr -d '\r') ]]; do sleep 1; done; input keyevent 82'
23
-
24
- ${ANDROID_HOME}/platform-tools/adb devices
25
-
26
- echo "Emulator started"
@@ -1,298 +0,0 @@
1
- # jobs for functional test
2
- parameters:
3
- vmImage: 'macOS-10.15'
4
- vmImageForIOS: 'macOS-10.15' # Not sure the reason, but macOS 10.14 instance raises no info.plist error
5
- xcodeForIOS: 12.2
6
- xcodeForTVOS: 12.2
7
- androidSDK: 30
8
- appiumVersion: 'beta'
9
- ignoreVersionSkip: true
10
- CI: true
11
-
12
-
13
- jobs:
14
- # Run unit tests on different Node versions
15
- - job: func_test_ios_base
16
- pool:
17
- vmImage: ${{ parameters.vmImageForIOS }}
18
- variables:
19
- CI: ${{ parameters.ci }}
20
- IGNORE_VERSION_SKIP: ${{ parameters.ignoreVersionSkip }}
21
- APPIUM_VERSION: ${{ parameters.appiumVersion }}
22
- steps:
23
- - template: ./functional/ios_setup.yml
24
- parameters:
25
- xcodeVersion: ${{ parameters.xcodeForIOS }}
26
- - template: ./functional/run_appium.yml
27
- - script: bundle exec rake test:func:ios TESTS=test/functional/ios/driver_test.rb,test/functional/ios/patch_test.rb
28
- displayName: Run tests func_test_ios_base
29
- - template: ./functional/publish_test_result.yml
30
-
31
- - job: func_test_ios_webdriver1
32
- pool:
33
- vmImage: ${{ parameters.vmImageForIOS }}
34
- variables:
35
- CI: ${{ parameters.ci }}
36
- IGNORE_VERSION_SKIP: ${{ parameters.ignoreVersionSkip }}
37
- APPIUM_VERSION: ${{ parameters.appiumVersion }}
38
- steps:
39
- - template: ./functional/ios_setup.yml
40
- parameters:
41
- xcodeVersion: ${{ parameters.xcodeForIOS }}
42
- - template: ./functional/run_appium.yml
43
- - script: bundle exec rake test:func:ios TESTS=test/functional/ios/webdriver/create_session_test.rb,test/functional/ios/webdriver/w3c_actions_test.rb
44
- displayName: Run tests func_test_ios_webdriver1
45
- - template: ./functional/publish_test_result.yml
46
-
47
- - job: func_test_ios_webdriver2
48
- pool:
49
- vmImage: ${{ parameters.vmImageForIOS }}
50
- variables:
51
- CI: ${{ parameters.ci }}
52
- IGNORE_VERSION_SKIP: ${{ parameters.ignoreVersionSkip }}
53
- APPIUM_VERSION: ${{ parameters.appiumVersion }}
54
- steps:
55
- - template: ./functional/ios_setup.yml
56
- parameters:
57
- xcodeVersion: ${{ parameters.xcodeForIOS }}
58
- - template: ./functional/run_appium.yml
59
- - script: bundle exec rake test:func:ios TESTS=test/functional/ios/webdriver/device_test.rb
60
- displayName: Run tests func_test_ios_webdriver2
61
- - template: ./functional/publish_test_result.yml
62
-
63
- - job: func_test_ios_ios1
64
- pool:
65
- vmImage: ${{ parameters.vmImageForIOS }}
66
- variables:
67
- CI: ${{ parameters.ci }}
68
- IGNORE_VERSION_SKIP: ${{ parameters.ignoreVersionSkip }}
69
- APPIUM_VERSION: ${{ parameters.appiumVersion }}
70
- steps:
71
- - template: ./functional/ios_setup.yml
72
- parameters:
73
- xcodeVersion: ${{ parameters.xcodeForIOS }}
74
- - template: ./functional/run_appium.yml
75
- - script: bundle exec rake test:func:ios TESTS=test/functional/ios/ios/device_test.rb
76
- displayName: Run tests func_test_ios_ios1
77
- - template: ./functional/publish_test_result.yml
78
-
79
- - job: func_test_ios_ios2
80
- pool:
81
- vmImage: ${{ parameters.vmImageForIOS }}
82
- variables:
83
- CI: ${{ parameters.ci }}
84
- IGNORE_VERSION_SKIP: ${{ parameters.ignoreVersionSkip }}
85
- APPIUM_VERSION: ${{ parameters.appiumVersion }}
86
- steps:
87
- - template: ./functional/ios_setup.yml
88
- parameters:
89
- xcodeVersion: ${{ parameters.xcodeForIOS }}
90
- - template: ./functional/run_appium.yml
91
- - script: bundle exec rake test:func:ios TESTS=test/functional/ios/ios/device_wda_attachment_test.rb,test/functional/ios/ios/search_context_test.rb
92
- displayName: Run tests func_test_ios_ios2
93
- - template: ./functional/publish_test_result.yml
94
-
95
- - job: func_test_ios_ios3
96
- pool:
97
- vmImage: ${{ parameters.vmImageForIOS }}
98
- variables:
99
- CI: ${{ parameters.ci }}
100
- IGNORE_VERSION_SKIP: ${{ parameters.ignoreVersionSkip }}
101
- APPIUM_VERSION: ${{ parameters.appiumVersion }}
102
- steps:
103
- - template: ./functional/ios_setup.yml
104
- parameters:
105
- xcodeVersion: ${{ parameters.xcodeForIOS }}
106
- - script: brew install ffmpeg && brew tap wix/brew && brew install wix/brew/applesimutils
107
- displayName: Install ffmpeg and applesimutils
108
- - template: ./functional/run_appium.yml
109
- - script: bundle exec rake test:func:ios TESTS=test/functional/ios/ios/mjpeg_server_test.rb,test/functional/ios/ios/mobile_commands_test.rb
110
- displayName: Run tests func_test_ios_ios3
111
- - template: ./functional/publish_test_result.yml
112
-
113
- - job: func_test_ios_tvos
114
- pool:
115
- vmImage: ${{ parameters.vmImage }}
116
- variables:
117
- CI: ${{ parameters.ci }}
118
- IGNORE_VERSION_SKIP: ${{ parameters.ignoreVersionSkip }}
119
- APPIUM_VERSION: ${{ parameters.appiumVersion }}
120
- steps:
121
- - template: ./functional/ios_setup.yml
122
- parameters:
123
- xcodeVersion: ${{ parameters.xcodeForTVOS }}
124
- - template: ./functional/run_appium.yml
125
- - script: bundle exec rake test:func:ios TESTS=test/functional/ios/tv_driver_test.rb
126
- displayName: Run tests func_test_ios_tvos
127
- - template: ./functional/publish_test_result.yml
128
-
129
- # Skip since opencv4nodejs fails to install on the macOS instance
130
- # - job: func_test_ios_opencv
131
- # pool:
132
- # vmImage: ${{ parameters.vmImageForIOS }}
133
- # variables:
134
- # CI: ${{ parameters.ci }}
135
- # IGNORE_VERSION_SKIP: ${{ parameters.ignoreVersionSkip }}
136
- # APPIUM_VERSION: ${{ parameters.appiumVersion }}
137
- # steps:
138
- # - template: ./functional/ios_setup.yml
139
- # parameters:
140
- # xcodeVersion: ${{ parameters.xcodeForIOS }}
141
- # - template: ./functional/run_appium.yml
142
- # - script: npm install -g opencv4nodejs@5.1.0
143
- # displayName: Install opencv4nodejs@5.1.0
144
- # - script: bundle exec rake test:func:ios test/functional/ios/ios/image_comparison_test.rb
145
- # displayName: Run tests
146
- # - template: ./functional/publish_test_result.yml
147
-
148
-
149
- - job: func_test_android_base
150
- pool:
151
- vmImage: ${{ parameters.vmImage }}
152
- variables:
153
- CI: ${{ parameters.ci }}
154
- ANDROID_SDK_VERSION: ${{ parameters.androidSDK }}
155
- IGNORE_VERSION_SKIP: ${{ parameters.ignoreVersionSkip }}
156
- APPIUM_VERSION: ${{ parameters.appiumVersion }}
157
- strategy:
158
- matrix:
159
- uiautomator2:
160
- AUTOMATION_NAME_DROID: 'uiautomator2'
161
- espresso:
162
- AUTOMATION_NAME_DROID: 'espresso'
163
- steps:
164
- - template: ./functional/android_setup.yml
165
- - template: ./functional/run_appium.yml
166
- - script: bundle exec rake test:func:android TESTS=test/functional/android/driver_test.rb,test/functional/android/patch_test.rb
167
- displayName: Run tests func_test_android_base
168
- - template: ./functional/publish_test_result.yml
169
-
170
- - job: func_test_android_webdriver
171
- pool:
172
- vmImage: ${{ parameters.vmImage }}
173
- variables:
174
- CI: ${{ parameters.ci }}
175
- ANDROID_SDK_VERSION: ${{ parameters.androidSDK }}
176
- IGNORE_VERSION_SKIP: ${{ parameters.ignoreVersionSkip }}
177
- APPIUM_VERSION: ${{ parameters.appiumVersion }}
178
- strategy:
179
- matrix:
180
- uiautomator2:
181
- AUTOMATION_NAME_DROID: 'uiautomator2'
182
- espresso:
183
- AUTOMATION_NAME_DROID: 'espresso'
184
- steps:
185
- - template: ./functional/android_setup.yml
186
- - template: ./functional/run_appium.yml
187
- - script: bundle exec rake test:func:android TESTS=test/functional/android/webdriver/create_session_test.rb,test/functional/android/webdriver/device_test.rb,test/functional/android/webdriver/w3c_actions_test.rb
188
- displayName: Run tests func_test_android_webdriver
189
- - template: ./functional/publish_test_result.yml
190
-
191
- - job: func_test_android_android1
192
- pool:
193
- vmImage: ${{ parameters.vmImage }}
194
- variables:
195
- CI: ${{ parameters.ci }}
196
- ANDROID_SDK_VERSION: ${{ parameters.androidSDK }}
197
- IGNORE_VERSION_SKIP: ${{ parameters.ignoreVersionSkip }}
198
- APPIUM_VERSION: ${{ parameters.appiumVersion }}
199
- strategy:
200
- matrix:
201
- uiautomator2:
202
- AUTOMATION_NAME_DROID: 'uiautomator2'
203
- espresso:
204
- AUTOMATION_NAME_DROID: 'espresso'
205
- steps:
206
- - template: ./functional/android_setup.yml
207
- - template: ./functional/run_appium.yml
208
- - script: bundle exec rake test:func:android TESTS=test/functional/android/android/device_test.rb
209
- displayName: Run tests func_test_android_android1
210
- - template: ./functional/publish_test_result.yml
211
-
212
- - job: func_test_android_android2
213
- pool:
214
- vmImage: ${{ parameters.vmImage }}
215
- variables:
216
- CI: ${{ parameters.ci }}
217
- ANDROID_SDK_VERSION: ${{ parameters.androidSDK }}
218
- IGNORE_VERSION_SKIP: ${{ parameters.ignoreVersionSkip }}
219
- APPIUM_VERSION: ${{ parameters.appiumVersion }}
220
- strategy:
221
- matrix:
222
- uiautomator2:
223
- AUTOMATION_NAME_DROID: 'uiautomator2'
224
- espresso:
225
- AUTOMATION_NAME_DROID: 'espresso'
226
- steps:
227
- - template: ./functional/android_setup.yml
228
- - template: ./functional/run_appium.yml
229
- - script: bundle exec rake test:func:android TESTS=test/functional/android/android/search_context_test.rb,test/functional/android/android/mjpeg_server_test.rb
230
- displayName: Run tests func_test_android_android2
231
- - template: ./functional/publish_test_result.yml
232
-
233
- - job: func_test_android_android3
234
- pool:
235
- vmImage: ${{ parameters.vmImage }}
236
- variables:
237
- CI: ${{ parameters.ci }}
238
- ANDROID_SDK_VERSION: ${{ parameters.androidSDK }}
239
- IGNORE_VERSION_SKIP: ${{ parameters.ignoreVersionSkip }}
240
- APPIUM_VERSION: ${{ parameters.appiumVersion }}
241
- strategy:
242
- matrix:
243
- uiautomator2:
244
- AUTOMATION_NAME_DROID: 'uiautomator2'
245
- espresso:
246
- AUTOMATION_NAME_DROID: 'espresso'
247
- steps:
248
- - template: ./functional/android_setup.yml
249
- - template: ./functional/run_appium.yml
250
- - script: bundle exec rake test:func:android TESTS=test/functional/android/android/device_data_test.rb
251
- displayName: Run tests func_test_android_android3
252
- - template: ./functional/publish_test_result.yml
253
-
254
- - job: func_test_android_mobile_command_espresso
255
- pool:
256
- vmImage: ${{ parameters.vmImage }}
257
- variables:
258
- CI: ${{ parameters.ci }}
259
- ANDROID_SDK_VERSION: ${{ parameters.androidSDK }}
260
- AUTOMATION_NAME_DROID: espresso
261
- IGNORE_VERSION_SKIP: ${{ parameters.ignoreVersionSkip }}
262
- APPIUM_VERSION: ${{ parameters.appiumVersion }}
263
- strategy:
264
- matrix:
265
- uiautomator2:
266
- AUTOMATION_NAME_DROID: 'uiautomator2'
267
- espresso:
268
- AUTOMATION_NAME_DROID: 'espresso'
269
- steps:
270
- - template: ./functional/android_setup.yml
271
- - template: ./functional/run_appium.yml
272
- - script: bundle exec rake test:func:android TESTS=test/functional/android/android/mobile_commands_test.rb
273
- displayName: Run tests func_test_android_mobile_command_espresso
274
- - template: ./functional/publish_test_result.yml
275
-
276
- # Skip since opencv4nodejs fails to install on the macOS instance
277
- # - job: func_test_android_opencv
278
- # pool:
279
- # vmImage: ${{ parameters.vmImage }}
280
- # variables:
281
- # CI: ${{ parameters.ci }}
282
- # ANDROID_SDK_VERSION: ${{ parameters.androidSDK }}
283
- # IGNORE_VERSION_SKIP: ${{ parameters.ignoreVersionSkip }}
284
- # APPIUM_VERSION: ${{ parameters.appiumVersion }}
285
- # strategy:
286
- # matrix:
287
- # uiautomator2:
288
- # AUTOMATION_NAME_DROID: 'uiautomator2'
289
- # espresso:
290
- # AUTOMATION_NAME_DROID: 'espresso'
291
- # steps:
292
- # - template: ./functional/android_setup.yml
293
- # - template: ./functional/run_appium.yml
294
- # - script: npm install -g opencv4nodejs@5.1.0
295
- # displayName: Install opencv4nodejs@5.1.0
296
- # - script: bundle exec rake test:func:android TESTS=test/functional/android/android/image_comparison_test.rb
297
- # displayName: Run tests func_test_android_opencv
298
- # - template: ./functional/publish_test_result.yml
@@ -1,34 +0,0 @@
1
- # Mobile Command
2
-
3
- Appium has `mobile:` command.
4
- We can invoke them via `execute_script` command with `mobile:` arguments.
5
-
6
- - root:
7
- - https://github.com/appium/appium/blob/master/commands-yml/commands/mobile-command.yml
8
- - Android:
9
- - https://github.com/appium/appium/blob/master/docs/en/writing-running-appium/android
10
- - iOS:
11
- - https://github.com/appium/appium/tree/master/docs/en/writing-running-appium/ios
12
-
13
-
14
- ```ruby
15
- # Android shell : https://github.com/appium/appium/blob/master/docs/en/writing-running-appium/android/android-shell.md
16
- args = { command: 'echo', args: 'list' }
17
- @driver.execute_script 'mobile: shell', args # Run `adb shell echo 'list'`
18
-
19
- # iOS performance : https://github.com/appium/appium/blob/master/docs/en/writing-running-appium/ios/ios-xctest-performance.md
20
- args = { timeout: 60 * 1000, profileName: 'Activity Monitor' }
21
- @driver.execute_script 'mobile: startPerfRecord', args
22
-
23
- @driver.execute_script 'mobile: stopPerfRecord', { profileName: 'Activity Monitor' }
24
- ```
25
-
26
- Mobile commands return their error messages. As a selenium client, it usually handles as unknown error.
27
- To handle it, we would recommend you to handle the error based on the error message.
28
-
29
- ```ruby
30
- error = assert_raises ::Selenium::WebDriver::Error::UnknownError do
31
- @driver.execute_script 'mobile: scrollToPage', { element: el.ref, scrollToPage: -100 }
32
- end
33
- assert error.message.include? 'be a non-negative integer'
34
- ```