calabash-cucumber-cn 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/Gemfile +3 -0
- data/LICENSE +29 -0
- data/PredefinedSteps.md +218 -0
- data/README.md +1 -0
- data/calabash-cucumber-cn.gemspec +22 -0
- data/features/step_definitions/calabash_steps.rb +331 -0
- data/lib/calabash-cucumber-cn.rb +2 -0
- data/lib/calabash-cucumber-cn/calabash_steps.rb +1 -0
- data/lib/calabash-cucumber-cn/version.rb +8 -0
- metadata +94 -0
checksums.yaml
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
---
|
2
|
+
!binary "U0hBMQ==":
|
3
|
+
metadata.gz: !binary |-
|
4
|
+
MGUwMDZlMTJmOGNhY2Y2MTNhMDU0NmNjNGUwNjE1MTQxZTBkMTgxMQ==
|
5
|
+
data.tar.gz: !binary |-
|
6
|
+
ZTA5MTVlMDM4YmUzMzQ3MjgxNzhmMmNkZTdmMzgwMzQwNmYzZDIyMA==
|
7
|
+
SHA512:
|
8
|
+
metadata.gz: !binary |-
|
9
|
+
ZTliMWQ5N2QzMzVkMzNkNjE0MDI2Mjk3M2RmZTM4OWZlMDc5Mzc5Zjk1NTdi
|
10
|
+
NWFiYjZhOThlOTU1M2EyNDFmMGMyOTczZmUzNDZiMDg3NmZjNGVhNDNlYTQ2
|
11
|
+
OGFmYmQ2ZTBlZWMzNGY1ZDY5MmE0YjRiNzllNzc1NGQyODFmMjU=
|
12
|
+
data.tar.gz: !binary |-
|
13
|
+
OWFkNDFmODlmMGYxNTI4YTgxNWQzMDQ5ODA3MmFmNDZmODdmYTU0MDQ5M2M5
|
14
|
+
NjNhMDU3OTRiNDM3ZDFlYWZkMDI5ODdlMjBmYjkxZjgzYTgzZjljOTk0ZDU0
|
15
|
+
MjU2NGI2NWExYjMxMmY2ZDNmNTlkMzFjYTRkMzRmYmQzNTE4YTc=
|
data/Gemfile
ADDED
data/LICENSE
ADDED
@@ -0,0 +1,29 @@
|
|
1
|
+
Copyright (c) 2014 Li Jie. All rights reserved.
|
2
|
+
|
3
|
+
Redistribution and use in source and binary forms, with or without
|
4
|
+
modification, are permitted provided that the following conditions are
|
5
|
+
met:
|
6
|
+
|
7
|
+
1. Redistributions of source code must retain the above copyright
|
8
|
+
notice, this list of conditions and the following disclaimer.
|
9
|
+
|
10
|
+
2. Redistributions in binary form must reproduce the above copyright
|
11
|
+
notice, this list of conditions and the following disclaimer in
|
12
|
+
the documentation and/or other materials provided with the
|
13
|
+
distribution.
|
14
|
+
|
15
|
+
3. Neither the name of Infrae nor the names of its contributors may
|
16
|
+
be used to endorse or promote products derived from this software
|
17
|
+
without specific prior written permission.
|
18
|
+
|
19
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
20
|
+
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
21
|
+
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
22
|
+
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL INFRAE OR
|
23
|
+
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
24
|
+
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
25
|
+
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
26
|
+
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
27
|
+
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
28
|
+
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
29
|
+
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
data/PredefinedSteps.md
ADDED
@@ -0,0 +1,218 @@
|
|
1
|
+
应用
|
2
|
+
----
|
3
|
+
|
4
|
+
```
|
5
|
+
假如 应用正在运行
|
6
|
+
```
|
7
|
+
|
8
|
+
点按
|
9
|
+
----
|
10
|
+
|
11
|
+
```
|
12
|
+
我点按屏幕左10上20
|
13
|
+
|
14
|
+
我点按"登录"
|
15
|
+
|
16
|
+
我点按"登录"右10%下10%
|
17
|
+
|
18
|
+
我点按第3个按钮
|
19
|
+
|
20
|
+
我点按"登录"按钮
|
21
|
+
|
22
|
+
我点按第2个文本框
|
23
|
+
|
24
|
+
我点按文本框"用户名"
|
25
|
+
```
|
26
|
+
|
27
|
+
列表视图说明:这里意思是第N个可见单元格!
|
28
|
+
----
|
29
|
+
|
30
|
+
```
|
31
|
+
我点按第2个列表项
|
32
|
+
|
33
|
+
我点按列表项"湖南"
|
34
|
+
```
|
35
|
+
|
36
|
+
```
|
37
|
+
我切换开关
|
38
|
+
|
39
|
+
我切换"推送"开关
|
40
|
+
|
41
|
+
我点按用户的位置
|
42
|
+
|
43
|
+
我点按完成
|
44
|
+
我点按搜索
|
45
|
+
我点按done
|
46
|
+
我点按search
|
47
|
+
```
|
48
|
+
|
49
|
+
输入文字
|
50
|
+
----
|
51
|
+
|
52
|
+
```
|
53
|
+
我在"username"中输入"username"
|
54
|
+
|
55
|
+
我在文本框"username"中输入"username"
|
56
|
+
```
|
57
|
+
|
58
|
+
别名
|
59
|
+
----
|
60
|
+
|
61
|
+
```
|
62
|
+
我在"username"中填写"username"
|
63
|
+
|
64
|
+
我用软键盘在文本框"username"中输入"username"
|
65
|
+
|
66
|
+
我在文本框中填写:
|
67
|
+
| field | text |
|
68
|
+
| username | bob |
|
69
|
+
| password | bob_password |
|
70
|
+
|
71
|
+
我在第2个文本框中输入"haha"
|
72
|
+
|
73
|
+
我用软键盘在第2个文本框中输入"haha"
|
74
|
+
|
75
|
+
我清除"username"
|
76
|
+
|
77
|
+
我清除第2个文本框
|
78
|
+
```
|
79
|
+
|
80
|
+
看见
|
81
|
+
----
|
82
|
+
|
83
|
+
```
|
84
|
+
我等到看见"登录"
|
85
|
+
|
86
|
+
我等到看不见"加载中"
|
87
|
+
|
88
|
+
我等到"登录"出现
|
89
|
+
|
90
|
+
我等到"登录"按钮出现
|
91
|
+
|
92
|
+
我等到看见标题是"设置"的导航条
|
93
|
+
|
94
|
+
我等待"请输入用户名"文本框
|
95
|
+
|
96
|
+
我等待2个文本框
|
97
|
+
|
98
|
+
我等
|
99
|
+
我等啊等
|
100
|
+
我等啊等啊等...
|
101
|
+
我等3秒
|
102
|
+
|
103
|
+
我后退
|
104
|
+
|
105
|
+
我截屏
|
106
|
+
截屏
|
107
|
+
|
108
|
+
我向左划
|
109
|
+
我向右划
|
110
|
+
我向上划
|
111
|
+
我向下划
|
112
|
+
|
113
|
+
我向左划第2个
|
114
|
+
|
115
|
+
我向左划第2个的x:10,y:20
|
116
|
+
|
117
|
+
我在"联系人"上向左划
|
118
|
+
|
119
|
+
我划动第2个格子
|
120
|
+
```
|
121
|
+
|
122
|
+
捏手势
|
123
|
+
----
|
124
|
+
|
125
|
+
```
|
126
|
+
我双指放大
|
127
|
+
我双指缩小
|
128
|
+
|
129
|
+
我在"content"上双指放大
|
130
|
+
我在"content"上双指缩小
|
131
|
+
```
|
132
|
+
|
133
|
+
说明:上、左、右看起来在webview上丢失了
|
134
|
+
---
|
135
|
+
|
136
|
+
```
|
137
|
+
我向上滚动
|
138
|
+
我向下滚动
|
139
|
+
我向左滚动
|
140
|
+
我向右滚动
|
141
|
+
|
142
|
+
我在"content"上向上滚动
|
143
|
+
```
|
144
|
+
|
145
|
+
回放
|
146
|
+
----
|
147
|
+
|
148
|
+
```
|
149
|
+
我回放记录"filename"
|
150
|
+
|
151
|
+
我在"content"上回放记录"filename"
|
152
|
+
|
153
|
+
我在"content"上回放记录"filename",偏移30,20
|
154
|
+
|
155
|
+
我反向回放记录"filename"
|
156
|
+
|
157
|
+
我在"content"上反向回放记录"filename"
|
158
|
+
|
159
|
+
我在"content"上反向回放记录"filename",偏移30,20
|
160
|
+
```
|
161
|
+
|
162
|
+
设备方向
|
163
|
+
----
|
164
|
+
|
165
|
+
```
|
166
|
+
我向左旋转设备
|
167
|
+
我向右旋转设备
|
168
|
+
|
169
|
+
我把应用切到后台5秒
|
170
|
+
```
|
171
|
+
|
172
|
+
断言
|
173
|
+
----
|
174
|
+
|
175
|
+
```
|
176
|
+
我应该看到"登录"
|
177
|
+
|
178
|
+
我应该看不到"登录"
|
179
|
+
|
180
|
+
我应该看到"登录"按钮
|
181
|
+
|
182
|
+
我应该看不到"登录"按钮
|
183
|
+
|
184
|
+
我看不到文字"用户名"
|
185
|
+
|
186
|
+
我看不到"用户名"
|
187
|
+
|
188
|
+
我看到文字"用户名"
|
189
|
+
|
190
|
+
我看到"用户名"
|
191
|
+
|
192
|
+
我应该看到以"用户"开头的文字
|
193
|
+
|
194
|
+
我应该看到包含"用户"的文字
|
195
|
+
|
196
|
+
我应该看到以"户名"结尾的文字
|
197
|
+
|
198
|
+
我看到2个文本框
|
199
|
+
|
200
|
+
我应该看到"请输入用户名"文本框
|
201
|
+
|
202
|
+
我应该看不到"请输入用户名"文本框
|
203
|
+
|
204
|
+
我应该看到地图
|
205
|
+
|
206
|
+
我应该看到用户的位置
|
207
|
+
```
|
208
|
+
|
209
|
+
日期选择器
|
210
|
+
----
|
211
|
+
|
212
|
+
```
|
213
|
+
我修改日期选择器的时间为"15:30:00"
|
214
|
+
|
215
|
+
我修改日期选择器的日期为"2014-05-07"
|
216
|
+
|
217
|
+
我修改日期选择器日期为"2014-05-07",时间为"15:30:00"
|
218
|
+
```
|
data/README.md
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
Chinese translation of calabash-cucumber, now support calabash-cucumber and calabash-android.
|
@@ -0,0 +1,22 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
$:.push File.expand_path("../lib", __FILE__)
|
3
|
+
require "calabash-cucumber-cn/version"
|
4
|
+
|
5
|
+
Gem::Specification.new do |s|
|
6
|
+
s.name = "calabash-cucumber-cn"
|
7
|
+
s.version = Calabash::Cucumber::CN::VERSION
|
8
|
+
s.platform = Gem::Platform::RUBY
|
9
|
+
s.authors = ["Li Jie"]
|
10
|
+
s.email = ["cpunion@gmail.com"]
|
11
|
+
s.homepage = "http://github.com/cpunion/calabash-cucumber-cn"
|
12
|
+
s.summary = %q{Chinese translation of calabash-cucumber}
|
13
|
+
s.description = %q{Chinese translation of calabash-cucumber.}
|
14
|
+
s.files = `git ls-files`.split("\n")
|
15
|
+
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
16
|
+
s.require_paths = ["lib"]
|
17
|
+
s.licenses = ["BSD"]
|
18
|
+
|
19
|
+
s.add_runtime_dependency 'calabash-cucumber', '~> 0.9', '>= 0.9.168'
|
20
|
+
s.add_runtime_dependency 'calabash-android', '~> 0.4', '>= 0.4.21'
|
21
|
+
|
22
|
+
end
|
@@ -0,0 +1,331 @@
|
|
1
|
+
# encoding: UTF-8
|
2
|
+
|
3
|
+
Given /^应用正在运行$/ do
|
4
|
+
macro %Q|the app is running|
|
5
|
+
end
|
6
|
+
|
7
|
+
# -- Touch --#
|
8
|
+
Then /^我点按屏幕左(\d+)上(\d+)$/ do |x, y|
|
9
|
+
if Calabash.const_defined?(:Android)
|
10
|
+
macro %Q|I click on screen #{x} from the left and #{y} from the top|
|
11
|
+
else
|
12
|
+
macro %Q|I press on screen #{x} from the left and #{y} from the top|
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
16
|
+
Then /^我点按"([^\"]*)"$/ do |name|
|
17
|
+
macro %Q|I press "#{name}"|
|
18
|
+
end
|
19
|
+
|
20
|
+
Then /^我点按"([^\"]*)"右(\d+)%下(\d+)$/ do |name,x,y|
|
21
|
+
macro %Q|I press #{x}% right and #{y}% down from "#{name}"|
|
22
|
+
end
|
23
|
+
|
24
|
+
Then /^我点按第(\d+)个按钮$/ do |index|
|
25
|
+
macro %Q|I press button number #{index}|
|
26
|
+
end
|
27
|
+
|
28
|
+
Then /^我点按"([^\"]*)"按钮$/ do |name|
|
29
|
+
macro %Q|I press the "#{name}" button|
|
30
|
+
end
|
31
|
+
|
32
|
+
Then /^我点按第(\d+)个文本框$/ do |index|
|
33
|
+
macro %Q|I press text field number #{index}|
|
34
|
+
end
|
35
|
+
|
36
|
+
|
37
|
+
Then /^我点按文本框"([^\"]*)"$/ do |name|
|
38
|
+
macro %Q|I press the "#{name}" text field|
|
39
|
+
end
|
40
|
+
|
41
|
+
#Note in tables views: this means visible cell index!
|
42
|
+
Then /^我点按第(\d+)个列表项$/ do |index|
|
43
|
+
macro %Q|I press list item number #{index}|
|
44
|
+
end
|
45
|
+
|
46
|
+
Then /^我点按列表项"([^\"]*)"$/ do |cell_name|
|
47
|
+
macro %Q|I press list item "#{cell_name}"|
|
48
|
+
end
|
49
|
+
|
50
|
+
Then /^我切换开关$/ do
|
51
|
+
macro %Q|I toggle the switch|
|
52
|
+
end
|
53
|
+
|
54
|
+
Then /^我切换"([^\"]*)"开关$/ do |name|
|
55
|
+
macro %Q|I toggle the "#{name}" switch|
|
56
|
+
end
|
57
|
+
|
58
|
+
Then /^我点按用户的位置$/ do
|
59
|
+
macro %Q|I touch the user location|
|
60
|
+
end
|
61
|
+
|
62
|
+
Then /^我点按(?:完成|搜索|done|search)$/ do
|
63
|
+
macro %Q|I touch done|
|
64
|
+
end
|
65
|
+
|
66
|
+
|
67
|
+
## -- Entering text -- ##
|
68
|
+
|
69
|
+
Then /^我在"([^\"]*)"中输入"([^\"]*)"$/ do |field_name, text_to_type|
|
70
|
+
if Calabash.const_defined?(:Android)
|
71
|
+
macro %Q|I enter "#{text_to_type}" into "#{field_name}"|
|
72
|
+
else
|
73
|
+
macro %Q|I enter "#{text_to_type}" into the "#{field_name}" field|
|
74
|
+
end
|
75
|
+
end
|
76
|
+
|
77
|
+
Then /^我在文本框"([^\"]*)"中输入"([^\"]*)"$/ do |field_name, text_to_type|
|
78
|
+
macro %Q|I enter "#{text_to_type}" into the "#{field_name}" text field|
|
79
|
+
end
|
80
|
+
|
81
|
+
# alias
|
82
|
+
Then /^我在"([^\"]*)"中填写"([^\"]*)"$/ do |text_field, text_to_type|
|
83
|
+
macro %Q|I fill in "#{text_field}" with "#{text_to_type}"|
|
84
|
+
end
|
85
|
+
|
86
|
+
Then /^我用软键盘在文本框"([^\"]*)"中输入"([^\"]*)"$/ do |field_name, text_to_type|
|
87
|
+
macro %Q|I use the native keyboard to enter "#{text_to_type}" into the "#{field_name}" text field|
|
88
|
+
end
|
89
|
+
|
90
|
+
Then /^我在文本框中填写:$/ do |table|
|
91
|
+
step %Q|I fill in text fields as follows:|, table
|
92
|
+
end
|
93
|
+
|
94
|
+
Then /^我在第(\d+)个文本框中输入"([^\"]*)"$/ do |index, text|
|
95
|
+
macro %Q|I enter "#{text}" into input field number #{index}|
|
96
|
+
end
|
97
|
+
|
98
|
+
Then /^我用软键盘在第(\d+)个文本框中输入"([^\"]*)"$/ do |index, text_to_type|
|
99
|
+
macro %Q|I use the native keyboard to enter "#{text_to_type}" into text field number #{index}|
|
100
|
+
end
|
101
|
+
|
102
|
+
When /^我清除"([^\"]*)"$/ do |name|
|
103
|
+
macro %Q|I clear "#{name}"|
|
104
|
+
end
|
105
|
+
|
106
|
+
Then /^我清除第(\d+)个文本框$/ do |index|
|
107
|
+
macro %Q|I clear text field number #{index}|
|
108
|
+
end
|
109
|
+
|
110
|
+
# -- See -- #
|
111
|
+
Then /^我等到看见"([^\"]*)"$/ do |expected_mark|
|
112
|
+
macro %Q|I wait to see "#{expected_mark}"|
|
113
|
+
end
|
114
|
+
|
115
|
+
Then /^我等到看不见"([^\"]*)"$/ do |expected_mark|
|
116
|
+
macro %Q|I wait until I don't see "#{expected_mark}|
|
117
|
+
end
|
118
|
+
|
119
|
+
Then /^我等到"([^\"]*)"出现$/ do |name|
|
120
|
+
macro %Q|I wait for "#{name}" to appear|
|
121
|
+
end
|
122
|
+
|
123
|
+
Then /^我等到"([^\"]*)"按钮出现$/ do |name|
|
124
|
+
macro %Q|I wait for the "#{name}" button to appear|
|
125
|
+
end
|
126
|
+
|
127
|
+
Then /^我等到看见标题是"([^\"]*)"的导航条$/ do |expected_mark|
|
128
|
+
macro %Q|I wait to see a navigation bar titled "#{expected_mark}"|
|
129
|
+
end
|
130
|
+
|
131
|
+
Then /^我等待"([^\"]*)"文本框$/ do |placeholder_or_view_mark|
|
132
|
+
macro %Q|I wait for the "#{placeholder_or_view_mark}" text field|
|
133
|
+
end
|
134
|
+
|
135
|
+
Then /^我等待(\d+)个文本框$/ do |count|
|
136
|
+
macro %Q|I wait for #{count} text field|
|
137
|
+
end
|
138
|
+
|
139
|
+
|
140
|
+
Then /^我等$/ do
|
141
|
+
macro %Q|I wait|
|
142
|
+
end
|
143
|
+
|
144
|
+
Then /^我等啊等$/ do
|
145
|
+
macro %Q|I wait and wait|
|
146
|
+
end
|
147
|
+
|
148
|
+
Then /^我等啊等啊等...$/ do
|
149
|
+
macro %Q|I wait and wait and wait...|
|
150
|
+
end
|
151
|
+
|
152
|
+
When /^我等([\d\.]+)秒$/ do |num_seconds|
|
153
|
+
macro %Q|I wait for #{num_seconds} seconds|
|
154
|
+
end
|
155
|
+
|
156
|
+
|
157
|
+
Then /^我后退$/ do
|
158
|
+
macro %Q|I go back|
|
159
|
+
end
|
160
|
+
|
161
|
+
Then /^(?:我)?截屏$/ do
|
162
|
+
macro %Q|I take screenshot|
|
163
|
+
end
|
164
|
+
|
165
|
+
DIRs = {"左" => "left", "右" => "right", "上" => "up", "下" => "down"}
|
166
|
+
|
167
|
+
Then /^我向(左|右|上|下)划$/ do |dir|
|
168
|
+
dir = DIRs[dir]
|
169
|
+
macro %Q|I swipe #{dir}|
|
170
|
+
end
|
171
|
+
|
172
|
+
Then /^我向(左|右|上|下)划第(\d+)个$/ do |dir, index|
|
173
|
+
dir = DIRs[dir]
|
174
|
+
macro %Q|I swipe #{dir} on number #{index}|
|
175
|
+
end
|
176
|
+
|
177
|
+
Then /^我向(左|右|上|下)划第(\d+)个的x:(\d+),y:(\d+)$/ do |dir, index, x, y|
|
178
|
+
dir = DIRs[dir]
|
179
|
+
macro %Q|I swipe #{dir} on number #{index} at x #{x} and y #{y}|
|
180
|
+
end
|
181
|
+
|
182
|
+
Then /^我在"([^\"]*)"上向(左|右|上|下)划$/ do |mark, dir|
|
183
|
+
dir = DIRs[dir]
|
184
|
+
macro %Q|I swipe #{dir} on "#{mark}"|
|
185
|
+
end
|
186
|
+
|
187
|
+
Then /^我划动第(\d+)个格子$/ do |index|
|
188
|
+
macro %Q|I swipe on cell number #{index}|
|
189
|
+
end
|
190
|
+
|
191
|
+
|
192
|
+
##pinch##
|
193
|
+
Then /^我双指(放大|缩小)$/ do |in_out|
|
194
|
+
in_out = in_out == "放大" and "in" or "out"
|
195
|
+
macro %Q|I pinch to zoom #{in_out}|
|
196
|
+
end
|
197
|
+
|
198
|
+
Then /^我在"([^\"]*)"上双指(放大|缩小)$/ do |name, in_out|
|
199
|
+
in_out = in_out == "放大" and "in" or "out"
|
200
|
+
macro %Q|I pinch to zoom #{in_out} on "#{name}"|
|
201
|
+
end
|
202
|
+
|
203
|
+
# Note "up/left/right" seems to be missing on the web base
|
204
|
+
Then /^我向(上|下|左|右)滚动$/ do |dir|
|
205
|
+
dir = DIRs[dir]
|
206
|
+
macro %Q|I scroll #{dir}|
|
207
|
+
end
|
208
|
+
|
209
|
+
Then /^我在"([^\"]*)"上向(上|下|左|右)滚动$/ do |name, dir|
|
210
|
+
dir = DIRs[dir]
|
211
|
+
macro %Q|I scroll #{dir} on "#{name}"|
|
212
|
+
end
|
213
|
+
|
214
|
+
|
215
|
+
|
216
|
+
### Playback ###
|
217
|
+
Then /^我回放记录"([^\"]*)"$/ do |filename|
|
218
|
+
macro %Q|I playback recording "#{filename}"|
|
219
|
+
end
|
220
|
+
|
221
|
+
Then /^我在"([^\"]*)"上回放记录"([^\"]*)"$/ do |name, filename|
|
222
|
+
macro %Q|I playback recording "#{filename}" on "#{name}"|
|
223
|
+
end
|
224
|
+
|
225
|
+
Then /^我在"([^\"]*)"上回放记录"([^\"]*)",偏移(\d+),(\d+)$/ do |name, filename, x, y|
|
226
|
+
macro %Q|I playback recording "#{filename}" on "#{name}" with offset #{x},#{y}|
|
227
|
+
end
|
228
|
+
|
229
|
+
Then /^我反向回放记录"([^\"]*)"$/ do |filename|
|
230
|
+
macro %Q|I reverse playback recording "#{filename}"|
|
231
|
+
end
|
232
|
+
|
233
|
+
Then /^我在"([^\"]*)"上反向回放记录"([^\"]*)"$/ do |name, filename|
|
234
|
+
macro %Q|I reverse playback recording "#{filename}" on "#{name}"|
|
235
|
+
end
|
236
|
+
|
237
|
+
Then /^我在"([^\"]*)"上反向回放记录"([^\"]*)",偏移(\d+),(\d+)$/ do |name, filename, x, y|
|
238
|
+
macro %Q|I reverse playback recording "#{filename}" on "#{name}" with offset #{x},#{y}|
|
239
|
+
end
|
240
|
+
|
241
|
+
|
242
|
+
### Device orientation ###
|
243
|
+
Then /^我向(左|右)旋转设备$/ do |dir|
|
244
|
+
dir = DIRs[dir]
|
245
|
+
macro %Q|I rotate device #{dir}|
|
246
|
+
end
|
247
|
+
|
248
|
+
Then /^我把应用切到后台(\d+)秒$/ do |secs|
|
249
|
+
macro %Q|I send app to background for #{secs} seconds|
|
250
|
+
end
|
251
|
+
|
252
|
+
### Assertions ###
|
253
|
+
Then /^我应该看到"([^\"]*)"$/ do |expected_mark|
|
254
|
+
macro %Q|I should see "#{expected_mark}"|
|
255
|
+
end
|
256
|
+
|
257
|
+
Then /^我应该看不到"([^\"]*)"$/ do |expected_mark|
|
258
|
+
macro %Q|I should not see "#{expected_mark}"|
|
259
|
+
end
|
260
|
+
|
261
|
+
Then /^我应该看到"([^\"]*)"按钮$/ do |expected_mark|
|
262
|
+
macro %Q|I should see a "#{expected_mark}" button|
|
263
|
+
end
|
264
|
+
Then /^我应该看不到"([^\"]*)"按钮$/ do |expected_mark|
|
265
|
+
macro %Q|I should not see a "#{expected_mark}" button|
|
266
|
+
end
|
267
|
+
|
268
|
+
Then /^我看不到文字"([^\"]*)"$/ do |text|
|
269
|
+
macro %Q|I don't see the text "#{text}"|
|
270
|
+
end
|
271
|
+
Then /^我看不到"([^\"]*)"$/ do |text|
|
272
|
+
macro %Q|I don't see the "#{text}"|
|
273
|
+
end
|
274
|
+
|
275
|
+
Then /^我看到文字"([^\"]*)"$/ do |text|
|
276
|
+
macro %Q|I see the text "#{text}"|
|
277
|
+
end
|
278
|
+
Then /^我看到"([^\"]*)"$/ do |text|
|
279
|
+
macro %Q|I see the "#{text}"|
|
280
|
+
end
|
281
|
+
|
282
|
+
Then /^我应该看到以"([^\"]*)"开头的文字$/ do |text|
|
283
|
+
macro %Q|I should see text starting with "#{text}"|
|
284
|
+
end
|
285
|
+
|
286
|
+
Then /^我应该看到包含"([^\"]*)"的文字$/ do |text|
|
287
|
+
macro %Q|I should see text containing "#{text}"|
|
288
|
+
end
|
289
|
+
|
290
|
+
Then /^我应该看到以"([^\"]*)"结尾的文字$/ do |text|
|
291
|
+
macro %Q|I should see text ending with "#{text}"|
|
292
|
+
end
|
293
|
+
|
294
|
+
Then /^我看到(\d+)个文本框$/ do |count|
|
295
|
+
macro %Q|I see #{count} text fields|
|
296
|
+
end
|
297
|
+
|
298
|
+
Then /^我应该看到"([^\"]*)"文本框$/ do |expected_mark|
|
299
|
+
macro %Q|I should see a "#{expected_mark}" text field|
|
300
|
+
end
|
301
|
+
|
302
|
+
Then /^我应该看不到"([^\"]*)"文本框$/ do |expected_mark|
|
303
|
+
macro %Q|I should not see a "#{expected_mark}" text field|
|
304
|
+
end
|
305
|
+
|
306
|
+
|
307
|
+
Then /^我应该看到地图$/ do
|
308
|
+
macro %Q|I should see a map|
|
309
|
+
end
|
310
|
+
|
311
|
+
Then /^我应该看到用户的位置$/ do
|
312
|
+
macro %Q|I should see the user location|
|
313
|
+
end
|
314
|
+
|
315
|
+
### Date Picker ###
|
316
|
+
|
317
|
+
# time_str can be in any format that Time can parse
|
318
|
+
Then(/^我修改日期选择器的时间为"([^"]*)"$/) do |time_str|
|
319
|
+
macro %Q|I change the date picker time to "#{time_str}"|
|
320
|
+
end
|
321
|
+
|
322
|
+
# date_str can be in any format that Date can parse
|
323
|
+
Then(/^我修改日期选择器的日期为"([^"]*)"$/) do |time_str|
|
324
|
+
macro %Q|I change the date picker date to "#{date_str}"|
|
325
|
+
end
|
326
|
+
|
327
|
+
# date_str can be in any format that Date can parse
|
328
|
+
Then(/^我修改日期选择器日期为"([^"]*)",时间为"([^"]*)"$/) do |date_str, time_str|
|
329
|
+
macro %Q|I change the date picker time to "#{time_str}"|
|
330
|
+
macro %Q|I change the date picker date to "#{date_str}"|
|
331
|
+
end
|
@@ -0,0 +1 @@
|
|
1
|
+
require File.join(File.dirname(__FILE__),'..','..','features','step_definitions',"calabash_steps")
|
metadata
ADDED
@@ -0,0 +1,94 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: calabash-cucumber-cn
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.6
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Li Jie
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2014-05-07 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: calabash-cucumber
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ~>
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0.9'
|
20
|
+
- - ! '>='
|
21
|
+
- !ruby/object:Gem::Version
|
22
|
+
version: 0.9.168
|
23
|
+
type: :runtime
|
24
|
+
prerelease: false
|
25
|
+
version_requirements: !ruby/object:Gem::Requirement
|
26
|
+
requirements:
|
27
|
+
- - ~>
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: '0.9'
|
30
|
+
- - ! '>='
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: 0.9.168
|
33
|
+
- !ruby/object:Gem::Dependency
|
34
|
+
name: calabash-android
|
35
|
+
requirement: !ruby/object:Gem::Requirement
|
36
|
+
requirements:
|
37
|
+
- - ~>
|
38
|
+
- !ruby/object:Gem::Version
|
39
|
+
version: '0.4'
|
40
|
+
- - ! '>='
|
41
|
+
- !ruby/object:Gem::Version
|
42
|
+
version: 0.4.21
|
43
|
+
type: :runtime
|
44
|
+
prerelease: false
|
45
|
+
version_requirements: !ruby/object:Gem::Requirement
|
46
|
+
requirements:
|
47
|
+
- - ~>
|
48
|
+
- !ruby/object:Gem::Version
|
49
|
+
version: '0.4'
|
50
|
+
- - ! '>='
|
51
|
+
- !ruby/object:Gem::Version
|
52
|
+
version: 0.4.21
|
53
|
+
description: Chinese translation of calabash-cucumber.
|
54
|
+
email:
|
55
|
+
- cpunion@gmail.com
|
56
|
+
executables: []
|
57
|
+
extensions: []
|
58
|
+
extra_rdoc_files: []
|
59
|
+
files:
|
60
|
+
- Gemfile
|
61
|
+
- LICENSE
|
62
|
+
- PredefinedSteps.md
|
63
|
+
- README.md
|
64
|
+
- calabash-cucumber-cn.gemspec
|
65
|
+
- features/step_definitions/calabash_steps.rb
|
66
|
+
- lib/calabash-cucumber-cn.rb
|
67
|
+
- lib/calabash-cucumber-cn/calabash_steps.rb
|
68
|
+
- lib/calabash-cucumber-cn/version.rb
|
69
|
+
homepage: http://github.com/cpunion/calabash-cucumber-cn
|
70
|
+
licenses:
|
71
|
+
- BSD
|
72
|
+
metadata: {}
|
73
|
+
post_install_message:
|
74
|
+
rdoc_options: []
|
75
|
+
require_paths:
|
76
|
+
- lib
|
77
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
78
|
+
requirements:
|
79
|
+
- - ! '>='
|
80
|
+
- !ruby/object:Gem::Version
|
81
|
+
version: '0'
|
82
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
83
|
+
requirements:
|
84
|
+
- - ! '>='
|
85
|
+
- !ruby/object:Gem::Version
|
86
|
+
version: '0'
|
87
|
+
requirements: []
|
88
|
+
rubyforge_project:
|
89
|
+
rubygems_version: 2.2.2
|
90
|
+
signing_key:
|
91
|
+
specification_version: 4
|
92
|
+
summary: Chinese translation of calabash-cucumber
|
93
|
+
test_files:
|
94
|
+
- features/step_definitions/calabash_steps.rb
|