ios_tests/lib/ios/specs/ios/element/textfield.rb in appium_lib-8.2.1 vs ios_tests/lib/ios/specs/ios/element/textfield.rb in appium_lib-9.0.0
- old
+ new
@@ -32,10 +32,12 @@
values.include?('<enter password>').must_equal true
textfields.length.must_equal 4
end
t 'predicate textfields' do
+ fail NotImplementedError, "XCUITest(Appium1.6.2) doesn't support UIAutomation script" if UI::Inventory.xcuitest?
+
textfield_count = execute_script(%(au.mainApp().getAllWithPredicate("type contains[c] 'textfield'", true))).length
textfield_count.must_equal 4
end
t 'first_textfield' do
@@ -66,18 +68,20 @@
keyboard_exists?.must_equal true
end
t 'textfield type' do
# Regular send keys triggers the keyboard and doesn't dismiss
- keyboard_must_not_exist
+ keyboard_must_not_exist unless UI::Inventory.xcuitest? # xcuitest doesn't support JS command
textfield(1).send_keys 'ok'
- keyboard_must_exist
+ keyboard_must_exist unless UI::Inventory.xcuitest? # xcuitest doesn't support JS command
- # type should not dismiss the keyboard
- message = 'type test type'
- textfield(1).type message
- keyboard_must_exist
- textfield(1).text.must_equal message
+ unless UI::Inventory.xcuitest?
+ # type should not dismiss the keyboard
+ message = 'type test type'
+ textfield(1).type message
+ keyboard_must_exist
+ textfield(1).text.must_equal message
+ end
end
def must_raise_no_element(&block)
proc { block.call }.must_raise Selenium::WebDriver::Error::NoSuchElementError
end