frank-cucumber 1.1.10 → 1.1.11.pre1

Sign up to get free protection for your applications and to get access to all the features.
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
@@ -113,40 +113,6 @@ Then /^I should not see an element of class "([^\"]*)"$/ do |className|
113
113
  end
114
114
 
115
115
 
116
- # -- Type/Fill in -- #
117
-
118
- When /^I type "([^\"]*)" into the "([^\"]*)" text field$/ do |text_to_type, field_name|
119
- quote = get_selector_quote(field_name)
120
- text_fields_modified = frankly_map( "textField placeholder:#{quote}#{field_name}#{quote}", "setText:", text_to_type )
121
- raise "could not find text fields with placeholder #{quote}#{field_name}#{quote}" if text_fields_modified.empty?
122
- #TODO raise warning if text_fields_modified.count > 1
123
- end
124
-
125
- # alias
126
- When /^I fill in "([^\"]*)" with "([^\"]*)"$/ do |text_field, text_to_type|
127
- step %Q|I type "#{text_to_type}" into the "#{text_field}" text field|
128
- end
129
-
130
- When /^I fill in text fields as follows:$/ do |table|
131
- table.hashes.each do |row|
132
- step %Q|I type "#{row['text']}" into the "#{row['field']}" text field|
133
- end
134
- end
135
-
136
- # simulate entering text from keyboard
137
- When /^I enter the text "([^\\"]*)" from keyboard to the textfield "([^\\"]*)"$/ do |text_to_type, text_field_mark| # !> ambiguous first argument; put parentheses or even spaces
138
- selector = "view marked:'#{text_field_mark}' first"
139
- if element_exists(selector)
140
- touch( selector )
141
- else
142
- raise "Could not find [#{text_field_mark}], it does not exist."
143
- end
144
- text_field_selector = "textField placeholder:'#{text_field_mark}'"
145
- frankly_map( text_field_selector, 'becomeFirstResponder' )
146
- frankly_map( text_field_selector, 'setText:', text_to_type )
147
- frankly_map( text_field_selector, 'endEditing:', true )
148
- end
149
-
150
116
  # -- Rotate -- #
151
117
  Given /^the device is in (a )?(landscape|portrait) orientation$/ do |_,orientation|
152
118
  frankly_set_orientation orientation
@@ -87,7 +87,23 @@ module FrankHelper
87
87
  raise "some views could not be touched (probably because they are not within the current viewport)" if touch_successes.include?(false)
88
88
  touch_successes
89
89
  end
90
-
90
+
91
+ # Fill in text in a text field.
92
+ #
93
+ # @param [String] the placeholder text for the desired text field
94
+ # @param [Hash{Symbol => String}] a hash with a :with key and a string of text to fill in
95
+ # @raise an exception if the :with key DSL syntax is missing
96
+ # @raise an exception if a text field with the given placeholder text could not be found
97
+ def fill_in( placeholder_field_name, options={} )
98
+ raise "Must pass a hash containing the key :with" unless (options.is_a?(Hash) && options.has_key?(:with))
99
+ text_to_type = options[:with]
100
+
101
+ quote = get_selector_quote(placeholder_field_name)
102
+ text_fields_modified = frankly_map( "textField placeholder:#{quote}#{placeholder_field_name}#{quote}", "setText:", text_to_type )
103
+ raise "could not find text fields with placeholder #{quote}#{placeholder_field_name}#{quote}" if text_fields_modified.empty?
104
+ #TODO raise warning if text_fields_modified.count > 1
105
+ end
106
+
91
107
  # Indicate whether there are any views in the current view heirarchy which match the specified selector.
92
108
  # @param [String] selector a view selector.
93
109
  # @return [Boolean]
@@ -1,5 +1,5 @@
1
1
  module Frank
2
2
  module Cucumber
3
- VERSION = "1.1.10"
3
+ VERSION = "1.1.11.pre1"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,8 +1,8 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: frank-cucumber
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.10
5
- prerelease:
4
+ version: 1.1.11.pre1
5
+ prerelease: 7
6
6
  platform: ruby
7
7
  authors:
8
8
  - Pete Hodgson
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2013-04-22 00:00:00.000000000 Z
13
+ date: 2013-04-24 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: cucumber
@@ -376,9 +376,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
376
376
  required_rubygems_version: !ruby/object:Gem::Requirement
377
377
  none: false
378
378
  requirements:
379
- - - ! '>='
379
+ - - ! '>'
380
380
  - !ruby/object:Gem::Version
381
- version: '0'
381
+ version: 1.3.1
382
382
  requirements: []
383
383
  rubyforge_project:
384
384
  rubygems_version: 1.8.24