Skip to content

Commit e06b25e

Browse files
authored
add a test for predicate (#499)
* add a test for predicate * fix rubocop
1 parent 447f13c commit e06b25e

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

ios_tests/lib/ios/specs/ios/element/textfield.rb

+6-3
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,13 @@ def after_last
3434
end
3535

3636
t 'predicate textfields' do
37-
raise NotImplementedError, "XCUITest(Appium1.6.2) doesn't support UIAutomation script" if UI::Inventory.xcuitest?
37+
textfields = if UI::Inventory.xcuitest?
38+
find_elements(:predicate, "type contains[c] 'textfield'")
39+
else
40+
execute_script(%(au.mainApp().getAllWithPredicate("type contains[c] 'textfield'", true)))
41+
end
3842

39-
textfield_count = execute_script(%(au.mainApp().getAllWithPredicate("type contains[c] 'textfield'", true))).length
40-
textfield_count.must_equal 4
43+
textfields.length.must_equal 4
4144
end
4245

4346
t 'first_textfield' do

0 commit comments

Comments
 (0)