ferrumwizard 0.3.1 → 0.3.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data/lib/ferrumwizard.rb +58 -1
- data.tar.gz.sig +0 -0
- metadata +2 -22
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 49e32005fe2c6c30493457c7f78fb5abe88449eb8c91b78d6b1133a7eead4200
|
4
|
+
data.tar.gz: f917d4834b0f2590effa1a33445828b287a1cb5859d51d3b666a25aa885bcf31
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 90ead6b645ed3e6717351f6c2b92fe9f60e98c581b9b02934ebdd02a8fdb581906b62c0696dd67907149c709cc2dd58b2d8da8303b918e3226df70ec8db164b3
|
7
|
+
data.tar.gz: e69f860e4a22a8fe51c6a5baca472bc288c301d9f140f3ec9b6a54434b59f008ce8d963f6091d5d793c2fafe9bf8b1493f9f2f80e6fe43140cc95fbc34bfe6dc
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data/lib/ferrumwizard.rb
CHANGED
@@ -32,6 +32,31 @@ class FerrumWizard
|
|
32
32
|
end
|
33
33
|
end
|
34
34
|
|
35
|
+
def at_xpath(s)
|
36
|
+
@browser.at_xpath(s)
|
37
|
+
end
|
38
|
+
|
39
|
+
def body()
|
40
|
+
@browser.body
|
41
|
+
end
|
42
|
+
|
43
|
+
def click(xpath)
|
44
|
+
r = @browser.at_xpath(xpath)
|
45
|
+
r.focus.click
|
46
|
+
sleep 0.4
|
47
|
+
end
|
48
|
+
|
49
|
+
def input(xpath, value)
|
50
|
+
|
51
|
+
r = @browser.at_xpath(xpath)
|
52
|
+
puts 'xpath: ' + xpath.inspect if @debug
|
53
|
+
raise 'invalid xpath -> ' + xpath.inspect unless r
|
54
|
+
sleep 1 if @debug
|
55
|
+
r.focus.type value
|
56
|
+
sleep 1
|
57
|
+
|
58
|
+
end
|
59
|
+
|
35
60
|
def inspect()
|
36
61
|
"#<FerrumWizard>"
|
37
62
|
end
|
@@ -62,7 +87,7 @@ class FerrumWizard
|
|
62
87
|
if @debug then
|
63
88
|
puts 'name: ' + h['name']
|
64
89
|
puts 'h: ' + h.inspect
|
65
|
-
sleep 0.
|
90
|
+
sleep 0.1
|
66
91
|
end
|
67
92
|
|
68
93
|
browser.cookies.set(name: h['name'], value: h['value'],
|
@@ -181,6 +206,34 @@ class FerrumWizard
|
|
181
206
|
|
182
207
|
end
|
183
208
|
|
209
|
+
# selects an item from a nested drop-down list
|
210
|
+
#
|
211
|
+
def select(xpath, title)
|
212
|
+
|
213
|
+
e = @browser.at_xpath(xpath)
|
214
|
+
raise 'invalid xpath -> ' + xpath.inspect unless e
|
215
|
+
|
216
|
+
titles = if e.tag_name == 'select' then
|
217
|
+
e.xpath('option').map(&:text)
|
218
|
+
else
|
219
|
+
e.xpath('select/option').map(&:text)
|
220
|
+
end
|
221
|
+
|
222
|
+
r = titles.grep /#{title}/i
|
223
|
+
n = titles.index(r.first)
|
224
|
+
select_down(e, n)
|
225
|
+
sleep 0.5
|
226
|
+
|
227
|
+
end
|
228
|
+
|
229
|
+
# presses the down arrow n number of times to select a drop-down list item
|
230
|
+
#
|
231
|
+
def select_down(e, n)
|
232
|
+
e.focus
|
233
|
+
n.times { e.type(:down); sleep 0.4}
|
234
|
+
e.click
|
235
|
+
end
|
236
|
+
|
184
237
|
def submit(h)
|
185
238
|
|
186
239
|
e = nil
|
@@ -197,6 +250,10 @@ class FerrumWizard
|
|
197
250
|
|
198
251
|
end
|
199
252
|
|
253
|
+
def to_doc()
|
254
|
+
@doc
|
255
|
+
end
|
256
|
+
|
200
257
|
def to_rb()
|
201
258
|
end
|
202
259
|
|
data.tar.gz.sig
CHANGED
Binary file
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ferrumwizard
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- James Robertson
|
@@ -35,28 +35,8 @@ cert_chain:
|
|
35
35
|
FK+cyrQNA9DLJYJuz6uO7Z+gXZWjwAO38LUwF01w49asSv/5ZH2HH/EauX5xWpe+
|
36
36
|
ry6lYQlb8j50Iys5elAy1p0i
|
37
37
|
-----END CERTIFICATE-----
|
38
|
-
date: 2022-
|
38
|
+
date: 2022-06-01 00:00:00.000000000 Z
|
39
39
|
dependencies:
|
40
|
-
- !ruby/object:Gem::Dependency
|
41
|
-
name: rexle
|
42
|
-
requirement: !ruby/object:Gem::Requirement
|
43
|
-
requirements:
|
44
|
-
- - "~>"
|
45
|
-
- !ruby/object:Gem::Version
|
46
|
-
version: '1.5'
|
47
|
-
- - ">="
|
48
|
-
- !ruby/object:Gem::Version
|
49
|
-
version: 1.5.14
|
50
|
-
type: :runtime
|
51
|
-
prerelease: false
|
52
|
-
version_requirements: !ruby/object:Gem::Requirement
|
53
|
-
requirements:
|
54
|
-
- - "~>"
|
55
|
-
- !ruby/object:Gem::Version
|
56
|
-
version: '1.5'
|
57
|
-
- - ">="
|
58
|
-
- !ruby/object:Gem::Version
|
59
|
-
version: 1.5.14
|
60
40
|
- !ruby/object:Gem::Dependency
|
61
41
|
name: ferrum
|
62
42
|
requirement: !ruby/object:Gem::Requirement
|
metadata.gz.sig
CHANGED
Binary file
|