Skip to content

Commit 569ea09

Browse files
authored
test: use predicate instead of name for 'value' (#282)
1 parent e4d63eb commit 569ea09

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

test/functional/ios/ios/device_test.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ def test_hidekeyboard
255255
e = @@core.wait { @@driver.find_element :accessibility_id, TEXT_FIELD }
256256
e.click
257257

258-
text = @@core.wait { @@driver.find_element :name, 'Placeholder text' }
258+
text = @@core.wait { @@driver.find_element :predicate, 'value == "Placeholder text"' }
259259
text.click
260260

261261
assert @@driver.find_element(:class, 'XCUIElementTypeKeyboard').displayed?

test/functional/ios/patch_test.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ def test_type
4444
text = @@core.wait { @@driver.find_element :class, 'XCUIElementTypeTextField' }
4545
text.type 'hello'
4646

47-
e = @@core.wait { @@driver.find_element :name, 'hello' }
47+
e = @@core.wait { @@driver.find_element :predicate, 'value == "hello"' }
4848
assert_equal 'hello', e.value
4949

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

74-
text = @@core.wait { @@driver.find_element :name, 'hello' }
74+
text = @@core.wait { @@driver.find_element :predicate, 'value == "hello"' }
7575
assert_equal 'hello', text.value
7676

7777
@@driver.back

test/functional/ios/webdriver/device_test.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ def test_set_immediate_value
5858

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

61-
e = @@core.wait { @@driver.find_element :name, 'Placeholder text' }
61+
e = @@core.wait { @@driver.find_element :predicate, 'value == "Placeholder text"' }
6262
e.click
6363
@@driver.set_immediate_value e, 'hello'
6464

test/functional/ios/webdriver/w3c_actions_test.rb

+4-4
Original file line numberDiff line numberDiff line change
@@ -48,16 +48,16 @@ def test_scroll
4848
el = @@core.wait { @@driver.find_element(:accessibility_id, 'Segmented Controls') }
4949
@@driver.action.click(el).perform
5050

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

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

57-
break if el.rect.y < rect.y
57+
break if el.rect.y <= rect.y
5858

5959
# fail
60-
assert false if value == 3
60+
assert false if count == 3
6161
end
6262
assert true
6363
end
@@ -74,7 +74,7 @@ def test_scroll2
7474

7575
w3c_scroll @@driver
7676

77-
assert el.rect.y < rect.y
77+
assert el.rect.y <= rect.y
7878
end
7979

8080
def test_click_w3c_landscape

0 commit comments

Comments
 (0)