Skip to content

Step Definition compendium

moredip edited this page Mar 9, 2011 · 19 revisions

What's this?

This page is intended to act as a place for useful Frank step definitions which aren't quite standard enough to add to the core frank steps. Please feel free to contribute your own useful codez.

Editing a text field using the keyboard

(see this thread for details)

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

Clone this wiki locally