taf 0.2.9 → 0.3.0

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: a7ee33e27841a60600a1f1287ef9637edd4d21f32229a2cc034e7101e7f2812f
4
- data.tar.gz: aa791f1fc23256d0cb2bd779d01a9102177944228d8d26b3065c501bf367d2b8
3
+ metadata.gz: d3ff58b175551a2af8c4be802f8f78e01938507f4b2dd05e651a0428a846d006
4
+ data.tar.gz: 92d745cf353c25157b3cc667a961b3cb98bfdbb851944d68bf79be032aa13281
5
5
  SHA512:
6
- metadata.gz: ec853637cdbbabb3a6c99995a490627e2906b416f59a562316084b05f39ef40c14d257cc27f3eb8fca80fb71df8fbb1912eabde79c0e52e2443069d73ffbc59e
7
- data.tar.gz: c3d07ab4d5d89a1da63a51548b107a1593d74b928082d7de81875443b555b813d618d681532617a326eb6f633e8f46ae5f74bf65fee3ae2ef6cce57377120576
6
+ metadata.gz: 9c27fad29983e3c9fbdaa059b572b843e557b4d744f5d0fbb5c7b129a507bcdba7c7c2c6d3e3d12317eb0b6789a0a92ba093a11a859d9299815bbee385079a6f
7
+ data.tar.gz: cb893b463b1c38e20b4d18d08261345f8f774a67a946f707e66917f17642e8bc1340d4cbe4aa939e05fc5f56409b427dd31a98f26de02d73b64fefab10ff37dd
@@ -47,7 +47,7 @@ module TestSteps
47
47
  end
48
48
 
49
49
  def mem_word_check(user, b_title_sucess)
50
- if Browser.b.title.eql?('Memorable word')
50
+ if Browser.b.title.eql?('Memorable word Portal')
51
51
  portal_mem_word(user, b_title_sucess)
52
52
  elsif Browser.b.title.eql?(b_title_sucess)
53
53
  MyLog.log.info("User: #{user} has logged in successful.")
@@ -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(&:exists?).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
@@ -11,8 +11,8 @@ module TestSteps
11
11
  locate = step_attributes[:locate]
12
12
 
13
13
  found_box = [
14
- Browser.b.textarea(:"#{locate}" => box).exist?,
15
- Browser.b.text_field(:"#{locate}" => box).exist?
14
+ Browser.b.textarea("#{locate}": box).exist?,
15
+ Browser.b.text_field("#{locate}": box).exist?
16
16
  ]
17
17
 
18
18
  raise 'Multiple matches' if found_box.select { |i| i }.empty?
@@ -21,11 +21,11 @@ module TestSteps
21
21
  return unless index
22
22
 
23
23
  if index.zero?
24
- Browser.b.textarea(:"#{locate}" => box).wait_until(&:exists?)
25
- (Browser.b.textarea(:"#{locate}" => box).value == value)
24
+ Browser.b.textarea("#{locate}": box).wait_until(&:exists?)
25
+ (Browser.b.textarea("#{locate}": box).value == value)
26
26
  elsif index == 1
27
- Browser.b.text_field(:"#{locate}" => box).wait_until(&:exists?)
28
- (Browser.b.text_field(:"#{locate}" => box).value == value)
27
+ Browser.b.text_field("#{locate}": box).wait_until(&:exists?)
28
+ (Browser.b.text_field("#{locate}": box).value == value)
29
29
  end
30
30
  MyLog.log.info("Textbox: #{box} has the correct value: #{value}")
31
31
  true
@@ -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).exists?
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?
@@ -22,25 +22,25 @@ module TestSteps
22
22
 
23
23
  case index
24
24
  when 0
25
- Browser.b.button(:"#{locate}" => button).wait_until(&:exists?).click
25
+ Browser.b.button("#{locate}": button).wait_until(&:exists?).click
26
26
  when 1
27
- Browser.b.span(:"#{locate}" => button).wait_until(&:exists?).click
27
+ Browser.b.span("#{locate}": button).wait_until(&:exists?).click
28
28
  when 2
29
- Browser.b.a(:"#{locate}" => button).wait_until(&:exists?).click
29
+ Browser.b.a("#{locate}": button).wait_until(&:exists?).click
30
30
  when 3
31
- Browser.b.div(:"#{locate}" => button).wait_until(&:exists?).click
31
+ Browser.b.div("#{locate}": button).wait_until(&:exists?).click
32
32
  when 4
33
- Browser.b.link(:"#{locate}" => button).wait_until(&:exists?).click
33
+ Browser.b.link("#{locate}": button).wait_until(&:exists?).click
34
34
  when 5
35
- Browser.b.image(:"#{locate}" => button).wait_until(&:exists?).click
35
+ Browser.b.image("#{locate}": button).wait_until(&:exists?).click
36
36
  when 6
37
- Browser.b.h1(:"#{locate}" => button).wait_until(&:exists?).click
37
+ Browser.b.h1("#{locate}": button).wait_until(&:exists?).click
38
38
  when 7
39
- Browser.b.h2(:"#{locate}" => button).wait_until(&:exists?).click
39
+ Browser.b.h2("#{locate}": button).wait_until(&:exists?).click
40
40
  when 8
41
- Browser.b.h3(:"#{locate}" => button).wait_until(&:exists?).click
41
+ Browser.b.h3("#{locate}": button).wait_until(&:exists?).click
42
42
  when 9
43
- Browser.b.h4(:"#{locate}" => button).wait_until(&:exists?).click
43
+ Browser.b.h4("#{locate}": button).wait_until(&:exists?).click
44
44
  end
45
45
  MyLog.log.info("Button: #{button} has been selected")
46
46
  true
@@ -9,8 +9,8 @@ module TestSteps
9
9
  dropdown = step_attributes[:testvalue]
10
10
  locate = step_attributes[:locate]
11
11
 
12
- Browser.b.element(:"#{locate}" => dropdown).wait_until(&:exists?)
13
- Browser.b.select_list(:"#{locate}" => dropdown).options.each do |i|
12
+ Browser.b.element("#{locate}": dropdown).wait_until(&:exists?)
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
16
16
  end
@@ -11,8 +11,8 @@ module TestSteps
11
11
  locate = step_attributes[:locate]
12
12
  locate2 = step_attributes[:locate2]
13
13
 
14
- Browser.b.radio(:"#{locate}" => radio).wait_until(&:exists?)
15
- Browser.b.radio(:"#{locate}" => radio, :"#{locate2}" => value2.to_s).set
14
+ Browser.b.radio("#{locate}": radio).wait_until(&:exists?)
15
+ Browser.b.radio("#{locate}": radio, "#{locate2}": value2.to_s).set
16
16
  MyLog.log.info("Radio button: #{radio} has been selected")
17
17
  true
18
18
  rescue StandardError
@@ -11,8 +11,8 @@ 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(&:exists?)
15
- Browser.b.select_list(:"#{locate}" => dropdown).option(:"#{locate2}" => value2.to_s).select
14
+ Browser.b.select_list("#{locate}": dropdown).wait_until(&:exists?)
15
+ Browser.b.select_list("#{locate}": dropdown).option("#{locate2}": value2.to_s).select
16
16
  MyLog.log.info("Dropdown item: #{value2} has been selected")
17
17
  true
18
18
  rescue StandardError
@@ -16,9 +16,9 @@ module TestSteps
16
16
 
17
17
  def self.input_value(box, text, locate)
18
18
  found_box = [
19
- Browser.b.textarea(:"#{locate}" => box).exist?,
20
- Browser.b.text_field(:"#{locate}" => box).exist?,
21
- Browser.b.iframe(:"#{locate}" => box).exist?
19
+ Browser.b.textarea("#{locate}": box).exist?,
20
+ Browser.b.text_field("#{locate}": box).exist?,
21
+ Browser.b.iframe("#{locate}": box).exist?
22
22
  ]
23
23
 
24
24
  raise 'Multiple matches' if found_box.select { |i| i }.empty?
@@ -27,13 +27,13 @@ module TestSteps
27
27
  return unless index
28
28
 
29
29
  if index.zero?
30
- Browser.b.textarea(:"#{locate}" => box).wait_until(&:exists?).set text
31
- (Browser.b.textarea(:"#{locate}" => box).text == text)
30
+ Browser.b.textarea("#{locate}": box).wait_until(&:exists?).set text
31
+ (Browser.b.textarea("#{locate}": box).text == text)
32
32
  elsif index == 1
33
- Browser.b.text_field(:"#{locate}" => box).wait_until(&:exists?).set text
34
- (Browser.b.text_field(:"#{locate}" => box).text == text)
33
+ Browser.b.text_field("#{locate}": box).wait_until(&:exists?).set text
34
+ (Browser.b.text_field("#{locate}": box).text == text)
35
35
  elsif index == 2
36
- Browser.b.iframe(:"#{locate}" => box).wait_until(&:exists?).send_keys text
36
+ Browser.b.iframe("#{locate}": box).wait_until(&:exists?).send_keys text
37
37
  end
38
38
  MyLog.log.info("Textbox: #{box} has correct value: #{text}")
39
39
  true
@@ -36,7 +36,7 @@ module JsonParser
36
36
 
37
37
  parsed_step
38
38
  # if an error reading the test step data then re-raise the exception
39
- rescue StandardError => error
40
- raise error
39
+ rescue StandardError => e
40
+ raise e
41
41
  end
42
42
  end
data/lib/parser/parser.rb CHANGED
@@ -37,8 +37,8 @@ module Parser
37
37
 
38
38
  # if an error occurred reading the test file list then
39
39
  # re-raise the exception.
40
- rescue StandardError => error
41
- raise IOError, error
40
+ rescue StandardError => e
41
+ raise IOError, e
42
42
  end
43
43
 
44
44
  # parseTestStepData
data/lib/report/report.rb CHANGED
@@ -102,12 +102,12 @@ module Report
102
102
  return if @consecutive_test_fail < consecutive_fail_threshold
103
103
 
104
104
  # write info to stdout
105
- MyLog.log.warn "Terminating the current test case: #{test_file_name} as" \
106
- " the test failure threshold (#{consecutive_fail_threshold}) has been " \
105
+ MyLog.log.warn "Terminating the current test file: #{test_file_name} as" \
106
+ " the test failure threshold (#{$testStepFailures}) has been" \
107
107
  ' reached.'
108
- MyLog.log.warn '...continuing with the next test spec (if there is one)'
108
+ MyLog.log.warn '...continuing with the next test file (if there is one)'
109
109
 
110
110
  raise FailureThresholdExceeded,
111
- "#{consecutive_fail_threshold} Test Steps Failed."
111
+ "#{$testStepFailures} Test Steps Failed."
112
112
  end
113
113
  end
@@ -27,8 +27,8 @@ module ReportSummary
27
27
  def self.print_overall_test_summary
28
28
  # output to the console
29
29
 
30
- MyLog.log.info 'Finished processing all test files -' \
31
- "executed via test suite: #{$testcasesFolder}"
30
+ MyLog.log.info 'Finished processing all test files ' \
31
+ "from the following test folder: #{$testcasesFolder}"
32
32
  MyLog.log.info "Overall Test Summary: \n"
33
33
  @test_step_report_summary.each do |test_step_report_summary|
34
34
  test_step_report_summary.each_line do |line|
data/lib/utils/browser.rb CHANGED
@@ -27,11 +27,11 @@ module Browser
27
27
  MyLog.log.error "unable to open selected browser: #{lc_browser_type}"
28
28
  raise BrowserFailedOpen
29
29
  end
30
- rescue BrowserFailedOpen => error
30
+ rescue BrowserFailedOpen => e
31
31
  # construct the error message from custom text and the actual system error
32
32
  # message (converted to a string)
33
33
  error_text = 'Unable to open'\
34
- "the requested browser: #{lc_browser_type} " + error.to_s
34
+ "the requested browser: #{lc_browser_type} " + e.to_s
35
35
  raise error_text
36
36
  end
37
37
 
@@ -47,11 +47,11 @@ module CreateDirectories
47
47
  # abs_path_run_no_dir = File.absolute_path(runNoDir)
48
48
  FileUtils.mkdir_p(abs_path_screenshot_dir)
49
49
  # if any issues then set error message and re-raise the exception
50
- rescue StandardError => error
50
+ rescue StandardError => e
51
51
  # construct the error message from custom text and the actual system error
52
52
  # message (converted to a string)
53
53
  error_to_display = 'Error creating the test directory structure or' \
54
- ' opening the test results file : ' + error.to_s
54
+ ' opening the test results file : ' + e.to_s
55
55
  raise error_to_display
56
56
  else
57
57
  # if no exception then return the screenshot file directory path
@@ -32,9 +32,9 @@ module Screenshot
32
32
  end
33
33
 
34
34
  # if any issues with saving the screenshot then log a warning
35
- rescue StandardError => error
35
+ rescue StandardError => e
36
36
  # construct the error message from custom text and the actual system
37
37
  # error message (converted to a string).
38
- MyLog.log.warn("Error saving the screenshot: #{sc_file_name} #{error}")
38
+ MyLog.log.warn("Error saving the screenshot: #{sc_file_name} #{e}")
39
39
  end
40
40
  end
@@ -22,10 +22,10 @@ module TestEngine
22
22
  tests = Parser.read_test_data(test_file_name)
23
23
  # if unable to read the test data, show the error and move onto the
24
24
  # next file (if there is one)
25
- rescue StandardError => error
26
- MyLog.log.warn 'Terminating the current test case: ' \
27
- "#{test_file_name} #{error}"
28
- MyLog.log.info '...continuing with the next test case (if there is one)'
25
+ rescue StandardError => e
26
+ MyLog.log.warn 'Terminating the current test spec: ' \
27
+ "#{test_file_name} #{e}"
28
+ MyLog.log.info '...continuing with the next test file (if there is one)'
29
29
  end
30
30
 
31
31
  # create project folders - these only need creating once per test suite
@@ -46,9 +46,9 @@ module TestEngine
46
46
  Screenshot.save_screenshot(parsed_steps[:screenShotData],
47
47
  parsed_steps)
48
48
  end
49
- rescue TafError => error
50
- warn error
51
- MyLog.log.warn error
49
+ rescue TafError => e
50
+ warn e
51
+ MyLog.log.warn e
52
52
  end
53
53
 
54
54
  # get the test case end time
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.2.9'
6
+ STRING = '0.3.0'
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,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: taf
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.9
4
+ version: 0.3.0
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-05-07 00:00:00.000000000 Z
11
+ date: 2019-05-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler