watir_drops 0.5.4 → 0.5.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/watir_drops/page_object.rb +21 -15
- data/watir_drops.gemspec +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: 87a0011675d541899558e200f9f9dbae7e1a284a
|
4
|
+
data.tar.gz: 9bcf850b3131024d493f78df7a8350e4ca624bed
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7de887e283d9ff9b641599090ac24d41e41a6a19e6cc77e746637ac4552325b7df2fdea1a9748facf9ae3614ed680aed4aed073ca881865eb44741cfa87cd4b9
|
7
|
+
data.tar.gz: 7c09c4b66b30d434cfe9d3c856b324dd852c94d34d2c2a5b3054930d8ae35dbfb82458d828673aac27b39667ea4abc0c12d65472d0bff2fcdf9d783dcf1844dc
|
@@ -38,20 +38,20 @@ module WatirDrops
|
|
38
38
|
watir_element = self.instance_exec &block
|
39
39
|
watir_element.wait_until_present
|
40
40
|
case watir_element
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
41
|
+
when Watir::Radio
|
42
|
+
watir_element.set if val
|
43
|
+
when Watir::CheckBox
|
44
|
+
val ? watir_element.set : watir_element.clear
|
45
|
+
when Watir::Select
|
46
|
+
watir_element.select val
|
47
|
+
when Watir::Button
|
48
|
+
watir_element.click
|
49
49
|
# TODO - Email & Password types are not set to UserEditable in Watir
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
50
|
+
when Watir::Input
|
51
|
+
watir_element.wd.clear
|
52
|
+
watir_element.send_keys val
|
53
|
+
else
|
54
|
+
watir_element.click if val
|
55
55
|
end
|
56
56
|
end
|
57
57
|
|
@@ -86,8 +86,14 @@ module WatirDrops
|
|
86
86
|
end
|
87
87
|
|
88
88
|
def fill_form(model)
|
89
|
-
|
90
|
-
|
89
|
+
intersect = case model
|
90
|
+
when OpenStruct
|
91
|
+
self.class.element_list & model.to_h.keys
|
92
|
+
when Hash
|
93
|
+
self.class.element_list & model.keys
|
94
|
+
else
|
95
|
+
self.class.element_list & model.keys.select { |el| !model.send(el).nil? }
|
96
|
+
end
|
91
97
|
intersect.each do |val|
|
92
98
|
self.send("#{val}=", model[val])
|
93
99
|
end
|
data/watir_drops.gemspec
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: watir_drops
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Titus Fortner
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-04-
|
11
|
+
date: 2016-04-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|