taf 0.1.8 → 0.1.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 100e35dd9978bfa05efba145ff90b4141cbdd113d1d55b85bc81bcb8b3785ff8
4
- data.tar.gz: 3a76b151dd7c36ced5f7d060fcc82af04066f81eaedd9c60e52c7ec09c813d8b
3
+ metadata.gz: 8fce262beb8801e713c9bf2bba991657eed3e3660d5098b3905d27c16abbb2c9
4
+ data.tar.gz: 9a98b39402e830e014216b8701082c89955556c90af42793ef7f797981c917c4
5
5
  SHA512:
6
- metadata.gz: 43bdb2ada7aed5194dc3157fda08baf1f4b4ce62573ffdbecd6aa52ee75ca5a4cc5138e5dfb50774e5d42ea10a8161a5e8ccf81126d6111dbeadc3b147aa62c4
7
- data.tar.gz: a2e404ee7781a6b306f8ad9bcc80007fe4306990d88bd2b05a3693244863069ecd8df73f035ff0d191eeca69c924d43f96d885bca6deb824e7ffaf81580d3250
6
+ metadata.gz: b93e27555e02b0478cbc0615a66812fe9c1621ccbebb0fbd452493fd5831b3d0ecf41af72275dffd39955eac8c06daae3b97a07d6eb9966e4c07faf7737df460
7
+ data.tar.gz: cdbe883d6dbb0ab8bf43c273eb36ae2814eff4955ad351a04e5ab2224a3157f7ad54f1ac622fd9e01fac91140239f205866f2e7c2687f0f459e2016808b88e7c
@@ -17,10 +17,10 @@ module TestSteps
17
17
 
18
18
  def login_process(b_title, user_elm, pass_elm, user, pass)
19
19
  if Browser.b.title.eql?(b_title)
20
- Browser.b.text_field(id: user_elm).wait_until.set user
21
- Browser.b.text_field(id: pass_elm).wait_until.set pass
20
+ Browser.b.text_field(id: user_elm).wait_until(&:exists?).set user
21
+ Browser.b.text_field(id: pass_elm).wait_until(&:exists?).set pass
22
22
  login_button
23
- sleep 3
23
+ sleep 1
24
24
  else
25
25
  MyLog.log.warn("User: #{user} has failed to log in.")
26
26
  end
@@ -28,9 +28,9 @@ module TestSteps
28
28
 
29
29
  def login_button
30
30
  if Browser.b.button(value: 'Sign in').exist?
31
- Browser.b.button(value: 'Sign in').wait_until.click
31
+ Browser.b.button(value: 'Sign in').wait_until(&:exists?).click
32
32
  elsif Browser.b.button(value: 'Log in').exist?
33
- Browser.b.button(value: 'Log in').wait_until.click
33
+ Browser.b.button(value: 'Log in').wait_until(&:exists?).click
34
34
  else
35
35
  MyLog.log.warn("User: #{user} has failed to log in.")
36
36
  end
@@ -75,7 +75,7 @@ module TestSteps
75
75
  Browser.b.select_list(:id => elm_id).option(:value => "#{char}").select
76
76
  }
77
77
 
78
- Browser.b.button(value: 'Sign in').wait_until.click
78
+ Browser.b.button(value: 'Sign in').wait_until(&:exists?).click
79
79
  if Browser.b.title.eql?(b_title_sucess)
80
80
  MyLog.log.info("User: #{user} has logged in successful.")
81
81
  return true
@@ -9,7 +9,7 @@ module TestSteps
9
9
  checkbox = step_attributes[:testvalue]
10
10
  locate = step_attributes[:locate]
11
11
 
12
- Browser.b.checkbox(:"#{locate}" => checkbox).wait_until.click
12
+ Browser.b.checkbox(:"#{locate}" => checkbox).wait_until(&:exists?).click
13
13
  MyLog.log.info("Check box: #{checkbox} has been selected")
14
14
  true
15
15
  rescue StandardError
@@ -19,10 +19,10 @@ module TestSteps
19
19
  index = found_box.index(true)
20
20
  return unless index
21
21
  if index.zero?
22
- Browser.b.textarea(:"#{locate}" => box).wait_until
22
+ Browser.b.textarea(:"#{locate}" => box).wait_until(&:exists?)
23
23
  (Browser.b.textarea(:"#{locate}" => box).value == value)
24
24
  elsif index == 1
25
- Browser.b.text_field(:"#{locate}" => box).wait_until
25
+ Browser.b.text_field(:"#{locate}" => box).wait_until(&:exists?)
26
26
  (Browser.b.text_field(:"#{locate}" => box).value == value)
27
27
  end
28
28
  MyLog.log.info("Textbox: #{box} has the correct value: #{value}")
@@ -6,17 +6,15 @@ module TestSteps
6
6
  register :check_browser_title
7
7
 
8
8
  def perform(step_attributes)
9
- text_check = step_attributes[:testvalue]
9
+ b_title = step_attributes[:testvalue]
10
10
 
11
- sleep 2
12
- if Browser.b.title.eql?(text_check)
13
- MyLog.log.info("Browser title: #{text_check}")
14
- return true
15
- else
16
- MyLog.log.warn("Title not found: #{text_check}")
17
- return false
18
- end
11
+ Browser.b.wait_until { Browser.b.title.eql? (b_title)}
12
+ MyLog.log.info("Browser title: #{b_title}")
13
+ true
14
+ rescue StandardError
15
+ MyLog.log.warn("Title not found: #{b_title}")
16
+ false
19
17
  end
20
18
  end
21
19
  end
22
- end
20
+ end
@@ -6,17 +6,15 @@ module TestSteps
6
6
  register :check_screen_data
7
7
 
8
8
  def perform(step_attributes)
9
- text_check = step_attributes[:testvalue]
9
+ check_text = step_attributes[:testvalue]
10
10
 
11
- sleep 5
12
- if Browser.b.text.include?(text_check)
13
- MyLog.log.info("Found text: #{text_check}")
14
- return true
15
- else
16
- MyLog.log.warn("NOT found text: #{text_check}")
17
- return false
18
- end
11
+ Browser.b.wait_until { Browser.b.element.text.include? (check_text)}
12
+ MyLog.log.info("Text found: #{check_text}")
13
+ true
14
+ rescue StandardError
15
+ MyLog.log.warn("Text not found: #{check_text}")
16
+ false
19
17
  end
20
18
  end
21
19
  end
22
- end
20
+ end
@@ -12,7 +12,7 @@ module TestSteps
12
12
  elms = %i{button span a div link image h1 h2 h3 h4}
13
13
 
14
14
  found_button = elms.map do |elm|
15
- Browser.b.send(elm, :"#{locate}" => button).exist?
15
+ Browser.b.send(elm, :"#{locate}" => button).exists?
16
16
  end.compact
17
17
 
18
18
  raise 'Multiple matches' if found_button.select { |i| i }.empty?
@@ -21,25 +21,25 @@ module TestSteps
21
21
 
22
22
  case index
23
23
  when 0
24
- Browser.b.button(:"#{locate}" => button).wait_until.click
24
+ Browser.b.button(:"#{locate}" => button).wait_until(&:exists?).click
25
25
  when 1
26
- Browser.b.span(:"#{locate}" => button).wait_until.click
26
+ Browser.b.span(:"#{locate}" => button).wait_until(&:exists?).click
27
27
  when 2
28
- Browser.b.a(:"#{locate}" => button).wait_until.click
28
+ Browser.b.a(:"#{locate}" => button).wait_until(&:exists?).click
29
29
  when 3
30
- Browser.b.div(:"#{locate}" => button).wait_until.click
30
+ Browser.b.div(:"#{locate}" => button).wait_until(&:exists?).click
31
31
  when 4
32
- Browser.b.link(:"#{locate}" => button).wait_until.click
32
+ Browser.b.link(:"#{locate}" => button).wait_until(&:exists?).click
33
33
  when 5
34
- Browser.b.image(:"#{locate}" => button).wait_until.click
34
+ Browser.b.image(:"#{locate}" => button).wait_until(&:exists?).click
35
35
  when 6
36
- Browser.b.h1(:"#{locate}" => button).wait_until.click
36
+ Browser.b.h1(:"#{locate}" => button).wait_until(&:exists?).click
37
37
  when 7
38
- Browser.b.h2(:"#{locate}" => button).wait_until.click
38
+ Browser.b.h2(:"#{locate}" => button).wait_until(&:exists?).click
39
39
  when 8
40
- Browser.b.h3(:"#{locate}" => button).wait_until.click
40
+ Browser.b.h3(:"#{locate}" => button).wait_until(&:exists?).click
41
41
  when 9
42
- Browser.b.h4(:"#{locate}" => button).wait_until.click
42
+ Browser.b.h4(:"#{locate}" => button).wait_until(&:exists?).click
43
43
  end
44
44
  MyLog.log.info("Button: #{button} has been selected")
45
45
  true
@@ -9,7 +9,7 @@ module TestSteps
9
9
  dropdown = step_attributes[:testvalue]
10
10
  locate = step_attributes[:locate]
11
11
 
12
- Browser.b.element(:"#{locate}" => dropdown).wait_until
12
+ Browser.b.element(:"#{locate}" => dropdown).wait_until(&:exists?)
13
13
  Browser.b.select_list(:"#{locate}" => dropdown).options.each do |i|
14
14
  MyLog.log.info("List of dropdown for #{dropdown} are: #{i.text}")
15
15
  return true
@@ -11,7 +11,7 @@ module TestSteps
11
11
  locate = step_attributes[:locate]
12
12
  locate2 = step_attributes[:locate2]
13
13
 
14
- Browser.b.radio(:"#{locate}" => radio).wait_until
14
+ Browser.b.radio(:"#{locate}" => radio).wait_until(&:exists?)
15
15
  Browser.b.radio(:"#{locate}" => radio, :"#{locate2}" => "#{value2}").set
16
16
  MyLog.log.info("Radio button: #{radio} has been selected")
17
17
  true
@@ -11,7 +11,7 @@ module TestSteps
11
11
  locate = step_attributes[:locate]
12
12
  locate2 = step_attributes[:locate2]
13
13
 
14
- Browser.b.select_list(:"#{locate}" => dropdown).wait_until
14
+ Browser.b.select_list(:"#{locate}" => dropdown).wait_until(&:exists?)
15
15
  Browser.b.select_list(:"#{locate}" => dropdown).option(:"#{locate2}" => "#{value2}").select
16
16
  MyLog.log.info("Dropdown item: #{value2} has been selected")
17
17
  true
@@ -19,10 +19,10 @@ module TestSteps
19
19
  index = found_box.index(true)
20
20
  return unless index
21
21
  if index.zero?
22
- Browser.b.textarea(:"#{locate}" => box).wait_until.set value
22
+ Browser.b.textarea(:"#{locate}" => box).wait_until(&:exists?).set value
23
23
  (Browser.b.textarea(:"#{locate}" => box).value == value)
24
24
  elsif index == 1
25
- Browser.b.text_field(:"#{locate}" => box).wait_until.set value
25
+ Browser.b.text_field(:"#{locate}" => box).wait_until(&:exists?).set value
26
26
  (Browser.b.text_field(:"#{locate}" => box).value == value)
27
27
  end
28
28
  MyLog.log.info("Textbox: #{box} has correct value: #{value}")
@@ -10,7 +10,7 @@ module TestSteps
10
10
  value = step_attributes[:testvalue2]
11
11
  locate = step_attributes[:locate]
12
12
 
13
- Browser.b.iframe(:"#{locate}" => iframe).wait_until
13
+ Browser.b.iframe(:"#{locate}" => iframe).wait_until(&:exists?)
14
14
  Browser.b.iframe(:"#{locate}" => iframe).send_keys value
15
15
  MyLog.log.info("Editor box: #{iframe} has correct value: #{value}")
16
16
  true
@@ -36,3 +36,6 @@ require_relative './parser/xlsx_parser'
36
36
  # Require all test step handlers, which register themselves with
37
37
  # TestStep.handlers when the files are required.
38
38
  require_relative './functions/handlers'
39
+
40
+ # Watir config. set wait:
41
+ Watir.default_timeout = 60
@@ -3,7 +3,7 @@
3
3
  module Taf
4
4
  # This module holds the TAF version information.
5
5
  module Version
6
- STRING = '0.1.8'.freeze
6
+ STRING = '0.1.9'.freeze
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)'.freeze
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: taf
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.8
4
+ version: 0.1.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andy Perrett
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-02-06 00:00:00.000000000 Z
11
+ date: 2019-03-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler