Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: use predicate instead of name for 'value' #282

Merged
merged 1 commit into from
Oct 29, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion test/functional/ios/ios/device_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ def test_hidekeyboard
e = @@core.wait { @@driver.find_element :accessibility_id, TEXT_FIELD }
e.click

text = @@core.wait { @@driver.find_element :name, 'Placeholder text' }
text = @@core.wait { @@driver.find_element :predicate, 'value == "Placeholder text"' }
text.click

assert @@driver.find_element(:class, 'XCUIElementTypeKeyboard').displayed?
Expand Down
4 changes: 2 additions & 2 deletions test/functional/ios/patch_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def test_type
text = @@core.wait { @@driver.find_element :class, 'XCUIElementTypeTextField' }
text.type 'hello'

e = @@core.wait { @@driver.find_element :name, 'hello' }
e = @@core.wait { @@driver.find_element :predicate, 'value == "hello"' }
assert_equal 'hello', e.value

@@driver.back
Expand All @@ -71,7 +71,7 @@ def test_immediate_value
text = @@core.wait { @@driver.find_element :class, 'XCUIElementTypeTextField' }
text.immediate_value 'hello'

text = @@core.wait { @@driver.find_element :name, 'hello' }
text = @@core.wait { @@driver.find_element :predicate, 'value == "hello"' }
assert_equal 'hello', text.value

@@driver.back
Expand Down
2 changes: 1 addition & 1 deletion test/functional/ios/webdriver/device_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def test_set_immediate_value

@@core.wait { @@driver.find_element :accessibility_id, 'Text Fields' }.click

e = @@core.wait { @@driver.find_element :name, 'Placeholder text' }
e = @@core.wait { @@driver.find_element :predicate, 'value == "Placeholder text"' }
e.click
@@driver.set_immediate_value e, 'hello'

Expand Down
8 changes: 4 additions & 4 deletions test/functional/ios/webdriver/w3c_actions_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -48,16 +48,16 @@ def test_scroll
el = @@core.wait { @@driver.find_element(:accessibility_id, 'Segmented Controls') }
@@driver.action.click(el).perform

[1, 2, 3].each do |_value|
[1, 2, 3].each do |count|
el = @@driver.find_element(:accessibility_id, 'TINTED')
rect = el.rect

@@driver.execute_script('mobile: scroll', direction: 'down')

break if el.rect.y < rect.y
break if el.rect.y <= rect.y

# fail
assert false if value == 3
assert false if count == 3
end
assert true
end
Expand All @@ -74,7 +74,7 @@ def test_scroll2

w3c_scroll @@driver

assert el.rect.y < rect.y
assert el.rect.y <= rect.y
end

def test_click_w3c_landscape
Expand Down