cuke_master 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/cuke_master/steps.rb +23 -7
- data/lib/cuke_master/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 87108075b629af8a0a209c204d1d1f317c187897
|
4
|
+
data.tar.gz: a876e27c0f8094ebbd36bad9975bc9e6bf79124c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fd2d0f92cb67b8525fbc342de1f654671af7d142098859aaeea953147f91b7c7c04c1a1ec4fea70cfea52cdeb031953046e89f8441d1f7979e8f8d597d7ce340
|
7
|
+
data.tar.gz: 2c74def24ca32dde798eeb39af1c4fdb3a68365ae30402641b98793971dd481d49764256b564e1ffb48f2091fb47b5f4610efdcf23ef96fd5e0ecb46eeb19ffc
|
data/lib/cuke_master/steps.rb
CHANGED
@@ -108,6 +108,15 @@ box_attribute_name, box_attribute_value, seeable_content|
|
|
108
108
|
el.click
|
109
109
|
end
|
110
110
|
|
111
|
+
# 2.9 Click on a special tag with text value
|
112
|
+
Then(/^I click on the ([^"]*) "([^"]*)" with text "([^"]*)"$/) \
|
113
|
+
do |position, tag, text|
|
114
|
+
pos_number = @pos_number[position.to_sym]
|
115
|
+
els = all(:xpath, ".//#{tag}[text()='#{text}']")
|
116
|
+
el = els[pos_number - 1]
|
117
|
+
el.set(value)
|
118
|
+
end
|
119
|
+
|
111
120
|
# 3. ========= FILL FORM ACTIONS ===========
|
112
121
|
# 3.1 Fill in a text field (given that the text field and the
|
113
122
|
# label are connected)
|
@@ -171,8 +180,7 @@ end
|
|
171
180
|
|
172
181
|
# 3.9 Upload a file
|
173
182
|
When(/^I attach file to "([^"]*)" with "([^"]*)"$/) do |field_name, file_path|
|
174
|
-
root_folder =
|
175
|
-
root_folder = File.expand_path('..', root_folder)
|
183
|
+
root_folder = Dir.pwd
|
176
184
|
attach_file field_name, "#{root_folder}/uploads/#{file_path}"
|
177
185
|
end
|
178
186
|
|
@@ -189,8 +197,7 @@ end
|
|
189
197
|
# 3.11 Upload a file
|
190
198
|
When(/^I attach file to field with attribute "([^"]*)" value "([^"]*)" with \
|
191
199
|
"([^"]*)"$/) do |attribute_name, attribute_value, file_path|
|
192
|
-
root_folder =
|
193
|
-
root_folder = File.expand_path('..', root_folder)
|
200
|
+
root_folder = Dir.pwd
|
194
201
|
page.execute_script \
|
195
202
|
"document
|
196
203
|
.querySelector(
|
@@ -207,6 +214,15 @@ When(/^I attach file to field with attribute "([^"]*)" value "([^"]*)" with \
|
|
207
214
|
visible: false
|
208
215
|
end
|
209
216
|
|
217
|
+
# 3.12 Fill in a special tag
|
218
|
+
When(/^I fill in ([^"]*) "([^"]*)" with value "([^"]*)"$/) \
|
219
|
+
do |position, tag, value|
|
220
|
+
pos_number = @pos_number[position.to_sym]
|
221
|
+
els = all(:xpath, ".//#{tag}")
|
222
|
+
el = els[pos_number - 1]
|
223
|
+
el.set(value)
|
224
|
+
end
|
225
|
+
|
210
226
|
# 4. ========= CHECKING ACTIONS ===========
|
211
227
|
# 4.1 Check what can be seen on the page
|
212
228
|
Then(/^I should see "([^"]*)"$/) do |arg1|
|
@@ -294,7 +310,7 @@ Transform(/^\[([^"]*)\]$/) do |string|
|
|
294
310
|
end
|
295
311
|
end
|
296
312
|
|
297
|
-
#
|
313
|
+
# 8.1 Transform date & time
|
298
314
|
Transform(/^([^"]*) from now( with format ([^"]*))?$/) \
|
299
315
|
do |string, _tmp, format|
|
300
316
|
number = string.split(' ')[0]
|
@@ -304,7 +320,7 @@ do |string, _tmp, format|
|
|
304
320
|
'%d-%m-%Y'
|
305
321
|
when 'y-m-d'
|
306
322
|
'%Y-%m-%d'
|
307
|
-
when 'm-d-
|
323
|
+
when 'm-d-y'
|
308
324
|
'%m-%d-%Y'
|
309
325
|
else
|
310
326
|
'%d-%m-%Y'
|
@@ -321,7 +337,7 @@ do |string, _tmp, format|
|
|
321
337
|
'%d-%m-%Y'
|
322
338
|
when 'y-m-d'
|
323
339
|
'%Y-%m-%d'
|
324
|
-
when 'm-d-
|
340
|
+
when 'm-d-y'
|
325
341
|
'%m-%d-%Y'
|
326
342
|
else
|
327
343
|
'%d-%m-%Y'
|
data/lib/cuke_master/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cuke_master
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- James Huynh
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-07-
|
11
|
+
date: 2017-07-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|