taf 0.1.6 → 0.1.7

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: f86ace5ef3a38a6e2dd38706ebe56e20afb50bdf5ec78d6db1f2bd63271340f9
4
- data.tar.gz: 0e448aaa2850b5209d132fb8e94e0bec7f3fb39716395494d064ed4069c64c17
3
+ metadata.gz: 46bc41e2b99ad92e8f411e96bce70773f449f3f774e3a757e93b307e8f9563ac
4
+ data.tar.gz: 24c407eb8d80359e2013f4997ef6863d4cd765d95b9f53bd34e0c6ff4041a490
5
5
  SHA512:
6
- metadata.gz: e08b8accbbf33503870b9478f2175c88f7d12c4f764b481f2520a4853c509c757d2f95a8c9be2ab92e8faff8abe267efb0796950005a2800b3427e955d219686
7
- data.tar.gz: 5e58ff283dff6a4c88409b550b5fb68f7a857d8c66595cafbacfcde673af4ee939e8cb4db0a91cce2f4abfb6eba2a351b50c82d9fddd7276fc8b4b2729fac11c
6
+ metadata.gz: b73f36e5ce2b13affc61043aa516ada0f5bac51e8ebd21770b9c863c3a7e46cbb5eb358d3bc1441ced4f3424d9e9ecbe82440a3537353eaa082ecb74748b496c
7
+ data.tar.gz: 222ab1335896ae7c68dea8462c20e8e0adecd8fe1c4ee7de9c5662b722b1093f4cf6bd82f71e54d93b0ef9a3eb2a8ac8dbd887cee41a2ffbd6749cca90f53bec
@@ -65,5 +65,8 @@ module Main
65
65
  # output the overall test summary
66
66
  ReportSummary.print_overall_test_summary
67
67
  JunitReport.test_summary_junit
68
+
69
+ # Exit status code.
70
+ Process.exit($totalTestFailures.zero? ? 0 : 1 )
68
71
  end
69
72
  end
@@ -13,18 +13,17 @@ module ReportSummary
13
13
  @testStepReportSummary = []
14
14
  # output the test results summary for the current test case
15
15
  def self.test_step_summary(test_file_name, test_file_name_index)
16
- # construct the test step report summary
17
- @testStepReportSummary[test_file_name_index] = 'Test file:', test_file_name,\
18
- "\n" 'Browser type:', $browserType, \
19
- "\n" 'Browser version:', Browser.browser_version.to_s, \
20
- "\n" 'Environment:', $env_type, \
21
- "\n" 'Started at:', $test_case_start_time, \
22
- "\n" 'Finished at:', $test_case_end_time, \
23
- "\n" 'There are:', $testStepPasses, 'Passes' \
24
- "\n" 'There are:', $testStepFailures, 'Failures' \
25
- "\n" 'There are:', $testStepNotrun, 'Skipped Tests' "\n"
26
- # ... and save in a format that is printable
27
- @testStepReportSummary[test_file_name_index] = @testStepReportSummary[test_file_name_index].join(' ')
16
+ @testStepReportSummary[test_file_name_index] = <<~TEXT
17
+ Test file: #{test_file_name}
18
+ Browser type: #{$browserType}
19
+ Browser version: #{Browser.browser_version}
20
+ Environment: #{$env_type}
21
+ Started at: #{$test_case_start_time}
22
+ Finished at: #{$test_case_end_time}
23
+ There are: #{$testStepPasses} Passes
24
+ There are: #{$testStepFailures} Failures
25
+ There are: #{$testStepNotrun} Skipped Tests \n
26
+ TEXT
28
27
  end
29
28
 
30
29
  # output the overall test results summary
@@ -34,7 +33,9 @@ module ReportSummary
34
33
  MyLog.log.info "Finished processing all test files - executed via test suite: #{$testSuiteFile} by tester: #{$tester}"
35
34
  MyLog.log.info "Overall Test Summary:"
36
35
  @testStepReportSummary.each do |testStepReportSummary|
37
- MyLog.log.info testStepReportSummary
36
+ testStepReportSummary.each_line do |line|
37
+ MyLog.log.info(line.strip)
38
+ end
38
39
  end
39
40
 
40
41
  MyLog.log.info "Total Tests started at: #{$test_start_time}"
@@ -45,31 +46,5 @@ module ReportSummary
45
46
  MyLog.log.info "Total Tests Skipped: #{$totalTestNotrun}".blue
46
47
  $totalTests = [$totalTestPasses, $totalTestFailures, $totalTestNotrun].sum
47
48
  MyLog.log.info "Total Tests: #{$totalTests}\n"
48
-
49
- # output to the suite summary file
50
-
51
- # open the suite summary file for writing if not already open
52
- if !File.exist?($testSuiteSummaryFileName) || $testSuiteSummaryFileName.closed?
53
- testSuiteSummaryFile = File.open($testSuiteSummaryFileName, 'w')
54
- MyLog.log.info"Test Suite Summary file located at:"
55
- MyLog.log.info "#{$testSuiteSummaryFileName}\n"
56
- elsif MyLog.log.warn "test suite summary file name: #{$testSuiteSummarylFileName} is already open"
57
- end
58
-
59
- testSuiteSummaryFile.puts "Finished processing all test files - executed via test suite: #{$testSuiteFile} by tester: #{$tester} \n"
60
- testSuiteSummaryFile.puts "\nOverall Test Summary:"
61
- @testStepReportSummary.each do |testStepReportSummary|
62
- testSuiteSummaryFile.puts testStepReportSummary
63
- end
64
- testSuiteSummaryFile.puts("\nTotal Tests started at: #{$test_start_time}")
65
- testSuiteSummaryFile.puts("Total Tests finished at: #{$test_end_time}")
66
- testSuiteSummaryFile.puts('Total Tests duration: ' + TimeDifference.between($test_end_time, $test_start_time).humanize)
67
- testSuiteSummaryFile.puts("Total Tests Passed: #{$totalTestPasses}")
68
- testSuiteSummaryFile.puts("Total Tests Failed: #{$totalTestFailures}")
69
- testSuiteSummaryFile.puts("Total Tests Skipped: #{$totalTestNotrun}")
70
- testSuiteSummaryFile.puts("Total Tests: #{$totalTests} \n")
71
-
72
- # if the file is open then close it
73
- testSuiteSummaryFile.close unless testSuiteSummaryFile.closed?
74
49
  end
75
50
  end
@@ -51,13 +51,10 @@ module CreateDirectories
51
51
  screenshot_dir = testid_dir + '/' + 'Screenshots' + '/'
52
52
  Dir.mkdir(screenshot_dir)
53
53
 
54
- # create absolute paths to the screenshots, test results and test suite summary directories
54
+ # create absolute paths to the screenshots and test suite summary directories
55
55
  abs_path_screenshot_dir = File.absolute_path(screenshot_dir)
56
56
  abs_path_run_no_dir = File.absolute_path($runNoDir)
57
57
 
58
- # the test suite summary file name will be 'suite_summary.txt'
59
- $testSuiteSummaryFileName = abs_path_run_no_dir + '/suite_summary.txt'
60
-
61
58
  # the test suite summary is a XML report generated will be called 'suite_summary.xml'
62
59
  time = Time.new
63
60
  f_date = time.strftime('%d-%b-%Y')
@@ -18,4 +18,4 @@ module MyLog
18
18
  end
19
19
  @logger
20
20
  end
21
- end
21
+ end
@@ -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.6'.freeze
6
+ STRING = '0.1.7'.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.6
4
+ version: 0.1.7
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-04 00:00:00.000000000 Z
11
+ date: 2019-02-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler