briar 0.0.5 → 0.0.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +15 -0
- data/LICENSE.txt +1 -6
- data/README.md +8 -0
- data/bin/briar +44 -0
- data/bin/briar_helpers.rb +14 -0
- data/briar.gemspec +15 -12
- data/cucumber.yml.example +4 -0
- data/features/step_definitions/alerts_and_sheets/alert_view_steps.rb +3 -3
- data/features/step_definitions/bars/navbar_steps.rb +8 -8
- data/features/step_definitions/bars/tabbar_steps.rb +20 -14
- data/features/step_definitions/briar_core_steps.rb +3 -3
- data/features/step_definitions/control/button_steps.rb +10 -35
- data/features/step_definitions/email_steps.rb +55 -28
- data/features/step_definitions/keyboard_steps.rb +15 -2
- data/features/step_definitions/picker/date_picker_steps.rb +82 -68
- data/features/step_definitions/picker/picker_steps.rb +3 -3
- data/features/step_definitions/scroll_view_steps.rb +13 -12
- data/features/step_definitions/table_steps.rb +15 -10
- data/features/step_definitions/text_field_steps.rb +3 -3
- data/features/step_definitions/text_view_steps.rb +1 -7
- data/lib/briar.rb +2 -0
- data/lib/briar/alerts_and_sheets/alert_view.rb +17 -1
- data/lib/briar/bars/navbar.rb +16 -12
- data/lib/briar/bars/tabbar.rb +16 -4
- data/lib/briar/briar_core.rb +9 -3
- data/lib/briar/briar_steps.rb +19 -18
- data/lib/briar/control/button.rb +0 -1
- data/lib/briar/cucumber.rb +2 -0
- data/lib/briar/email.rb +34 -19
- data/lib/briar/keyboard.rb +25 -25
- data/lib/briar/picker/date_picker.rb +152 -107
- data/lib/briar/table.rb +18 -21
- data/lib/briar/version.rb +1 -1
- data/run-tests.sh +4 -0
- metadata +46 -20
@@ -1,4 +1,3 @@
|
|
1
|
-
#include Briar::Keyboard
|
2
1
|
|
3
2
|
Then /^I should see the keyboard$/ do
|
4
3
|
should_see_keyboard
|
@@ -8,7 +7,6 @@ Then /^I should not see the keyboard$/ do
|
|
8
7
|
should_not_see_keyboard
|
9
8
|
end
|
10
9
|
|
11
|
-
|
12
10
|
Then /^I use the keyboard to enter "([^"]*)"$/ do |text|
|
13
11
|
wait_for_animation
|
14
12
|
should_see_keyboard
|
@@ -19,3 +17,18 @@ When /^I touch the done button the keyboard disappears$/ do
|
|
19
17
|
done
|
20
18
|
should_not_see_keyboard
|
21
19
|
end
|
20
|
+
|
21
|
+
Then /^I touch the delete key$/ do
|
22
|
+
keyboard_enter_char 'Delete'
|
23
|
+
end
|
24
|
+
|
25
|
+
Then(/^I turn off spell checking and capitalization$/) do
|
26
|
+
should_see_keyboard
|
27
|
+
turn_autocapitalization_off
|
28
|
+
turn_autocorrect_off
|
29
|
+
turn_spell_correct_off
|
30
|
+
end
|
31
|
+
|
32
|
+
Then /^I am done text editing$/ do
|
33
|
+
touch_navbar_item 'done text editing'
|
34
|
+
end
|
@@ -3,47 +3,15 @@
|
|
3
3
|
# steps
|
4
4
|
|
5
5
|
Then /^I change the time on the picker to "([^"]*)"$/ do |target_time|
|
6
|
-
screenshot_and_raise
|
6
|
+
screenshot_and_raise 'picker is not in date time or time mode' unless picker_is_in_time_mode or picker_is_in_date_and_time_mode
|
7
7
|
if picker_has_calabash_additions
|
8
8
|
date_str_to_send = date_str_to_send_to_picker_from_time_str target_time
|
9
9
|
set_picker_date_with_date_time_str (date_str_to_send)
|
10
10
|
else
|
11
|
-
|
12
|
-
screenshot_and_raise "could not parse '#{target_time}' into a valid time" if tokens.count > 3 or tokens.count < 1
|
13
|
-
time_in_24h_locale = tokens.count == 2
|
14
|
-
hour_token = tokens[0].to_i
|
15
|
-
period_token = tokens[2]
|
16
|
-
if time_in_24h_locale
|
17
|
-
screenshot_and_raise "'#{hour_token}' is not on (0, 23)" unless (0..23).member?(hour_token)
|
18
|
-
period_token = hour_token > 11 ? PICKER_PM : PICKER_AM
|
19
|
-
else
|
20
|
-
screenshot_and_raise "'#{hour_token}' is not on (1, 12)" unless (0..12).member?(hour_token)
|
21
|
-
am_pm_token = tokens[2]
|
22
|
-
screenshot_and_raise "'#{am_pm_token}' is not a recognized period (AM or PM)" unless (am_pm_token.eql? PICKER_AM or am_pm_token.eql? PICKER_PM)
|
23
|
-
hour_token = 0 if hour_token == 12 and am_pm_token.eql? PICKER_AM
|
24
|
-
hour_token = hour_token + 12 if hour_token < 12 and am_pm_token.eql? PICKER_PM
|
25
|
-
end
|
26
|
-
|
27
|
-
minute_token = tokens[1].to_i
|
28
|
-
screenshot_and_raise "'#{minute_token}'is not on (0, 59)" unless (0..59).member?(minute_token)
|
29
|
-
|
30
|
-
# rollback the date by 1 to avoid maxi date problems
|
31
|
-
# decided this was not a good idea because sometimes the rollback step below
|
32
|
-
# would not fire
|
33
|
-
# picker_scroll_down_on_column 0 if picker_is_in_date_and_time_mode
|
34
|
-
|
35
|
-
picker_scroll_to_hour hour_token
|
36
|
-
picker_scroll_to_minute minute_token
|
37
|
-
|
38
|
-
picker_scroll_to_period period_token if picker_is_in_12h_locale
|
39
|
-
|
40
|
-
# rollback the change we made above
|
41
|
-
# decided this was not a good idea
|
42
|
-
# sometimes this does not fire so you can end up with inconsistent dates
|
43
|
-
# see the test below
|
44
|
-
# picker_scroll_up_on_column 0 if picker_is_in_date_and_time_mode
|
11
|
+
screenshot_and_raise 'this version of briar requires a category on UIDatePicker. Sorry!'
|
45
12
|
end
|
46
13
|
|
14
|
+
|
47
15
|
@date_picker_time_12h = picker_is_in_12h_locale ? picker_time_12h_str : picker_time_for_other_locale
|
48
16
|
@date_picker_time_24h = picker_is_in_24h_locale ? picker_time_24h_str : picker_time_for_other_locale
|
49
17
|
|
@@ -73,31 +41,7 @@ Then /^I change the date on the picker to "([^"]*)"$/ do |target_date|
|
|
73
41
|
date_str_to_send = date_str_to_send_to_picker_from_date_str target_date
|
74
42
|
set_picker_date_with_date_time_str (date_str_to_send)
|
75
43
|
else
|
76
|
-
|
77
|
-
# figure out which way to turn the picker
|
78
|
-
# target = Date.parse(target_date)
|
79
|
-
dir = (Date.parse(target_date) < Date.today) ? "down" : "up"
|
80
|
-
limit = 60
|
81
|
-
count = 0
|
82
|
-
begin
|
83
|
-
dir.eql?("down") ? picker_scroll_down_on_column(0) : picker_scroll_up_on_column(0)
|
84
|
-
sleep(PICKER_STEP_PAUSE)
|
85
|
-
count = count + 1
|
86
|
-
end while ((not picker_weekday_month_day_is(target_date)) and count < limit)
|
87
|
-
end
|
88
|
-
unless picker_weekday_month_day_is(target_date)
|
89
|
-
screenshot_and_raise "scrolled '#{limit}' and could not change date to #{target_date}"
|
90
|
-
end
|
91
|
-
|
92
|
-
@date_picker_date_time_12h = picker_is_in_12h_locale ? picker_date_and_time_str_12h : picker_date_and_time_str_for_other_locale
|
93
|
-
@date_picker_date_time_24h = picker_is_in_24h_locale ? picker_date_and_time_str_24h : picker_date_and_time_str_for_other_locale
|
94
|
-
if picker_is_in_date_and_time_mode
|
95
|
-
@date_picker_time_12h = picker_is_in_12h_locale ? picker_time_12h_str : picker_time_for_other_locale
|
96
|
-
@date_picker_time_24h = picker_is_in_24h_locale ? picker_time_24h_str : picker_time_for_other_locale
|
97
|
-
unless time_strings_are_equivalent(@date_picker_time_12h, @date_picker_time_24h)
|
98
|
-
screenshot_and_raise "ERROR: changing the picker resulted in two different times: 12H => '#{@date_picker_time_12h}' 24H => '#{@date_picker_time_24h}'"
|
99
|
-
end
|
100
|
-
end
|
44
|
+
screenshot_and_raise 'this version of briar requires a category on UIDatePicker. Sorry!'
|
101
45
|
end
|
102
46
|
end
|
103
47
|
|
@@ -109,18 +53,20 @@ end
|
|
109
53
|
|
110
54
|
Then /^I change the picker to (\d+) days? ago$/ do |days_ago|
|
111
55
|
today = Date.today
|
56
|
+
#noinspection RubyUnusedLocalVariable
|
112
57
|
days_ago = today -= days_ago.to_i
|
113
58
|
fmt = picker_is_in_24h_locale ? PICKER_24H_DATE_FMT : PICKER_12H_DATE_FMT
|
114
|
-
target_date = days_ago.strftime(fmt).squeeze(
|
59
|
+
target_date = days_ago.strftime(fmt).squeeze(' ').strip
|
115
60
|
macro %Q|I change the date on the picker to "#{target_date}"|
|
116
61
|
end
|
117
62
|
|
118
63
|
|
119
64
|
Then /^I change the picker to (\d+) days? ago at "([^"]*)"$/ do |days_ago, target_time|
|
120
65
|
today = Date.today
|
66
|
+
#noinspection RubyUnusedLocalVariable
|
121
67
|
days_ago = today -= days_ago.to_i
|
122
68
|
fmt = picker_is_in_24h_locale ? PICKER_24H_DATE_FMT : PICKER_12H_DATE_FMT
|
123
|
-
target_date = days_ago.strftime(fmt).squeeze(
|
69
|
+
target_date = days_ago.strftime(fmt).squeeze(' ').strip
|
124
70
|
macro %Q|I change the picker date to "#{target_date}" and the time to "#{target_time}"|
|
125
71
|
end
|
126
72
|
|
@@ -136,14 +82,15 @@ Then /^the text in the "([^"]*)" label should match picker date and time$/ do |l
|
|
136
82
|
end
|
137
83
|
|
138
84
|
Then /^I change the picker date time to "([^"]*)"$/ do |target_time|
|
85
|
+
pending 'deprecated 0.0.6 - not replaced with anything'
|
139
86
|
date_str = picker_date_str
|
140
87
|
macro %Q|I change the picker date to "#{date_str}" and the time to "#{target_time}"|
|
141
88
|
end
|
142
89
|
|
143
90
|
Then /^I should see that the date picker is in time mode$/ do
|
144
|
-
res = query(
|
91
|
+
res = query('datePicker', :datePickerMode).first
|
145
92
|
unless res
|
146
|
-
screenshot_and_raise
|
93
|
+
screenshot_and_raise 'expected to a date picker'
|
147
94
|
end
|
148
95
|
unless res == UIDatePickerModeTime
|
149
96
|
screenshot_and_raise "expected to see picker with time mode but found mode '#{res}'"
|
@@ -194,23 +141,90 @@ Then /^I should see that the "([^"]*)" row has the date and time I just entered
|
|
194
141
|
end
|
195
142
|
|
196
143
|
Then /^I change the minute interval on the picker to (1|5|10|30) minutes?$/ do |target_interval|
|
197
|
-
res = query(
|
198
|
-
screenshot_and_raise
|
144
|
+
res = query('datePicker', [{setMinuteInterval:target_interval.to_i}])
|
145
|
+
screenshot_and_raise 'did not find a date picker - could not set the minute interval' if res.empty?
|
199
146
|
sleep(PICKER_STEP_PAUSE * 5)
|
200
147
|
@picker_minute_interval = target_interval.to_i
|
201
148
|
end
|
202
149
|
|
203
150
|
Then /^I change the time on the picker to (\d+) minutes? from now$/ do |target_minute|
|
204
151
|
future = Time.new + (60 * target_minute.to_i)
|
205
|
-
time_str = future.strftime(PICKER_12H_TIME_FMT).squeeze(
|
152
|
+
time_str = future.strftime(PICKER_12H_TIME_FMT).squeeze(' ').strip
|
206
153
|
macro %Q|I change the time on the picker to "#{time_str}"|
|
207
154
|
sleep(PICKER_STEP_PAUSE)
|
208
155
|
end
|
209
156
|
|
210
157
|
Then /^I change the time on the picker to (\d+) minutes? before now$/ do |target_minute|
|
211
158
|
past = Time.new - (60 * target_minute.to_i)
|
212
|
-
time_str = past.strftime(PICKER_12H_TIME_FMT).squeeze(
|
159
|
+
time_str = past.strftime(PICKER_12H_TIME_FMT).squeeze(' ').strip
|
213
160
|
macro %Q|I change the time on the picker to "#{time_str}"|
|
214
161
|
sleep(PICKER_STEP_PAUSE)
|
215
162
|
end
|
216
163
|
|
164
|
+
# DEAD SEA
|
165
|
+
|
166
|
+
# old non_category date picking
|
167
|
+
#tokens = target_time.split(/[: ]/)
|
168
|
+
#screenshot_and_raise "could not parse '#{target_time}' into a valid time" if tokens.count > 3 or tokens.count < 1
|
169
|
+
#time_in_24h_locale = tokens.count == 2
|
170
|
+
#hour_token = tokens[0].to_i
|
171
|
+
#period_token = tokens[2]
|
172
|
+
#if time_in_24h_locale
|
173
|
+
# screenshot_and_raise "'#{hour_token}' is not on (0, 23)" unless (0..23).member?(hour_token)
|
174
|
+
# period_token = hour_token > 11 ? PICKER_PM : PICKER_AM
|
175
|
+
#else
|
176
|
+
# screenshot_and_raise "'#{hour_token}' is not on (1, 12)" unless (0..12).member?(hour_token)
|
177
|
+
# am_pm_token = tokens[2]
|
178
|
+
# screenshot_and_raise "'#{am_pm_token}' is not a recognized period (AM or PM)" unless (am_pm_token.eql? PICKER_AM or am_pm_token.eql? PICKER_PM)
|
179
|
+
# hour_token = 0 if hour_token == 12 and am_pm_token.eql? PICKER_AM
|
180
|
+
# hour_token = hour_token + 12 if hour_token < 12 and am_pm_token.eql? PICKER_PM
|
181
|
+
#end
|
182
|
+
#
|
183
|
+
#minute_token = tokens[1].to_i
|
184
|
+
#screenshot_and_raise "'#{minute_token}'is not on (0, 59)" unless (0..59).member?(minute_token)
|
185
|
+
#
|
186
|
+
## rollback the date by 1 to avoid maxi date problems
|
187
|
+
## decided this was not a good idea because sometimes the rollback step below
|
188
|
+
## would not fire
|
189
|
+
## picker_scroll_down_on_column 0 if picker_is_in_date_and_time_mode
|
190
|
+
#
|
191
|
+
#picker_scroll_to_hour hour_token
|
192
|
+
#picker_scroll_to_minute minute_token
|
193
|
+
#
|
194
|
+
#picker_scroll_to_period period_token if picker_is_in_12h_locale
|
195
|
+
#
|
196
|
+
## rollback the change we made above
|
197
|
+
## decided this was not a good idea
|
198
|
+
## sometimes this does not fire so you can end up with inconsistent dates
|
199
|
+
## see the test below
|
200
|
+
## picker_scroll_up_on_column 0 if picker_is_in_date_and_time_mode
|
201
|
+
|
202
|
+
|
203
|
+
##
|
204
|
+
|
205
|
+
#unless picker_weekday_month_day_is(target_date)
|
206
|
+
# # figure out which way to turn the picker
|
207
|
+
# # target = Date.parse(target_date)
|
208
|
+
# dir = (Date.parse(target_date) < Date.today) ? 'down' : 'up'
|
209
|
+
# limit = 60
|
210
|
+
# count = 0
|
211
|
+
# begin
|
212
|
+
# dir.eql?('down') ? picker_scroll_down_on_column(0) : picker_scroll_up_on_column(0)
|
213
|
+
# sleep(PICKER_STEP_PAUSE)
|
214
|
+
# count = count + 1
|
215
|
+
# end while ((not picker_weekday_month_day_is(target_date)) and count < limit)
|
216
|
+
#end
|
217
|
+
#unless picker_weekday_month_day_is(target_date)
|
218
|
+
# screenshot_and_raise "scrolled '#{limit}' and could not change date to #{target_date}"
|
219
|
+
#end
|
220
|
+
#
|
221
|
+
#@date_picker_date_time_12h = picker_is_in_12h_locale ? picker_date_and_time_str_12h : picker_date_and_time_str_for_other_locale
|
222
|
+
#@date_picker_date_time_24h = picker_is_in_24h_locale ? picker_date_and_time_str_24h : picker_date_and_time_str_for_other_locale
|
223
|
+
#if picker_is_in_date_and_time_mode
|
224
|
+
# @date_picker_time_12h = picker_is_in_12h_locale ? picker_time_12h_str : picker_time_for_other_locale
|
225
|
+
# @date_picker_time_24h = picker_is_in_24h_locale ? picker_time_24h_str : picker_time_for_other_locale
|
226
|
+
# unless time_strings_are_equivalent(@date_picker_time_12h, @date_picker_time_24h)
|
227
|
+
# screenshot_and_raise "ERROR: changing the picker resulted in two different times: 12H => '#{@date_picker_time_12h}' 24H => '#{@date_picker_time_24h}'"
|
228
|
+
# end
|
229
|
+
#end
|
230
|
+
#end
|
@@ -12,7 +12,7 @@ end
|
|
12
12
|
|
13
13
|
Then /^I scroll (up|down) on picker "([^"]*)"$/ do |dir, picker_name|
|
14
14
|
should_see_picker picker_name
|
15
|
-
if dir.eql?
|
15
|
+
if dir.eql? 'down'
|
16
16
|
picker_scroll_down_on_column 0
|
17
17
|
else
|
18
18
|
picker_scroll_up_on_column 0
|
@@ -26,7 +26,7 @@ Then /^I scroll (up|down) on picker "([^"]*)" to row (\d+)$/ do |dir, picker, ro
|
|
26
26
|
unless picker_current_index_for_column_is(0, target_row)
|
27
27
|
count = 0
|
28
28
|
begin
|
29
|
-
if dir.eql?
|
29
|
+
if dir.eql? 'down'
|
30
30
|
picker_scroll_down_on_column 0
|
31
31
|
else
|
32
32
|
picker_scroll_up_on_column 0
|
@@ -49,7 +49,7 @@ Then /^I should see picker "([^"]*)" has selected row (\d+)$/ do |picker, row|
|
|
49
49
|
end
|
50
50
|
|
51
51
|
Then /^I should (see|not see) picker "([^"]*)"$/ do |visibility, picker|
|
52
|
-
target = visibility.eql?
|
52
|
+
target = visibility.eql? 'see'
|
53
53
|
if target
|
54
54
|
should_see_picker picker
|
55
55
|
else
|
@@ -1,20 +1,21 @@
|
|
1
|
-
#include Briar::ScrollView
|
2
|
-
#include Briar::Core
|
3
1
|
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
2
|
+
|
3
|
+
#noinspection RubyUnusedLocalVariable
|
4
|
+
Then /^I scroll (left|right|up|down) until I see "([^\"]*)" limit (\d+)$/ do |dir, marker, limit|
|
5
|
+
pending "deprecated 0.0.6 - use Then I scroll #{dir} until I see \"#{marker}\""
|
6
|
+
end
|
7
|
+
|
8
|
+
Then /^I scroll (left|right|up|down) until I see "([^\"]*)"$/ do |dir, marker|
|
9
|
+
wait_poll({:until_exists => "view marked:'#{marker}'",
|
10
|
+
:timeout => 2}) do
|
11
|
+
scroll('scrollView index:0', dir)
|
12
12
|
end
|
13
|
-
unless exists?
|
14
|
-
screenshot_and_raise "i scrolled '#{dir}'
|
13
|
+
unless exists? marker
|
14
|
+
screenshot_and_raise "i scrolled '#{dir}' but did not see #{marker}"
|
15
15
|
end
|
16
16
|
end
|
17
17
|
|
18
|
+
|
18
19
|
Then /^I scroll "([^"]*)" (left|right|up|down)"$/ do |name, dir|
|
19
20
|
swipe(dir, {:query => "view marked:'#{name}'"})
|
20
21
|
end
|
@@ -5,11 +5,16 @@ Then /^I should see (?:the|an?) "([^"]*)" row$/ do |name|
|
|
5
5
|
should_see_row name
|
6
6
|
end
|
7
7
|
|
8
|
+
#noinspection RubyUnusedLocalVariable
|
8
9
|
Then /^I scroll (left|right|up|down) until I see the "([^\"]*)" row limit (\d+)$/ do |dir, row_name, limit|
|
9
|
-
|
10
|
+
pending "deprecated 0.0.6 - use 'Then I scroll #{dir} until I see (?:the|an?) \"#{row_name}\" row"
|
10
11
|
end
|
11
12
|
|
12
13
|
|
14
|
+
Then /^I scroll (left|right|up|down) until I see (?:the|an?) "([^\"]*)" row$/ do |dir, row_id|
|
15
|
+
scroll_until_i_see_row dir, row_id
|
16
|
+
end
|
17
|
+
|
13
18
|
Then /^I touch (?:the) "([^"]*)" row and wait for (?:the) "([^"]*)" view to appear$/ do |row_id, view_id|
|
14
19
|
# problem
|
15
20
|
wait_for_animation
|
@@ -40,8 +45,8 @@ end
|
|
40
45
|
|
41
46
|
|
42
47
|
Then /^the (first|second) row should be "([^"]*)"$/ do |idx, row_id|
|
43
|
-
(idx.eql?
|
44
|
-
res = query(
|
48
|
+
(idx.eql? 'first') ? index = 0 : index = 1
|
49
|
+
res = query('tableViewCell', :accessibilityIdentifier)[index]
|
45
50
|
unless res.eql? row_id
|
46
51
|
screenshot_and_raise "i expected the #{idx} row would be #{row_id}, but found #{res}"
|
47
52
|
end
|
@@ -54,7 +59,7 @@ end
|
|
54
59
|
|
55
60
|
|
56
61
|
Then /^I should be able to swipe to delete the "([^"]*)" row$/ do |row_name|
|
57
|
-
swipe_on_row
|
62
|
+
swipe_on_row 'left', row_name
|
58
63
|
should_see_delete_confirmation_in_row row_name
|
59
64
|
touch_delete_confirmation row_name
|
60
65
|
should_not_see_row row_name
|
@@ -76,14 +81,14 @@ end
|
|
76
81
|
Then /^I should see "([^"]*)" in row (\d+)$/ do |cell_name, row|
|
77
82
|
# on ios 6 this is returning nil
|
78
83
|
#res = query("tableViewCell index:#{row}", :accessibilityIdentifier).first
|
79
|
-
access_ids = query(
|
84
|
+
access_ids = query('tableViewCell', :accessibilityIdentifier)
|
80
85
|
unless access_ids.index(cell_name) == row.to_i
|
81
86
|
screenshot_and_raise "expected to see '#{cell_name}' in row #{row} but found '#{access_ids[row.to_i]}'"
|
82
87
|
end
|
83
88
|
end
|
84
89
|
|
85
90
|
Then /^I should see the rows in this order "([^"]*)"$/ do |row_ids|
|
86
|
-
tokens = row_ids.split(
|
91
|
+
tokens = row_ids.split(',')
|
87
92
|
counter = 0
|
88
93
|
tokens.each do |token|
|
89
94
|
token.strip!
|
@@ -102,7 +107,7 @@ end
|
|
102
107
|
|
103
108
|
Then /^I move the "([^"]*)" row (up|down) (\d+) times? using the reorder edit control$/ do |row_id, dir, n|
|
104
109
|
should_see_row row_id
|
105
|
-
dir_str = (dir.eql?(
|
110
|
+
dir_str = (dir.eql?('up')) ? 'drag_row_up' : 'drag_row_down'
|
106
111
|
n.to_i.times do (
|
107
112
|
playback(dir_str,
|
108
113
|
{:query => "tableViewCell marked:'#{row_id}' descendant tableViewCellReorderControl"})
|
@@ -111,7 +116,7 @@ Then /^I move the "([^"]*)" row (up|down) (\d+) times? using the reorder edit co
|
|
111
116
|
end
|
112
117
|
|
113
118
|
Then /^I should (see|not see) (?:the|an?) "([^"]*)" table$/ do |visibility, table_id|
|
114
|
-
if visibility.eql?(
|
119
|
+
if visibility.eql?('see')
|
115
120
|
should_see_table table_id
|
116
121
|
else
|
117
122
|
should_not_see_table table_id
|
@@ -136,9 +141,9 @@ Then /^I should see a switch for "([^"]*)" in the "([^"]*)" row that is in the "
|
|
136
141
|
unless res
|
137
142
|
screenshot_and_raise "expected to find a switch marked '#{switch_id}' in row '#{row_id}'"
|
138
143
|
end
|
139
|
-
expected = (on_off.eql?
|
144
|
+
expected = (on_off.eql? 'on') ? 1 : 0
|
140
145
|
unless res.to_i == expected
|
141
|
-
screenshot_and_raise "expected to find a switch marked '#{switch_id}' in row '#{row_id}' that is '#{on_off}' but found it was '#{res ?
|
146
|
+
screenshot_and_raise "expected to find a switch marked '#{switch_id}' in row '#{row_id}' that is '#{on_off}' but found it was '#{res ? 'on' : 'off'}'"
|
142
147
|
end
|
143
148
|
end
|
144
149
|
|
@@ -8,21 +8,18 @@ Then /^I should not see "([^"]*)" text field$/ do |name|
|
|
8
8
|
should_not_see_text_field name
|
9
9
|
end
|
10
10
|
|
11
|
-
|
12
11
|
Then /^I touch the clear button in the "([^"]*)" text field$/ do |name|
|
13
12
|
should_see_clear_button_in_text_field name
|
14
13
|
touch("textField marked:'#{name}' child button")
|
15
14
|
step_pause
|
16
15
|
end
|
17
16
|
|
18
|
-
|
19
17
|
Then /^I should see a clear button in the text field in the "([^"]*)" row$/ do |row_id|
|
20
18
|
query_str = "tableViewCell marked:'#{row_id}' child tableViewCellContentView child textField"
|
21
19
|
res = query(query_str)
|
22
20
|
screenshot_and_raise "expected to see text field in '#{row_id}' row" if res.empty?
|
23
21
|
end
|
24
22
|
|
25
|
-
|
26
23
|
Then /^I touch the clear button in the text field in the "([^"]*)" row$/ do |row_id|
|
27
24
|
query_str = "tableViewCell marked:'#{row_id}' child tableViewCellContentView child textField"
|
28
25
|
res = query(query_str)
|
@@ -31,6 +28,9 @@ Then /^I touch the clear button in the text field in the "([^"]*)" row$/ do |row
|
|
31
28
|
step_pause
|
32
29
|
end
|
33
30
|
|
31
|
+
Then(/^I should see "(.*?)" text field with text "(.*?)"$/) do |text_field_id, text|
|
32
|
+
should_see_text_field_with_text text_field_id, text
|
33
|
+
end
|
34
34
|
|
35
35
|
Then /^I should see "([^"]*)" in the text field "([^"]*)"$/ do |text, text_field|
|
36
36
|
should_see_text_field_with_text text_field, text
|
@@ -1,9 +1,7 @@
|
|
1
|
-
#include Briar::TextView
|
2
|
-
|
3
1
|
Then /^I clear text view named "([^\"]*)"$/ do |name|
|
4
2
|
res = query("textView marked:'#{name}'")
|
5
3
|
if res
|
6
|
-
set_text("textView marked:'#{name}'",
|
4
|
+
set_text("textView marked:'#{name}'", '')
|
7
5
|
end
|
8
6
|
end
|
9
7
|
|
@@ -19,10 +17,6 @@ Then /^I should see the text I just entered in the "([^"]*)" text view$/ do |tex
|
|
19
17
|
end
|
20
18
|
end
|
21
19
|
|
22
|
-
Then /^I am done text editing$/ do
|
23
|
-
touch_navbar_item "done text editing"
|
24
|
-
end
|
25
|
-
|
26
20
|
Then /^I should see text view "([^"]*)" with placeholder text "([^"]*)"$/ do |text_view, placeholder|
|
27
21
|
tv_exists = !query("textView marked:'#{text_view}'").empty?
|
28
22
|
unless tv_exists
|