ferrumwizard 0.3.3 → 0.3.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0c3f0ec8a43c05efd125881c0ec53edd1eda8f33275c74d09e5930530f4d3181
4
- data.tar.gz: 5df7b63e091337c2c4ec9d379724eccafc32c25c1a4d04d6dd5e6e1899ac6ee4
3
+ metadata.gz: 49e32005fe2c6c30493457c7f78fb5abe88449eb8c91b78d6b1133a7eead4200
4
+ data.tar.gz: f917d4834b0f2590effa1a33445828b287a1cb5859d51d3b666a25aa885bcf31
5
5
  SHA512:
6
- metadata.gz: bde10f90f44e531dc758d77ff5813d7d6f0f4e582d93417d90c4a53d550f75493928b8997e40ff81a789421a2a0ac115124f8d1c3b3c4496799cead588b47c46
7
- data.tar.gz: 5bc4bf974684b09bd17a09c0b58441058a4817da5e42feb502096c83cecac4ffeec4e831cb31b08a8d17451418466131718d179b54d46f5d52b3e59c9d349e1c
6
+ metadata.gz: 90ead6b645ed3e6717351f6c2b92fe9f60e98c581b9b02934ebdd02a8fdb581906b62c0696dd67907149c709cc2dd58b2d8da8303b918e3226df70ec8db164b3
7
+ data.tar.gz: e69f860e4a22a8fe51c6a5baca472bc288c301d9f140f3ec9b6a54434b59f008ce8d963f6091d5d793c2fafe9bf8b1493f9f2f80e6fe43140cc95fbc34bfe6dc
checksums.yaml.gz.sig CHANGED
Binary file
data/lib/ferrumwizard.rb CHANGED
@@ -40,6 +40,23 @@ class FerrumWizard
40
40
  @browser.body
41
41
  end
42
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
+
43
60
  def inspect()
44
61
  "#<FerrumWizard>"
45
62
  end
@@ -189,6 +206,34 @@ class FerrumWizard
189
206
 
190
207
  end
191
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
+
192
237
  def submit(h)
193
238
 
194
239
  e = nil
@@ -205,6 +250,10 @@ class FerrumWizard
205
250
 
206
251
  end
207
252
 
253
+ def to_doc()
254
+ @doc
255
+ end
256
+
208
257
  def to_rb()
209
258
  end
210
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.3
4
+ version: 0.3.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Robertson
@@ -35,7 +35,7 @@ cert_chain:
35
35
  FK+cyrQNA9DLJYJuz6uO7Z+gXZWjwAO38LUwF01w49asSv/5ZH2HH/EauX5xWpe+
36
36
  ry6lYQlb8j50Iys5elAy1p0i
37
37
  -----END CERTIFICATE-----
38
- date: 2022-05-29 00:00:00.000000000 Z
38
+ date: 2022-06-01 00:00:00.000000000 Z
39
39
  dependencies:
40
40
  - !ruby/object:Gem::Dependency
41
41
  name: ferrum
metadata.gz.sig CHANGED
Binary file