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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4e1802b19649d04e84ba84b0aef55e41bc1c6dfbc1cda67bf7a2fae23758daf7
4
- data.tar.gz: 6018069091feaacdb6996c624d59c8a85a4ffb1890152d8efde21b03e4bef855
3
+ metadata.gz: e890ccd6ddebb08f0ce354fd689f01197d6f3118612d73cbabc413f885f9d15d
4
+ data.tar.gz: ed95d60fa534d3e6a67c9640329b785df2d6ae599007782027ed0f2f089a9a65
5
5
  SHA512:
6
- metadata.gz: c28dda422345288442f9b428fc4680b8c8ac70aa328706493f5bb7b54ba93d728b5f2a0ce694872edaa0c52376d1ec6c473c071891734f04c023e652a274b3eb
7
- data.tar.gz: 67f9b1a4371bc0eb5252bcfc0ef439c1251891f18515e405a088c4eda1fe4856ad3a73022af1f83318d7c309a6e5337f63c9ffbdd8132d6ce208be4c2208fd37
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
- def self.input_value(box, txt, locate)
21
- found_box = [
22
- Browser.b.textarea("#{locate}": box).exist?,
23
- Browser.b.text_field("#{locate}": box).exist?,
24
- Browser.b.iframe("#{locate}": box).exist?
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
- WriteBoxdata.write_to_box_data(index, box, txt, locate)
33
- end
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
@@ -3,7 +3,7 @@
3
3
  module Taf
4
4
  # This module holds the TAF version information.
5
5
  module Version
6
- STRING = '0.3.4'
6
+ STRING = '0.3.5'
7
7
 
8
8
  MSG = '%<version>s (using Parser %<parser_version>s, running on ' \
9
9
  '%<ruby_engine>s %<ruby_version>s %<ruby_platform>s)'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: taf
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.4
4
+ version: 0.3.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andy Perrett