calabash-cucumber-ios-cn 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/features/step_definitions/calabash_steps.rb +153 -297
- data/lib/calabash-cucumber-ios-cn/version.rb +2 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
ZmFiZDc2YzM1NjQ3ODNhNzg2MGIzZGUwZDU3ZTYwYTI2ZDE3ZjAyMA==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
NzVmYmE5ZmIxZmI5NzNiMGE0ZTIyNGJlZmM1NzExNjIwYWQzMjY4OA==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
MmMwNGI0MDQ3NmExOTNlYzIyYjY4OTFiNDEyN2NmN2Q1NzliZGEyY2I0Y2Rk
|
10
|
+
OTJmMTAyYzA5ODY1NWRlM2YyMDc5OWQ3N2RiYWE3MzFjZWY5Y2JhMTU1ZWEy
|
11
|
+
NzBhNzI5Y2NmMjA0NmUxZjFmODYzNDU5ZTBmMjVmMmY5MTIzMGE=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
NmQzNDUyZWYzZTdhYmE4M2IxMzY5MGZmNWE2Y2E0MzA1Y2QzYTkwOGEzODYy
|
14
|
+
OTE4YWRjMDEzMWE2ODI2YWFjY2ZhMTlmOWUyNjFiNDQzN2Q1ZTFmYmZhMTll
|
15
|
+
ZGIzY2M4NGIyMDhkYmE4ODIwNWY0MmFlYmZiZmRiOGFiNzljYjA=
|
@@ -1,467 +1,323 @@
|
|
1
1
|
# encoding: UTF-8
|
2
2
|
|
3
3
|
Given /^应用正在运行$/ do
|
4
|
-
macro
|
4
|
+
macro %Q|the app is running|
|
5
5
|
end
|
6
6
|
|
7
|
-
|
8
7
|
# -- Touch --#
|
9
|
-
Then
|
10
|
-
|
11
|
-
sleep(STEP_PAUSE)
|
8
|
+
Then /^我点按屏幕左(\d+)上(\d+)$/ do |x, y|
|
9
|
+
macro %Q|I press on screen #{x} from the left and #{y} from the top|
|
12
10
|
end
|
13
11
|
|
14
|
-
Then
|
15
|
-
|
16
|
-
sleep(STEP_PAUSE)
|
12
|
+
Then /^我点按"([^\"]*)"$/ do |name|
|
13
|
+
macro %Q|I press "#{name}"|
|
17
14
|
end
|
18
15
|
|
19
|
-
Then
|
20
|
-
|
16
|
+
Then /^我点按"([^\"]*)"右(\d+)%下(\d+)$/ do |x,y,name|
|
17
|
+
macro %Q|I press #{x}% right and #{y}% down from "#{name}"|
|
21
18
|
end
|
22
19
|
|
23
|
-
Then
|
24
|
-
|
25
|
-
screenshot_and_raise "Index should be positive (was: #{index})" if (index<=0)
|
26
|
-
touch("button index:#{index-1}")
|
27
|
-
sleep(STEP_PAUSE)
|
20
|
+
Then /^我点按第(\d+)个按钮$/ do |index|
|
21
|
+
macro %Q|I press button number #{index}|
|
28
22
|
end
|
29
23
|
|
30
|
-
Then
|
31
|
-
|
32
|
-
sleep(STEP_PAUSE)
|
24
|
+
Then /^我点按"([^\"]*)"按钮$/ do |name|
|
25
|
+
macro %Q|I press the "#{name}" button|
|
33
26
|
end
|
34
27
|
|
35
|
-
Then
|
36
|
-
|
37
|
-
screenshot_and_raise "Index should be positive (was: #{index})" if (index<=0)
|
38
|
-
touch("textField index:#{index-1}")
|
39
|
-
sleep(STEP_PAUSE)
|
28
|
+
Then /^我点按第(\d+)个文本框$/ do |index|
|
29
|
+
macro %Q|I press text field number #{index}|
|
40
30
|
end
|
41
31
|
|
42
32
|
|
43
|
-
Then
|
44
|
-
|
45
|
-
marked_query = "textField marked:'#{name}'"
|
46
|
-
if !query(placeholder_query).empty?
|
47
|
-
touch(placeholder_query)
|
48
|
-
elsif !query(marked_query).empty?
|
49
|
-
touch(marked_query)
|
50
|
-
else
|
51
|
-
screenshot_and_raise "could not find text field with placeholder '#{name}' or marked as '#{name}'"
|
52
|
-
end
|
53
|
-
sleep(STEP_PAUSE)
|
33
|
+
Then /^我点按文本框"([^\"]*)"$/ do |name|
|
34
|
+
macro %Q|I press the "#{name}" text field|
|
54
35
|
end
|
55
36
|
|
56
37
|
#Note in tables views: this means visible cell index!
|
57
|
-
Then
|
58
|
-
|
59
|
-
screenshot_and_raise "Index should be positive (was: #{index})" if (index<=0)
|
60
|
-
touch("tableViewCell index:#{index-1}")
|
61
|
-
sleep(STEP_PAUSE)
|
38
|
+
Then /^我点按第(\d+)个列表项$/ do |index|
|
39
|
+
macro %Q|I press list item number #{index}|
|
62
40
|
end
|
63
41
|
|
64
|
-
Then
|
65
|
-
|
66
|
-
query("tableViewCell marked:'#{cell_name}'").empty?
|
67
|
-
then
|
68
|
-
touch("tableViewCell text:'#{cell_name}'")
|
69
|
-
else
|
70
|
-
touch("tableViewCell marked:'#{cell_name}'")
|
71
|
-
end
|
72
|
-
sleep(STEP_PAUSE)
|
42
|
+
Then /^我点按列表项"([^\"]*)"$/ do |cell_name|
|
43
|
+
macro %Q|I press list item "#{cell_name}"|
|
73
44
|
end
|
74
45
|
|
75
|
-
Then
|
76
|
-
|
77
|
-
sleep(STEP_PAUSE)
|
46
|
+
Then /^我切换开关$/ do
|
47
|
+
macro %Q|I toggle the switch|
|
78
48
|
end
|
79
49
|
|
80
|
-
Then
|
81
|
-
|
82
|
-
sleep(STEP_PAUSE)
|
50
|
+
Then /^我切换"([^\"]*)"开关$/ do |name|
|
51
|
+
macro %Q|I toggle the "#{name}" switch|
|
83
52
|
end
|
84
53
|
|
85
|
-
Then
|
86
|
-
touch
|
87
|
-
sleep(STEP_PAUSE)
|
54
|
+
Then /^我点按用户的位置$/ do
|
55
|
+
macro %Q|I touch the user location|
|
88
56
|
end
|
89
57
|
|
90
|
-
Then
|
91
|
-
done
|
92
|
-
sleep(STEP_PAUSE)
|
58
|
+
Then /^我点按(?:完成|搜索|done|search)$/ do
|
59
|
+
macro %Q|I touch done|
|
93
60
|
end
|
94
61
|
|
95
62
|
|
96
63
|
## -- Entering text -- ##
|
97
64
|
|
98
|
-
Then
|
99
|
-
|
100
|
-
wait_for_keyboard()
|
101
|
-
keyboard_enter_text text_to_type
|
102
|
-
sleep(STEP_PAUSE)
|
65
|
+
Then /^我在"([^\"]*)"中输入"([^\"]*)"$/ do |text_to_type, field_name|
|
66
|
+
macro %Q|I enter "#{text_to_type}" into the "#{field_name}" field|
|
103
67
|
end
|
104
68
|
|
105
|
-
Then
|
106
|
-
|
107
|
-
wait_for_keyboard()
|
108
|
-
keyboard_enter_text text_to_type
|
109
|
-
sleep(STEP_PAUSE)
|
69
|
+
Then /^我在文本框"([^\"]*)"中输入"([^\"]*)"$/ do |text_to_type, field_name|
|
70
|
+
macro %Q|I enter "#{text_to_type}" into the "#{field_name}" text field|
|
110
71
|
end
|
111
72
|
|
112
73
|
# alias
|
113
|
-
Then
|
114
|
-
macro %Q|I
|
74
|
+
Then /^我在"([^\"]*)"中填写"([^\"]*)"$/ do |text_field, text_to_type|
|
75
|
+
macro %Q|I fill in "#{text_field}" with "#{text_to_type}"|
|
115
76
|
end
|
116
77
|
|
117
|
-
Then
|
118
|
-
macro %Q|I
|
119
|
-
wait_for_keyboard()
|
120
|
-
keyboard_enter_text(text_to_type)
|
121
|
-
sleep(STEP_PAUSE)
|
78
|
+
Then /^我用软键盘输入"([^\"]*)"到"([^\"]*)"文本框$/ do |text_to_type, field_name|
|
79
|
+
macro %Q|I use the native keyboard to enter "#{text_to_type}" into the "#{field_name}" text field|
|
122
80
|
end
|
123
81
|
|
124
|
-
Then
|
125
|
-
|
126
|
-
macro %Q|I enter "#{row['text']}" into the "#{row['field']}" text field|
|
127
|
-
end
|
82
|
+
Then /^我在文本框中填写:$/ do |table|
|
83
|
+
step %Q|I fill in text fields as follows:|, table
|
128
84
|
end
|
129
85
|
|
130
|
-
Then
|
131
|
-
|
132
|
-
screenshot_and_raise "Index should be positive (was: #{index})" if (index<=0)
|
133
|
-
touch("textField index:#{index-1}")
|
134
|
-
wait_for_keyboard()
|
135
|
-
keyboard_enter_text text
|
136
|
-
sleep(STEP_PAUSE)
|
86
|
+
Then /^我在第(\d+)个文本框中输入"([^\"]*)"$/ do |text, index|
|
87
|
+
macro %Q|I enter "#{text}" into text field number #{index}|
|
137
88
|
end
|
138
89
|
|
139
|
-
Then
|
140
|
-
|
141
|
-
macro %Q|I touch text field number #{idx}|
|
142
|
-
wait_for_keyboard()
|
143
|
-
keyboard_enter_text(text_to_type)
|
144
|
-
sleep(STEP_PAUSE)
|
90
|
+
Then /^我用软键盘在第(\d+)个文本框中输入"([^\"]*)"$/ do |text_to_type, index|
|
91
|
+
macro %Q|I use the native keyboard to enter "#{text_to_type}" into text field number #{index}|
|
145
92
|
end
|
146
93
|
|
147
|
-
When
|
148
|
-
|
149
|
-
_deprecated('0.9.151', msg, :warn)
|
150
|
-
clear_text("textField marked:'#{name}'")
|
94
|
+
When /^我清除"([^\"]*)"$/ do |name|
|
95
|
+
macro %Q|I clear "#{name}"|
|
151
96
|
end
|
152
97
|
|
153
|
-
Then
|
154
|
-
|
155
|
-
screenshot_and_raise "Index should be positive (was: #{index})" if (index<=0)
|
156
|
-
clear_text("textField index:#{index-1}")
|
98
|
+
Then /^我清除第(\d+)个文本框$/ do |index|
|
99
|
+
macro %Q|I clear text field number #{index}|
|
157
100
|
end
|
158
101
|
|
159
102
|
# -- See -- #
|
160
|
-
Then
|
161
|
-
|
162
|
-
end
|
163
|
-
|
164
|
-
Then /^I wait until I don't see "([^\"]*)"$/ do |expected_mark|
|
165
|
-
sleep 1## wait for previous screen to disappear
|
166
|
-
wait_for(WAIT_TIMEOUT) { not element_exists( "view marked:'#{expected_mark}'" )}
|
103
|
+
Then /^我等到看见"([^\"]*)"$/ do |expected_mark|
|
104
|
+
macro %Q|I wait to see "#{expected_mark}"|
|
167
105
|
end
|
168
106
|
|
169
|
-
Then
|
170
|
-
macro %Q|I wait until I don't see "#{expected_mark}
|
107
|
+
Then /^我等到看不见"([^\"]*)"$/ do |expected_mark|
|
108
|
+
macro %Q|I wait until I don't see "#{expected_mark}|
|
171
109
|
end
|
172
110
|
|
173
|
-
Then
|
174
|
-
macro %Q|I wait
|
111
|
+
Then /^我等到"([^\"]*)"出现$/ do |name|
|
112
|
+
macro %Q|I wait for "#{name}" to appear|
|
175
113
|
end
|
176
114
|
|
177
|
-
Then
|
178
|
-
|
115
|
+
Then /^我等到"([^\"]*)"按钮出现$/ do |name|
|
116
|
+
macro %Q|I wait for the "#{name}" button to appear|
|
179
117
|
end
|
180
118
|
|
181
|
-
Then
|
182
|
-
|
183
|
-
wait_for(:timeout => WAIT_TIMEOUT,
|
184
|
-
:timeout_message => msg ) do
|
185
|
-
all_items = query("navigationItemView marked:'#{expected_mark}'")
|
186
|
-
button_items = query("navigationItemButtonView")
|
187
|
-
non_button_items = all_items.delete_if { |item| button_items.include?(item) }
|
188
|
-
!non_button_items.empty?
|
189
|
-
end
|
119
|
+
Then /^我等到看见标题是"([^\"]*)"的导航条$/ do |expected_mark|
|
120
|
+
macro %Q|I wait to see a navigation bar titled "#{expected_mark}"|
|
190
121
|
end
|
191
122
|
|
192
|
-
Then
|
193
|
-
|
194
|
-
element_exists( "textField placeholder:'#{placeholder_or_view_mark}'") ||
|
195
|
-
element_exists( "textField marked:'#{placeholder_or_view_mark}'")
|
196
|
-
}
|
123
|
+
Then /^我等待"([^\"]*)"文本框$/ do |placeholder_or_view_mark|
|
124
|
+
macro %Q|I wait for the "#{placeholder_or_view_mark}" text field|
|
197
125
|
end
|
198
126
|
|
199
|
-
Then
|
200
|
-
count
|
201
|
-
wait_for(WAIT_TIMEOUT) { query(:textField).count >= count }
|
127
|
+
Then /^我等待(\d+)个文本框$/ do |count|
|
128
|
+
macro %Q|I wait for #{count} text field|
|
202
129
|
end
|
203
130
|
|
204
131
|
|
205
|
-
Then
|
206
|
-
|
132
|
+
Then /^我等$/ do
|
133
|
+
macro %Q|I wait|
|
207
134
|
end
|
208
135
|
|
209
|
-
Then
|
210
|
-
|
136
|
+
Then /^我等啊等$/ do
|
137
|
+
macro %Q|I wait and wait|
|
211
138
|
end
|
212
139
|
|
213
|
-
Then
|
214
|
-
|
140
|
+
Then /^我等啊等啊等...$/ do
|
141
|
+
macro %Q|I wait and wait and wait...|
|
215
142
|
end
|
216
143
|
|
217
|
-
When
|
218
|
-
|
219
|
-
sleep num_seconds
|
144
|
+
When /^我等([\d\.]+)秒$/ do |num_seconds|
|
145
|
+
macro %Q|I wait for #{num_seconds} seconds|
|
220
146
|
end
|
221
147
|
|
222
148
|
|
223
|
-
Then
|
224
|
-
|
225
|
-
sleep(STEP_PAUSE)
|
149
|
+
Then /^我后退$/ do
|
150
|
+
macro %Q|I go back|
|
226
151
|
end
|
227
152
|
|
228
|
-
Then /^(
|
229
|
-
|
230
|
-
screenshot_embed
|
153
|
+
Then /^(?:我)?截屏$/ do
|
154
|
+
macro %Q|I take screenshot|
|
231
155
|
end
|
232
156
|
|
233
|
-
|
234
|
-
|
235
|
-
|
157
|
+
DIRs = {"左" => "left", "右" => "right", "上" => "up", "下" => "down"}
|
158
|
+
|
159
|
+
Then /^我向(左|右|上|下)划$/ do |dir|
|
160
|
+
dir = DIRs[dir]
|
161
|
+
macro %Q|I swipe #{dir}|
|
236
162
|
end
|
237
163
|
|
238
|
-
Then
|
239
|
-
|
240
|
-
|
241
|
-
swipe(dir, {:query => "scrollView index:#{index-1}"})
|
242
|
-
sleep(STEP_PAUSE)
|
164
|
+
Then /^我向(左|右|上|下)划第(\d+)个$/ do |dir, index|
|
165
|
+
dir = DIRs[dir]
|
166
|
+
macro %Q|I swipe #{dir} on number #{index}|
|
243
167
|
end
|
244
168
|
|
245
|
-
Then
|
246
|
-
|
247
|
-
|
248
|
-
swipe(dir, {:offset => {:x => x.to_i, :y => y.to_i}, :query => "scrollView index:#{index-1}"})
|
249
|
-
sleep(STEP_PAUSE)
|
169
|
+
Then /^我向(左|右|上|下)划第(\d+)个的x:(\d+),y:(\d+)$/ do |dir, index, x, y|
|
170
|
+
dir = DIRs[dir]
|
171
|
+
macro %Q|I swipe #{dir} on number #{index} at x #{x} and y #{y}|
|
250
172
|
end
|
251
173
|
|
252
|
-
Then
|
253
|
-
|
254
|
-
|
174
|
+
Then /^我在"([^\"]*)"上向(左|右|上|下)划$/ do |dir, mark|
|
175
|
+
dir = DIRs[dir]
|
176
|
+
macro %Q|I swipe #{dir} on "#{mark}"|
|
255
177
|
end
|
256
178
|
|
257
|
-
Then
|
258
|
-
|
259
|
-
screenshot_and_raise "Index should be positive (was: #{index})" if (index<=0)
|
260
|
-
cell_swipe({:query => "tableViewCell index:#{index-1}"})
|
261
|
-
sleep(STEP_PAUSE)
|
179
|
+
Then /^我划动第(\d+)个格子$/ do |index|
|
180
|
+
macro %Q|I swipe on cell number #{index}|
|
262
181
|
end
|
263
182
|
|
264
183
|
|
265
184
|
##pinch##
|
266
|
-
Then
|
267
|
-
|
268
|
-
|
185
|
+
Then /^我双指(放大|缩小)$/ do |in_out|
|
186
|
+
in_out = in_out == "放大" and "in" or "out"
|
187
|
+
macro %Q|I pinch to zoom #{in_out}|
|
269
188
|
end
|
270
189
|
|
271
|
-
Then
|
272
|
-
|
273
|
-
|
190
|
+
Then /^我在"([^\"]*)"上双指(放大|缩小)$/ do |name, in_out|
|
191
|
+
in_out = in_out == "放大" and "in" or "out"
|
192
|
+
macro %Q|I pinch to zoom #{in_out} on "#{name}"|
|
274
193
|
end
|
275
194
|
|
276
195
|
# Note "up/left/right" seems to be missing on the web base
|
277
|
-
Then
|
278
|
-
|
279
|
-
|
196
|
+
Then /^我向(上|下|左|右)滚动$/ do |dir|
|
197
|
+
dir = DIRs[dir]
|
198
|
+
macro %Q|I scroll #{dir}|
|
280
199
|
end
|
281
200
|
|
282
|
-
Then
|
283
|
-
|
284
|
-
|
201
|
+
Then /^我在"([^\"]*)"上向(上|下|左|右)滚动$/ do |name, dir|
|
202
|
+
dir = DIRs[dir]
|
203
|
+
macro %Q|I scroll #{dir} on "#{name}"|
|
285
204
|
end
|
286
205
|
|
287
206
|
|
288
207
|
|
289
208
|
### Playback ###
|
290
|
-
Then
|
291
|
-
|
292
|
-
sleep(STEP_PAUSE)
|
209
|
+
Then /^我回放记录"([^\"]*)"$/ do |filename|
|
210
|
+
macro %Q|I playback recording "#{filename}"|
|
293
211
|
end
|
294
212
|
|
295
|
-
Then
|
296
|
-
|
297
|
-
sleep(STEP_PAUSE)
|
213
|
+
Then /^我在"([^\"]*)"上回放记录"([^\"]*)"$/ do |name, filename|
|
214
|
+
macro %Q|I playback recording "#{filename}" on "#{name}"|
|
298
215
|
end
|
299
216
|
|
300
|
-
Then
|
301
|
-
|
302
|
-
y = y.to_i
|
303
|
-
playback(filename, {:query => "view marked:'#{name}'", :offset => {:x => x, :y => y}})
|
304
|
-
sleep(STEP_PAUSE)
|
217
|
+
Then /^我在"([^\"]*)"上回放记录"([^\"]*)",偏移(\d+),(\d+)$/ do |name, filename, x, y|
|
218
|
+
macro %Q|I playback recording "#{filename}" on "#{name}" with offset #{x},#{y}|
|
305
219
|
end
|
306
220
|
|
307
|
-
Then
|
308
|
-
|
309
|
-
sleep(STEP_PAUSE)
|
221
|
+
Then /^我反向回放记录"([^\"]*)"$/ do |filename|
|
222
|
+
macro %Q|I reverse playback recording "#{filename}"|
|
310
223
|
end
|
311
224
|
|
312
|
-
Then
|
313
|
-
playback
|
314
|
-
sleep(STEP_PAUSE)
|
225
|
+
Then /^我在"([^\"]*)"上反向回放记录"([^\"]*)"$/ do |name, filename|
|
226
|
+
macro %Q|I reverse playback recording "#{filename}" on "#{name}"|
|
315
227
|
end
|
316
228
|
|
317
|
-
Then
|
318
|
-
|
319
|
-
y = y.to_i
|
320
|
-
playback(filename, {:query => "view marked:'#{name}'", :offset => {:x => x, :y => y},:reverse => true})
|
321
|
-
sleep(STEP_PAUSE)
|
229
|
+
Then /^我在"([^\"]*)"上反向回放记录"([^\"]*)",偏移(\d+),(\d+)$/ do |name, filename, x, y|
|
230
|
+
macro %Q|I reverse playback recording "#{filename}" on "#{name}" with offset #{x},#{y}|
|
322
231
|
end
|
323
232
|
|
324
233
|
|
325
234
|
### Device orientation ###
|
326
|
-
Then
|
327
|
-
dir = dir
|
328
|
-
rotate
|
329
|
-
sleep(5)#SERVO wait
|
235
|
+
Then /^我向(左|右)旋转设备$/ do |dir|
|
236
|
+
dir = DIRs[dir]
|
237
|
+
macro %Q|I rotate device #{dir}|
|
330
238
|
end
|
331
239
|
|
332
|
-
Then
|
333
|
-
|
334
|
-
send_app_to_background(secs)
|
335
|
-
sleep(secs+10)
|
240
|
+
Then /^我把应用切到后台(\d+)秒$/ do |secs|
|
241
|
+
macro %Q|I send app to background for #{secs} seconds|
|
336
242
|
end
|
337
243
|
|
338
244
|
### Assertions ###
|
339
|
-
Then
|
340
|
-
|
341
|
-
element_exists( "view text:'#{expected_mark}'"))
|
342
|
-
if not res
|
343
|
-
screenshot_and_raise "No element found with mark or text: #{expected_mark}"
|
344
|
-
end
|
245
|
+
Then /^我应该看到"([^\"]*)"$/ do |expected_mark|
|
246
|
+
macro %Q|I should see "#{expected_mark}"|
|
345
247
|
end
|
346
248
|
|
347
|
-
Then
|
348
|
-
|
349
|
-
res.concat query("view text:'#{expected_mark}'")
|
350
|
-
unless res.empty?
|
351
|
-
screenshot_and_raise "Expected no element with text nor accessibilityLabel: #{expected_mark}, found #{res.join(", ")}"
|
352
|
-
end
|
249
|
+
Then /^我应该看不到"([^\"]*)"$/ do |expected_mark|
|
250
|
+
macro %Q|I should not see "#{expected_mark}"|
|
353
251
|
end
|
354
252
|
|
355
|
-
Then
|
356
|
-
|
253
|
+
Then /^我应该看到"([^\"]*)"按钮$/ do |expected_mark|
|
254
|
+
macro %Q|I should see a "#{expected_mark}" button|
|
357
255
|
end
|
358
|
-
Then
|
359
|
-
|
256
|
+
Then /^我应该看不到"([^\"]*)"按钮$/ do |expected_mark|
|
257
|
+
macro %Q|I should not see a "#{expected_mark}" button|
|
360
258
|
end
|
361
259
|
|
362
|
-
Then
|
363
|
-
macro %Q|I
|
260
|
+
Then /^我看不到文字"([^\"]*)"$/ do |text|
|
261
|
+
macro %Q|I don't see the text "#{text}"|
|
364
262
|
end
|
365
|
-
Then
|
366
|
-
macro %Q|I
|
263
|
+
Then /^我看不到"([^\"]*)"$/ do |text|
|
264
|
+
macro %Q|I don't see the "#{text}"|
|
367
265
|
end
|
368
266
|
|
369
|
-
Then
|
370
|
-
macro %Q|I
|
267
|
+
Then /^我看到文字"([^\"]*)"$/ do |text|
|
268
|
+
macro %Q|I see the text "#{text}"|
|
371
269
|
end
|
372
|
-
Then
|
373
|
-
macro %Q|I
|
270
|
+
Then /^我看到"([^\"]*)"$/ do |text|
|
271
|
+
macro %Q|I see the "#{text}"|
|
374
272
|
end
|
375
273
|
|
376
|
-
Then
|
377
|
-
|
378
|
-
if res
|
379
|
-
screenshot_and_raise "No text found starting with: #{text}"
|
380
|
-
end
|
274
|
+
Then /^我应该看到以"([^\"]*)"开头的文字$/ do |text|
|
275
|
+
macro %Q|I should see text starting with "#{text}"|
|
381
276
|
end
|
382
277
|
|
383
|
-
Then
|
384
|
-
|
385
|
-
if res
|
386
|
-
screenshot_and_raise "No text found containing: #{text}"
|
387
|
-
end
|
278
|
+
Then /^我应该看到包含"([^\"]*)"的文字$/ do |text|
|
279
|
+
macro %Q|I should see text containing "#{text}"|
|
388
280
|
end
|
389
281
|
|
390
|
-
Then
|
391
|
-
|
392
|
-
if res
|
393
|
-
screenshot_and_raise "No text found ending with: #{text}"
|
394
|
-
end
|
282
|
+
Then /^我应该看到以"([^\"]*)"结尾的文字$/ do |text|
|
283
|
+
macro %Q|I should see text ending with "#{text}"|
|
395
284
|
end
|
396
285
|
|
397
|
-
Then
|
398
|
-
count
|
399
|
-
cnt = query(:textField).count
|
400
|
-
if cnt < count
|
401
|
-
screenshot_and_raise "Expected at least #{count} text/input fields, found #{cnt}"
|
402
|
-
end
|
286
|
+
Then /^我看到(\d+)个文本框$/ do |count|
|
287
|
+
macro %Q|I see #{count} text fields|
|
403
288
|
end
|
404
289
|
|
405
|
-
Then
|
406
|
-
|
407
|
-
element_exists("textField marked:'#{expected_mark}'")
|
408
|
-
unless res
|
409
|
-
screenshot_and_raise "Expected textfield with placeholder or accessibilityLabel: #{expected_mark}"
|
410
|
-
end
|
290
|
+
Then /^我应该看到"([^\"]*)"文本框$/ do |expected_mark|
|
291
|
+
macro %Q|I should see a "#{expected_mark}" text field|
|
411
292
|
end
|
412
293
|
|
413
|
-
Then
|
414
|
-
|
415
|
-
res.concat query("textField marked:'#{expected_mark}'")
|
416
|
-
unless res.empty?
|
417
|
-
screenshot_and_raise "Expected no textfield with placeholder nor accessibilityLabel: #{expected_mark}, found #{res}"
|
418
|
-
end
|
294
|
+
Then /^我应该看不到"([^\"]*)"文本框$/ do |expected_mark|
|
295
|
+
macro %Q|I should not see a "#{expected_mark}" text field|
|
419
296
|
end
|
420
297
|
|
421
298
|
|
422
|
-
Then
|
423
|
-
|
299
|
+
Then /^我应该看到地图$/ do
|
300
|
+
macro %Q|I should see a map|
|
424
301
|
end
|
425
302
|
|
426
|
-
Then
|
427
|
-
|
303
|
+
Then /^我应该看到用户的位置$/ do
|
304
|
+
macro %Q|I should see the user location|
|
428
305
|
end
|
429
306
|
|
430
307
|
### Date Picker ###
|
431
308
|
|
432
309
|
# time_str can be in any format that Time can parse
|
433
|
-
Then(
|
434
|
-
|
435
|
-
current_date = date_time_from_picker()
|
436
|
-
current_date = DateTime.new(current_date.year,
|
437
|
-
current_date.mon,
|
438
|
-
current_date.day,
|
439
|
-
target_time.hour,
|
440
|
-
target_time.min,
|
441
|
-
0,
|
442
|
-
target_time.gmt_offset)
|
443
|
-
picker_set_date_time current_date
|
444
|
-
sleep(STEP_PAUSE)
|
310
|
+
Then(/^我修改日期选择器的时间为"([^"]*)"$/) do |time_str|
|
311
|
+
macro %Q|I change the date picker time to "#{time_str}"|
|
445
312
|
end
|
446
313
|
|
447
314
|
# date_str can be in any format that Date can parse
|
448
|
-
Then(
|
449
|
-
|
450
|
-
current_time = date_time_from_picker()
|
451
|
-
date_time = DateTime.new(target_date.year,
|
452
|
-
target_date.mon,
|
453
|
-
target_date.day,
|
454
|
-
current_time.hour,
|
455
|
-
current_time.min,
|
456
|
-
0,
|
457
|
-
Time.now.sec,
|
458
|
-
current_time.offset)
|
459
|
-
picker_set_date_time date_time
|
460
|
-
sleep(STEP_PAUSE)
|
315
|
+
Then(/^我修改日期选择器的日期为"([^"]*)"$/) do |time_str|
|
316
|
+
macro %Q|I change the date picker date to "#{date_str}"|
|
461
317
|
end
|
462
318
|
|
463
319
|
# date_str can be in any format that Date can parse
|
464
|
-
Then(
|
320
|
+
Then(/^我修改日期选择器日期为"([^"]*)",时间为"([^"]*)"$/) do |date_str, time_str|
|
465
321
|
macro %Q|I change the date picker time to "#{time_str}"|
|
466
322
|
macro %Q|I change the date picker date to "#{date_str}"|
|
467
323
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: calabash-cucumber-ios-cn
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Li Jie
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-05-
|
11
|
+
date: 2014-05-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: calabash-cucumber
|