taf 0.3.4 → 0.3.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/functions/handlers/write_box_data.rb +7 -25
- data/lib/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e890ccd6ddebb08f0ce354fd689f01197d6f3118612d73cbabc413f885f9d15d
|
4
|
+
data.tar.gz: ed95d60fa534d3e6a67c9640329b785df2d6ae599007782027ed0f2f089a9a65
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 511758778621850bb660c4d1112cd90adf82ff095a97e817d3070ea29d139fee111e15cfa2ee0f992c92b246d6f8167d4017adb0568fddc701939595a4b6bf60
|
7
|
+
data.tar.gz: fee2faa59db43f0a57cdf8a00c47a47cc4ab50130bb5343b2d7db92c6f5b26e199fef739542a63d0333aa783da2f6c19703acbd2db1f300aca2f4fddafacc127
|
@@ -12,41 +12,23 @@ module TestSteps
|
|
12
12
|
box = step_attributes[:testvalue]
|
13
13
|
value = step_attributes[:testvalue2]
|
14
14
|
locate = step_attributes[:locate]
|
15
|
-
|
16
15
|
txt = ENV[value.to_s] || step_attributes[:testvalue2]
|
17
|
-
WriteBoxdata.input_value(box, txt, locate)
|
18
|
-
end
|
19
16
|
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
Browser.b.
|
24
|
-
|
25
|
-
]
|
17
|
+
elms = %i[textarea text_field iframe]
|
18
|
+
|
19
|
+
found_box = elms.map do |elm|
|
20
|
+
Browser.b.send(elm, "#{locate}": box).exists?
|
21
|
+
end.compact
|
26
22
|
|
27
23
|
raise 'Multiple matches' if found_box.select { |i| i }.empty?
|
28
24
|
|
29
25
|
index = found_box.index(true)
|
30
26
|
return unless index
|
31
27
|
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
def self.write_to_box_data(index, box, txt, locate)
|
36
|
-
if index.zero?
|
37
|
-
Browser.b.textarea("#{locate}": box).wait_until(&:exists?).set txt
|
38
|
-
(Browser.b.textarea("#{locate}": box).text == txt)
|
39
|
-
elsif index == 1
|
40
|
-
Browser.b.text_field("#{locate}": box).wait_until(&:exists?).set txt
|
41
|
-
(Browser.b.text_field("#{locate}": box).text == txt)
|
42
|
-
elsif index == 2
|
43
|
-
Browser.b.iframe("#{locate}": box).wait_until(&:exists?).send_keys txt
|
44
|
-
end
|
28
|
+
Browser.b.send(elms[index], "#{locate}": box)
|
29
|
+
.wait_until(&:exists?).send_keys txt
|
45
30
|
MyLog.log.info("Textbox: #{box} has correct value: #{txt}")
|
46
31
|
true
|
47
|
-
rescue StandardError
|
48
|
-
MyLog.log.warn("Textbox: #{box} has the incorrect value: #{txt}")
|
49
|
-
false
|
50
32
|
rescue StandardError
|
51
33
|
MyLog.log.warn("Textbox: #{box} does not exist")
|
52
34
|
false
|
data/lib/version.rb
CHANGED