Skip to content

Commit 61ee15c

Browse files
authored
Update docs for find_element/s (#531)
* update find_element/s * add some examples * update migration
1 parent 17d17e6 commit 61ee15c

File tree

4 files changed

+42
-6
lines changed

4 files changed

+42
-6
lines changed

docs/docs.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ Appium::Driver.new(caps: apk).start_driver
5151

5252
Example use of Appium's mobile gesture.
5353

54-
> @driver.find_element()
54+
> @driver.find_element_with_appium()
5555
5656
`console.rb` uses some code from [simple_test.rb](
5757
https://github.com/appium/appium/blob/82995f47408530c80c3376f4e07a1f649d96ba22/sample-code/examples/ruby/simple_test.rb) and is released under the [same license](https://github.com/appium/appium/blob/c58eeb66f2d6fa3b9a89d188a2e657cca7cb300f/LICENSE) as Appium. The [Accessibility Inspector](https://developer.apple.com/library/ios/#documentation/UserExperience/Conceptual/iPhoneAccessibility/Testing_Accessibility/Testing_Accessibility.html) is helpful for discovering button names and textfield values.

docs/migration.md

+22
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,25 @@
1+
### Breaking Changes in 9.1.0
2+
change `@selenium_driver.find_element/s` to `@selenium_driver.find_element/s_with_appium`.
3+
ref: https://github.com/appium/ruby_lib/pull/383
4+
5+
Old | New
6+
:--|:--
7+
`@selenium_driver.find_element/s` | `@selenium_driver.find_element/s_with_appium`
8+
9+
- after
10+
11+
```
12+
@selenium_driver.find_element_with_appium :accessibility_id, "some ids"
13+
@selenium_driver.find_elements_with_appium :accessibility_id, "some ids"
14+
```
15+
16+
- before
17+
18+
```
19+
@selenium_driver.find_element :accessibility_id, "some ids"
20+
@selenium_driver.find_elements :accessibility_id, "some ids"
21+
```
22+
123
### Breaking Changes in 8.2.0
224
change `Appium.load_appium_txt` to `Appium.load_settings`.
325

lib/appium_lib/device/device.rb

+3-3
Original file line numberDiff line numberDiff line change
@@ -423,10 +423,10 @@ def create_bridge_command(method)
423423
end
424424
end
425425

426-
# @!method find_element
427-
# @!method find_elements
426+
# @!method find_element_with_appium
427+
# @!method find_elements_with_appium
428428
#
429-
# find_element/s with their accessibility_id
429+
# find_element/s_with_appium with their accessibility_id
430430
#
431431
# ```ruby
432432
# find_elements :accessibility_id, 'Animation'

lib/appium_lib/driver.rb

+16-2
Original file line numberDiff line numberDiff line change
@@ -688,15 +688,29 @@ def execute_script(script, *args)
688688
@driver.execute_script script, *args
689689
end
690690

691-
# Calls @driver.find_elements
691+
# Calls @driver.find_elements_with_appium
692+
#
693+
# ```
694+
# @driver = Appium::Driver.new()
695+
# @driver.find_elements :predicate, yyy
696+
# ```
697+
#
698+
# If you call `Appium.promote_appium_methods`, you can call `find_elements` directly.
692699
#
693700
# @param [*args] args The args to use
694701
# @return [Array<Element>] Array is empty when no elements are found.
695702
def find_elements(*args)
696703
@driver.find_elements_with_appium(*args)
697704
end
698705

699-
# Calls @driver.find_elements
706+
# Calls @driver.find_element_with_appium
707+
#
708+
# ```
709+
# @driver = Appium::Driver.new()
710+
# @driver.find_element :accessibility_id, zzz
711+
# ```
712+
#
713+
# If you call `Appium.promote_appium_methods`, you can call `find_element` directly.
700714
#
701715
# @param [*args] args The args to use
702716
# @return [Element]

0 commit comments

Comments
 (0)