Skip to content

Step Definition compendium

moredip edited this page Mar 9, 2011 · 19 revisions

Editing a text field using the keyboard

This works for Pete's team When /^I use the keyboard to fill in the textfield marked "([^"])" with "([^"])"$/ do |text_field_mark, text_to_type| text_field_selector = "view marked:'#{text_field_mark}'" check_element_exists( text_field_selector ) touch( text_field_selector ) frankly_map( text_field_selector, 'setText:', text_to_type ) frankly_map( text_field_selector, 'endEditing:', true ) end

This works for Martin: When /^I use the keyboard to fill in the textfield marked "([^"])" with "([^"])"$/ do |text_field_mark, text_to_type| text_field_selector = "view marked:'#{text_field_mark}'" check_element_exists( text_field_selector ) frankly_map( text_field_selector, 'becomeFirstResponder' ) frankly_map( text_field_selector, 'setText:', text_to_type ) frankly_map( text_field_selector, 'endEditing:', true ) end (see http://groups.google.com/group/frank-discuss/browse_frm/thread/49fcf81971d7dd42 for details)

Clone this wiki locally