appium_lib 16.3.0 → 16.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/.rubocop.yml DELETED
@@ -1,299 +0,0 @@
1
- AllCops:
2
- TargetRubyVersion: 3.1
3
- Layout/LineLength:
4
- Max: 128
5
- Metrics/MethodLength:
6
- Enabled: false
7
- Metrics/ModuleLength:
8
- Enabled: false
9
- Metrics/ClassLength:
10
- Enabled: false
11
- Metrics/CyclomaticComplexity:
12
- Enabled: false
13
- Metrics/PerceivedComplexity:
14
- Enabled: false
15
- Metrics/AbcSize:
16
- Enabled: false
17
- Metrics/BlockLength:
18
- Enabled: false
19
- Style/Documentation:
20
- Enabled: false
21
- Style/RegexpLiteral:
22
- Enabled: false
23
- # blocked on https://github.com/appium/ruby_lib/issues/312. Already removed from core part
24
- Style/GlobalVars:
25
- Enabled: false
26
- Style/PercentLiteralDelimiters:
27
- Enabled: false
28
- Style/CommentedKeyword:
29
- Enabled: false
30
- Naming/AccessorMethodName:
31
- Enabled: false
32
- Naming/RescuedExceptionsVariableName:
33
- Enabled: false
34
- Layout/HeredocIndentation:
35
- Enabled: false
36
- Layout/RescueEnsureAlignment:
37
- Enabled: false
38
- Layout/HashAlignment:
39
- Enabled: false
40
- Style/ExplicitBlockArgument:
41
- Enabled: false
42
- Style/OptionalBooleanParameter:
43
- Enabled: false
44
- Naming/MethodParameterName:
45
- Enabled: false
46
- Style/KeywordParametersOrder:
47
- Enabled: false
48
- Style/AccessorGrouping:
49
- Enabled: false
50
- Style/StringConcatenation:
51
- Enabled: false
52
- Lint/NonDeterministicRequireOrder:
53
- Enabled: false
54
- Gemspec/DeprecatedAttributeAssignment:
55
- Enabled: true
56
- Layout/LineEndStringConcatenationIndentation:
57
- Enabled: true
58
- Layout/SpaceBeforeBrackets:
59
- Enabled: true
60
- Lint/AmbiguousAssignment:
61
- Enabled: true
62
- Lint/AmbiguousOperatorPrecedence:
63
- Enabled: false
64
- Lint/AmbiguousRange:
65
- Enabled: true
66
- Lint/DeprecatedConstants:
67
- Enabled: true
68
- Lint/DuplicateBranch:
69
- Enabled: true
70
- Lint/DuplicateRegexpCharacterClassElement:
71
- Enabled: true
72
- Lint/EmptyBlock:
73
- Enabled: true
74
- Lint/EmptyClass:
75
- Enabled: false
76
- Lint/EmptyInPattern:
77
- Enabled: true
78
- Lint/IncompatibleIoSelectWithFiberScheduler:
79
- Enabled: true
80
- Lint/LambdaWithoutLiteralBlock:
81
- Enabled: true
82
- Lint/NoReturnInBeginEndBlocks:
83
- Enabled: true
84
- Lint/NumberedParameterAssignment:
85
- Enabled: true
86
- Lint/OrAssignmentToConstant:
87
- Enabled: true
88
- Lint/RedundantDirGlobSort:
89
- Enabled: true
90
- Lint/RequireRelativeSelfPath:
91
- Enabled: true
92
- Lint/SymbolConversion:
93
- Enabled: true
94
- Lint/ToEnumArguments:
95
- Enabled: true
96
- Lint/TripleQuotes:
97
- Enabled: true
98
- Lint/UnexpectedBlockArity:
99
- Enabled: true
100
- Lint/UnmodifiedReduceAccumulator:
101
- Enabled: true
102
- Security/IoMethods:
103
- Enabled: true
104
- Style/ArgumentsForwarding:
105
- Enabled: true
106
- Style/CollectionCompact:
107
- Enabled: true
108
- Style/DocumentDynamicEvalDefinition:
109
- Enabled: true
110
- Style/EndlessMethod:
111
- Enabled: true
112
- Style/HashConversion:
113
- Enabled: false
114
- Style/HashExcept:
115
- Enabled: true
116
- Style/IfWithBooleanLiteralBranches:
117
- Enabled: true
118
- Style/InPatternThen:
119
- Enabled: true
120
- Style/MultilineInPatternThen:
121
- Enabled: true
122
- Style/NegatedIfElseCondition:
123
- Enabled: true
124
- Style/NilLambda:
125
- Enabled: true
126
- Style/NumberedParameters:
127
- Enabled: true
128
- Style/NumberedParametersLimit:
129
- Enabled: true
130
- Style/QuotedSymbols:
131
- Enabled: true
132
- Style/RedundantArgument:
133
- Enabled: true
134
- Style/RedundantSelfAssignmentBranch:
135
- Enabled: true
136
- Style/SelectByRegexp:
137
- Enabled: true
138
- Style/StringChars:
139
- Enabled: true
140
- Style/SwapValues:
141
- Enabled: true
142
- Gemspec/DevelopmentDependencies: # new in 1.44
143
- Enabled: true
144
- Layout/LineContinuationLeadingSpace: # new in 1.31
145
- Enabled: true
146
- Layout/LineContinuationSpacing: # new in 1.31
147
- Enabled: true
148
- Lint/ConstantOverwrittenInRescue: # new in 1.31
149
- Enabled: true
150
- Lint/DuplicateMagicComment: # new in 1.37
151
- Enabled: true
152
- Lint/NonAtomicFileOperation: # new in 1.31
153
- Enabled: false
154
- Lint/RefinementImportMethods: # new in 1.27
155
- Enabled: true
156
- Lint/RequireRangeParentheses: # new in 1.32
157
- Enabled: true
158
- Lint/UselessRescue: # new in 1.43
159
- Enabled: true
160
- Metrics/CollectionLiteralLength: # new in 1.47
161
- Enabled: true
162
- Naming/BlockForwarding: # new in 1.24
163
- Enabled: true
164
- Security/CompoundHash: # new in 1.28
165
- Enabled: true
166
- Style/ArrayIntersect: # new in 1.40
167
- Enabled: true
168
- Style/ComparableClamp: # new in 1.44
169
- Enabled: true
170
- Style/ConcatArrayLiterals: # new in 1.41
171
- Enabled: true
172
- Style/DirEmpty: # new in 1.48
173
- Enabled: true
174
- Style/EmptyHeredoc: # new in 1.32
175
- Enabled: true
176
- Style/EnvHome: # new in 1.29
177
- Enabled: true
178
- Style/FetchEnvVar: # new in 1.28
179
- Enabled: true
180
- Style/FileEmpty: # new in 1.48
181
- Enabled: true
182
- Style/FileRead: # new in 1.24
183
- Enabled: true
184
- Style/FileWrite: # new in 1.24
185
- Enabled: true
186
- Style/MagicCommentFormat: # new in 1.35
187
- Enabled: true
188
- Style/MapCompactWithConditionalBlock: # new in 1.30
189
- Enabled: true
190
- Style/MapToHash: # new in 1.24
191
- Enabled: true
192
- Style/MapToSet: # new in 1.42
193
- Enabled: true
194
- Style/MinMaxComparison: # new in 1.42
195
- Enabled: true
196
- Style/NestedFileDirname: # new in 1.26
197
- Enabled: true
198
- Style/ObjectThen: # new in 1.28
199
- Enabled: true
200
- Style/OperatorMethodCall: # new in 1.37
201
- Enabled: true
202
- Style/RedundantConstantBase: # new in 1.40
203
- Enabled: false
204
- Style/RedundantDoubleSplatHashBraces: # new in 1.41
205
- Enabled: true
206
- Style/RedundantEach: # new in 1.38
207
- Enabled: true
208
- Style/RedundantHeredocDelimiterQuotes: # new in 1.45
209
- Enabled: true
210
- Style/RedundantInitialize: # new in 1.27
211
- Enabled: true
212
- Style/RedundantStringEscape: # new in 1.37
213
- Enabled: true
214
- Gemspec/RequireMFA: # new in 1.23
215
- Enabled: true
216
- Lint/UselessRuby2Keywords: # new in 1.23
217
- Enabled: true
218
- Style/OpenStructUse: # new in 1.23
219
- Enabled: false
220
- Lint/RedundantStringCoercion:
221
- Enabled: false
222
- Gemspec/AddRuntimeDependency: # new in 1.65
223
- Enabled: true
224
- Lint/ConstantReassignment: # new in 1.70
225
- Enabled: true
226
- Lint/DuplicateMatchPattern: # new in 1.50
227
- Enabled: true
228
- Lint/DuplicateSetElement: # new in 1.67
229
- Enabled: true
230
- Lint/HashNewWithKeywordArgumentsAsDefault: # new in 1.69
231
- Enabled: true
232
- Lint/ItWithoutArgumentsInBlock: # new in 1.59
233
- Enabled: true
234
- Lint/LiteralAssignmentInCondition: # new in 1.58
235
- Enabled: true
236
- Lint/MixedCaseRange: # new in 1.53
237
- Enabled: true
238
- Lint/NumericOperationWithConstantResult: # new in 1.69
239
- Enabled: true
240
- Lint/RedundantRegexpQuantifiers: # new in 1.53
241
- Enabled: true
242
- Lint/SharedMutableDefault: # new in 1.70
243
- Enabled: true
244
- Lint/UnescapedBracketInRegexp: # new in 1.68
245
- Enabled: true
246
- Lint/UselessDefined: # new in 1.69
247
- Enabled: true
248
- Lint/UselessNumericOperation: # new in 1.66
249
- Enabled: true
250
- Style/AmbiguousEndlessMethodDefinition: # new in 1.68
251
- Enabled: true
252
- Style/BitwisePredicate: # new in 1.68
253
- Enabled: true
254
- Style/CombinableDefined: # new in 1.68
255
- Enabled: true
256
- Style/DataInheritance: # new in 1.49
257
- Enabled: true
258
- Style/DigChain: # new in 1.69
259
- Enabled: true
260
- Style/ExactRegexpMatch: # new in 1.51
261
- Enabled: true
262
- Style/FileNull: # new in 1.69
263
- Enabled: true
264
- Style/FileTouch: # new in 1.69
265
- Enabled: true
266
- Style/ItAssignment: # new in 1.70
267
- Enabled: true
268
- Style/KeywordArgumentsMerging: # new in 1.68
269
- Enabled: true
270
- Style/MapIntoArray: # new in 1.63
271
- Enabled: true
272
- Style/RedundantArrayConstructor: # new in 1.52
273
- Enabled: true
274
- Style/RedundantCurrentDirectoryInPath: # new in 1.53
275
- Enabled: true
276
- Style/RedundantFilterChain: # new in 1.52
277
- Enabled: true
278
- Style/RedundantInterpolationUnfreeze: # new in 1.66
279
- Enabled: true
280
- Style/RedundantLineContinuation: # new in 1.49
281
- Enabled: true
282
- Style/RedundantRegexpArgument: # new in 1.53
283
- Enabled: true
284
- Style/RedundantRegexpConstructor: # new in 1.52
285
- Enabled: true
286
- Style/ReturnNilInPredicateMethodDefinition: # new in 1.53
287
- Enabled: true
288
- Style/SafeNavigationChainLength: # new in 1.68
289
- Enabled: false
290
- Style/SendWithLiteralMethodName: # new in 1.64
291
- Enabled: true
292
- Style/SingleLineDoEndBlock: # new in 1.57
293
- Enabled: true
294
- Style/SuperArguments: # new in 1.64
295
- Enabled: true
296
- Style/SuperWithArgsParentheses: # new in 1.58
297
- Enabled: true
298
- Style/YAMLFileRead: # new in 1.53
299
- Enabled: true
data/Gemfile DELETED
@@ -1,25 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- # Licensed under the Apache License, Version 2.0 (the "License");
4
- # you may not use this file except in compliance with the License.
5
- # You may obtain a copy of the License at
6
- #
7
- # http://www.apache.org/licenses/LICENSE-2.0
8
- #
9
- # Unless required by applicable law or agreed to in writing, software
10
- # distributed under the License is distributed on an "AS IS" BASIS,
11
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
- # See the License for the specific language governing permissions and
13
- # limitations under the License.
14
-
15
- source 'https://rubygems.org'
16
- gemspec
17
-
18
- gem 'appium_thor', '~> 2.0'
19
- gem 'hashdiff', '~> 1.2.0'
20
- gem 'minitest', '~> 5.0'
21
- gem 'minitest-reporters', '~> 1.1'
22
- gem 'pry'
23
- gem 'rake', '~> 13.0'
24
- gem 'rubocop', '1.86.1'
25
- gem 'yard', '~> 0.9.11'
data/Rakefile DELETED
@@ -1,31 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- # Licensed under the Apache License, Version 2.0 (the "License");
4
- # you may not use this file except in compliance with the License.
5
- # You may obtain a copy of the License at
6
- #
7
- # http://www.apache.org/licenses/LICENSE-2.0
8
- #
9
- # Unless required by applicable law or agreed to in writing, software
10
- # distributed under the License is distributed on an "AS IS" BASIS,
11
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
- # See the License for the specific language governing permissions and
13
- # limitations under the License.
14
-
15
- require 'bundler/gem_tasks'
16
- require 'rubocop/rake_task'
17
- require 'rake/testtask'
18
-
19
- desc 'Execute RuboCop static code analysis'
20
- RuboCop::RakeTask.new(:rubocop) do |t|
21
- t.patterns = %w(lib ios_tests android_tests)
22
- t.options = %w(-D)
23
- t.fail_on_error = true
24
- end
25
-
26
- desc('Run all unit tests in test directory')
27
- Rake::TestTask.new(:test) do |t|
28
- t.libs << 'test'
29
- t.libs << 'lib'
30
- t.test_files = FileList[ENV['TESTS'] ? ENV['TESTS'].split(',') : 'test/**/*_test.rb']
31
- end
data/Thorfile DELETED
@@ -1,7 +0,0 @@
1
- require 'appium_thor'
2
-
3
- Appium::Thor::Config.set do
4
- gem_name 'appium_lib'
5
- github_name 'ruby_lib'
6
- version_file 'lib/appium_lib/version.rb'
7
- end
data/contributing.md DELETED
@@ -1,35 +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
- If you'd like to adding new driver commands, please refer to https://github.com/appium/ruby_lib_core
6
-
7
- ## Tests
8
-
9
- - Tests are run against [appium's master branch](https://github.com/appium/appium/blob/master/docs/en/contributing-to-appium/appium-from-source.md)
10
- - The tests are run using the [flaky gem](https://github.com/appium/flaky) on OS X
11
- - The `arc` command can be run from within the `ios_tests` or `android_tests` folder to open an interactive console
12
-
13
- ### Run iOS tests
14
-
15
- iOS tests are run on the iPhone 6 / iOS 9.3 simulator.
16
-
17
- - `cd ios_tests`
18
- - `flake 3 ios` - Run all the iOS tests up to 3 times
19
-
20
- ### Run Android tests
21
-
22
- Android tests require running on physical hardware with Android 5.0 (API 21). The emulator is unreliable.
23
-
24
- - `cd android_tests`
25
- - `flake 3 android` - Run all the Android tests up to 3 times
26
-
27
- ## Publishing
28
-
29
- 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)
30
- > $ curl -u username https://rubygems.org/api/v1/api_key.yaml >
31
- ~/.gem/credentials; chmod 0600 ~/.gem/credentials
32
-
33
- 1. Bump the version number: `thor bump` (`bumpy`, `bumpz`)
34
- 2. Update `CHANGELOG.md`
35
- 3. Generate release note, publish release gem and push the tag to this repository: `thor release`
@@ -1,17 +0,0 @@
1
- # Help debugging
2
-
3
- - `adb shell uiautomator events`
4
- - Prints out accessibility events to the console until the connection to the device is terminated
5
- - [URL](https://stuff.mit.edu/afs/sipb/project/android/docs/tools/help/uiautomator/index.html)
6
- - **notice**
7
- - If Appium is started then it terminates the other `uiautomator` processes
8
-
9
- # uiautomator2
10
- ## difference between uiautomator1 and uiautomator2
11
- - `find_element/s :id, "ids"`
12
- - uiautomator1
13
- - Find elements with `resource_id`
14
- - Find elements with string id resource(string.xml based)
15
- - uiautomator2
16
- - Find elements with `resource_id`
17
- - from: Does not appium-uiautomator2-server support finding string ids with "id" strategy? [issue](https://github.com/appium/appium/issues/8349)
data/docs/docs.md DELETED
@@ -1,130 +0,0 @@
1
- # Documentation
2
- ## API Doc of Ruby Client
3
- - This library: http://www.rubydoc.info/github/appium/ruby_lib
4
- - Core: http://www.rubydoc.info/github/appium/ruby_lib_core
5
- - [Ruby selenium-webdriver](https://github.com/SeleniumHQ/selenium/wiki/Ruby-Bindings)
6
-
7
- ### General
8
- - [Appium](https://github.com/appium/appium/blob/master/README.md)
9
- - [Supported platforms](https://github.com/appium/appium/blob/master/docs/en/about-appium/platform-support.md)
10
- - [All methods supported by Appium](https://github.com/appium/appium-base-driver/blob/master/docs/mjsonwp/protocol-methods.md)
11
- - Fundamental Commands: http://appium.io/docs/en/commands/status/ etc
12
- - [MiniTest Expectations](http://docs.seattlerb.org/minitest/Minitest/Expectations.html)
13
-
14
- ### Driver types in Ruby Client
15
-
16
- ```ruby
17
- # Appium specific driver with helpers available extending Standard Appium Driver.
18
- @appium_driver = Appium::Driver.new @options, false
19
-
20
- # Standard Appium Driver extends Selenium WebDriver.
21
- @selenium_driver = @appium_driver.start_driver
22
- ```
23
-
24
- ### Example
25
-
26
- Example of automating the built in Android settings.
27
-
28
- ```ruby
29
- # run Pry, and paste the following
30
- apk = {
31
- platformName: 'android',
32
- deviceName: :nexus,
33
- appPackage: 'com.android.settings',
34
- appActivity: '.Settings',
35
- appWaitActivity: '.Settings'
36
- }
37
- Appium::Driver.new({caps: apk}, false).start_driver
38
- ```
39
-
40
- Example use of Appium's mobile gesture.
41
-
42
-
43
- Long click on an ImageView in Android.
44
-
45
- ```
46
- last_image = find_elements(:class, 'ImageView').last
47
- long_press(element: last_image)
48
- ```
49
-
50
- Rotate examples. The behaviour is depends on devices.
51
-
52
- ```ruby
53
- driver.rotate :landscape
54
- driver.rotate :portrait
55
- ```
56
-
57
- - `appium_server_version` Discover the Appium rev running on the server.
58
- - `element.send_keys "msg"` Sends keys to currently active element
59
-
60
-
61
- ### APIs
62
-
63
- ```ruby
64
- e.name # button, text
65
- e.value # secure, textfield
66
- e.type 'some text' # type text into textfield
67
- e.clear # clear textfield
68
- e.tag_name # calls .type (patch.rb)
69
- e.text
70
- e.size
71
- e.location
72
- e.location_rel
73
- e.click
74
- e.send_keys 'keys to send'
75
- e.displayed? # true or false depending if the element is visible
76
- e.selected? # is the tab selected?
77
- e.attribute('checked') # is the checkbox checked?
78
-
79
-
80
- # alert example without helper methods
81
- alert = @driver.switch_to.alert
82
- alert.text
83
- alert.accept
84
- alert.dismiss
85
-
86
- # Secure textfield example.
87
- #
88
- # Find using default value
89
- s = textfield 'Password'
90
- # Enter password
91
- s.send_keys 'hello'
92
- # Check value
93
- s.value == ios_password('hello'.length)
94
- ```
95
-
96
- --
97
-
98
- #### Driver
99
- - `start_driver` will restart the driver.
100
- - `x` will quit the driver and exit Pry.
101
- - `execute_script` calls `@driver.execute_script`
102
- - `find_element` calls `@driver.find_element`
103
- - `find_elements` calls `@driver.find_elements`
104
- - `no_wait` will set implicit wait to 0. `@driver.manage.timeouts.implicit_wait = 0`
105
- - `set_wait` will set implicit wait to default seconds. `@driver.manage.timeouts.implicit_wait = default`
106
- - `set_wait(timeout_seconds)` will set implicit wait to desired timeout. `@driver.manage.timeouts.implicit_wait = timeout`
107
- - `.click` to tap an element.
108
- - `.send_keys` or `.type` to type on an element.
109
-
110
- #### Cucumber Sauce Integration
111
-
112
- Reset after each test and when done report the result to Sauce after quiting the driver.
113
-
114
- ```ruby
115
- require 'rest_client' # https://github.com/archiloque/rest-client
116
- require 'json' # for .to_json
117
- require 'sauce_whisk'
118
-
119
- After do |scenario|
120
- # end the test session, ignoring any exceptions.
121
- ignore { $driver.driver_quit }
122
-
123
- user = ENV['SAUCE_USERNAME']
124
- key = ENV['SAUCE_ACCESS_KEY']
125
- if user && !user.empty? && key && !key.empty?
126
- passed = ! scenario.failed?
127
- SauceWhisk::Jobs.change_status $driver.driver.session_id, passed
128
- end
129
- end
130
- ```
data/docs/ios_xcuitest.md DELETED
@@ -1,114 +0,0 @@
1
- ## XCUITest
2
- - Over Appium1.6.0 provides `XCUITest` automation name based on WebDriverAgent.
3
- - [appium-xcuitest-driver](https://github.com/appium/appium-xcuitest-driver)
4
- - [WebDriverAgent](https://github.com/facebook/WebDriverAgent)
5
- - How to migrate XCUITest from UIAutomation
6
- - [Migrating your iOS tests from UIAutomation](https://github.com/appium/appium/blob/v1.6.2/docs/en/advanced-concepts/migrating-to-xcuitest.md)
7
- - Mobile gestures for XCUITest
8
- - [ios-xctest-mobile-gestures](https://github.com/appium/appium/blob/master/docs/en/writing-running-appium/ios/ios-xctest-mobile-gestures.md)
9
- - Required Appium1.6.4+
10
-
11
- ## find elements
12
- - supported elements by find_element are:
13
- - [appium-xcuitest-driver](https://github.com/appium/appium-xcuitest-driver/blob/master/lib/commands/find.js#L17)
14
- - [locatorStrategies](https://github.com/appium/appium-xcuitest-driver/blob/95886f1118d71fe950768f8262179d3608b40fc7/lib/driver.js#L81)
15
- - [WebDriverAgent](https://github.com/facebook/WebDriverAgent/blob/8346199212bffceab24192e81bc0118d65132466/WebDriverAgentLib/Commands/FBFindElementCommands.m#L111)
16
- - Mapping
17
- - https://github.com/facebook/WebDriverAgent/blob/master/WebDriverAgentLib/Utilities/FBElementTypeTransformer.m#L19
18
-
19
- ### with except for XPath and Predicate
20
- #### examples
21
- - [button_class](https://github.com/appium/ruby_lib/blob/master/lib/appium_lib/ios/element/button.rb#L8), [static_text_class](https://github.com/appium/ruby_lib/blob/master/lib/appium_lib/ios/element/text.rb#L8), [text_field_class](https://github.com/appium/ruby_lib/blob/master/lib/appium_lib/ios/element/textfield.rb#L10) and [secure_text_field_class](https://github.com/appium/ruby_lib/blob/master/lib/appium_lib/ios/element/textfield.rb#L15) provide class name.
22
- - If `automationName` is `Appium` or `nil`, then they provide `UIAxxxx`
23
- - If `automationName` is `XCUITest`, then they provide `XCUIElementTypexxx`
24
-
25
- ```ruby
26
- find_element(:class, button_class) # Return a element of XCUIElementTypeButton for XCUITest
27
- ```
28
-
29
- - [tag/s](https://github.com/appium/ruby_lib/blob/ac03116756a72fbd624fa32ea886123b955d7089/lib/appium_lib/android/helper.rb#L238) is alias of `find_element :class, element`
30
-
31
- - `accessibility_id`
32
-
33
- ```ruby
34
- find_element(:accessibility_id, element) # Return a element which has accessibilityIdentifier, `element`.
35
- ```
36
-
37
- - `button/s(value)`, `button_exact/buttons_exact`, `text/s(value)`, `text_exact/texts_exact`
38
- ```ruby
39
- buttons(value) # Return button elements include `value` as its name attributes.
40
- ```
41
-
42
- ### with Predicate
43
- - We recommend to use predicate strategy instead of XPath strategy.
44
- - e.g. `find_ele_by_predicate/find_eles_by_predicate`, `find_ele_by_predicate_include/find_eles_by_predicate_include`
45
- - A helpful cheatsheet for predicate
46
- - https://realm.io/news/nspredicate-cheatsheet/
47
- - For XCUITest(WebDriverAgent), without 'wd' prefixes are supported.
48
- - https://github.com/facebook/WebDriverAgent/wiki/Queries
49
- - For example, `%(name ==[c] "#{value}" || label ==[c] "#{value}" || value ==[c] "#{value}")` is equal to `%(wdName ==[c] "#{value}" || wdLabel ==[c] "#{value}" || wdValue ==[c] "#{value}")` in WebDriverAgent.
50
-
51
- #### examples
52
- - `textfield/s(value)`, `find/s`, `find_exact/finds_exact`, `find_ele_by_predicate/find_eles_by_predicate` and `find_ele_by_predicate_include/find_eles_by_predicate_include` use predicate strategy in their method.
53
-
54
- ```ruby
55
- textfield(value) # Return a XCUIElementTypeSecureTextField or XCUIElementTypeTextField element which has `value` text.
56
- finds_exact(value) # Return any elements include `value` as its name attributes.
57
- ```
58
-
59
- ### with Class Chain
60
- - require Appium 1.6.4+
61
- - https://github.com/appium/appium-xcuitest-driver/pull/391
62
- - https://github.com/appium/java-client/pull/599/files
63
- - WebDriverAgent
64
- - https://github.com/facebook/WebDriverAgent/wiki/Queries
65
-
66
- ### with XPath
67
- - It is better to avoid XPath strategy.
68
- - https://github.com/appium/appium/blob/v1.6.2/docs/en/advanced-concepts/migrating-to-xcuitest.md#xpath-locator-strategy
69
- - > Try not to use XPath locators unless there are absolutely no other alternatives. In general, XPath locators might be times slower, than other types of locators like accessibility id, class name and predicate (up to 100 times slower in some special cases). They are so slow because XPath location is not natively supported by Apple's XCTest framework.
70
- - Improved performance a bit
71
- - https://github.com/appium/appium/issues/6842
72
- - https://github.com/facebook/WebDriverAgent/issues/306
73
- - XPath in WebDriverAgent
74
- - https://github.com/facebook/WebDriverAgent/blob/2158a8d0f305549532f1338fe1e4628cfbd53cd9/WebDriverAgentLib/Categories/XCElementSnapshot%2BFBHelpers.m#L57
75
-
76
- #### examples
77
-
78
- ```ruby
79
- xpaths("//some xpaths")
80
- ```
81
-
82
- ## Gesture
83
- - `mobile:` commands are provided by WDA.
84
- - Documentations
85
- - https://github.com/appium/appium/blob/master/docs/en/writing-running-appium/ios/ios-xctest-mobile-gestures.md
86
- - Specs by test code
87
- - https://github.com/appium/appium-xcuitest-driver/blob/master/test/functional/basic/gesture-e2e-specs.js
88
-
89
- ### Workaround
90
- - `mobile:` commands depends on WDA and Apple's framework and the behaviour depends on them.
91
- - Sometimes issues occur such as "doubleTap isn't tapping #548"
92
- - workaround for it:
93
- - with `selenium-webdriver >= 3.4.0`
94
- ```ruby
95
- def double_tap(element)
96
- rect = element.rect
97
- execute_script 'mobile: doubleTap', x: rect.x + rect.width / 2, y: rect.y + rect.height / 2
98
- end
99
- ```
100
- - with `selenium-webdriver < 3.4.0`
101
- ```ruby
102
- def double_tap(element)
103
- size = element.size
104
- location = element.location
105
- execute_script 'mobile: doubleTap', x: location.x + size.width / 2, y: location.y + size.height / 2
106
- end
107
- ```
108
-
109
- ## Other actions
110
- Basically, other actions such as `type` are compatible with `automationName = Appium`.
111
-
112
- ## Pasteboard
113
- - Simulator only
114
- - https://github.com/appium/appium/blob/master/docs/en/writing-running-appium/ios-xctest-pasteboard.md
data/docs/parallel.md DELETED
@@ -1,8 +0,0 @@
1
- Appium 1.7.0+ supports single server and multiple sessions, and it requires Xcode 9 for iOS.
2
-
3
- # Example
4
- ## Run tests on Multiple Simulators with Xcode 9
5
- - https://github.com/appium/appium-xcuitest-driver/tree/master/test/functional/parallel
6
- - https://github.com/appium/ruby_lib/tree/master/ios_tests/parallel
7
- - Thread programming: TestParallelRunThread
8
- - Process programming: TestParallelRunProcess