You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* add find elements with predicate
* use predicate strategy in find/s and find/s_exact
* fix rubocop
* remove elements_include and elements_exact
* add tests and update find elements
* fix text field
* fix rubocop
* add some documentations
* remove redundant lines
* remove redundant find elemenets
* fix lint
-[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.
19
19
- If `automationName` is `Appium` or `nil`, then they provide `UIAxxxx`
@@ -36,6 +36,22 @@ find_element(:accessibility_id, element) # Return a element which has accessibil
36
36
buttons(value) # Return button elements include `value` as its name attributes.
37
37
```
38
38
39
+
### with Predicate
40
+
- We recommend to use predicate strategy instead of XPath strategy.
41
+
- e.g. `find_ele_by_predicate/find_eles_by_predicate`, `find_ele_by_predicate_include/find_eles_by_predicate_include`
42
+
- A helpful cheatsheet for predicate
43
+
-https://realm.io/news/nspredicate-cheatsheet/
44
+
- For XCUITest(WebDriverAgent), without 'wd' prefixes are supported.
- 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.
47
+
48
+
#### examples
49
+
-`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.
50
+
51
+
```ruby
52
+
textfield(value) # Return a XCUIElementTypeSecureTextField or XCUIElementTypeTextField element which has `value` text.
53
+
finds_exact(value) # Return any elements include `value` as its name attributes.
54
+
```
39
55
40
56
### with XPath
41
57
- It is better to avoid XPath strategy.
@@ -48,11 +64,9 @@ buttons(value) # Return button elements include `value` as its name attributes.
0 commit comments