Skip to content

Commit 7bf6958

Browse files
authored
include ::Appium::Core::Base::SearchContext instead of ::Selenium::WebDriver::SearchContext (#104)
* include ::Appium::Core::Base::SearchContext instead of ::Selenium::WebDriver::SearchContext * fix rubocop
1 parent b858e6a commit 7bf6958

File tree

3 files changed

+26
-0
lines changed

3 files changed

+26
-0
lines changed

CHANGELOG.md

+2
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ All notable changes to this project will be documented in this file.
55
### Enhancements
66

77
### Bug fixes
8+
- Fix including search context in `::Selenium::WebDriver::Elemenet`
9+
- `include ::Appium::Core::Base::SearchContext` instead of `::Selenium::WebDriver::SearchContext`
810

911
### Deprecations
1012

lib/appium_lib_core/patch.rb

+3
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ module Core
44
# Implement useful features for element.
55
# Patch for Selenium Webdriver.
66
class Selenium::WebDriver::Element
7+
# To extend Appium related SearchContext into ::Selenium::WebDriver::Element
8+
include ::Appium::Core::Base::SearchContext
9+
710
# Note: For testing .text should be used over value, and name.
811

912
# Returns the value attribute

test/unit/driver_test.rb

+21
Original file line numberDiff line numberDiff line change
@@ -80,5 +80,26 @@ def test_default_timeout_for_http_client
8080
assert_equal 999_999, @core.http_client.open_timeout
8181
assert_equal 999_999, @core.http_client.read_timeout
8282
end
83+
84+
def test_search_context_in_element_class
85+
expected = {
86+
class: 'class name',
87+
class_name: 'class name',
88+
css: 'css selector',
89+
id: 'id',
90+
link: 'link text',
91+
link_text: 'link text',
92+
name: 'name',
93+
partial_link_text: 'partial link text',
94+
tag_name: 'tag name',
95+
xpath: 'xpath',
96+
accessibility_id: 'accessibility id',
97+
uiautomation: '-ios uiautomation',
98+
predicate: '-ios predicate string',
99+
class_chain: '-ios class chain',
100+
uiautomator: '-android uiautomator'
101+
}
102+
assert_equal expected, ::Selenium::WebDriver::Element::FINDERS
103+
end
83104
end
84105
end

0 commit comments

Comments
 (0)