taf 0.4.0 → 0.4.1
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 +4 -4
 - data/lib/taf/report.rb +34 -26
 - data/lib/taf/version.rb +1 -1
 - metadata +2 -2
 
    
        checksums.yaml
    CHANGED
    
    | 
         @@ -1,7 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            ---
         
     | 
| 
       2 
2 
     | 
    
         
             
            SHA256:
         
     | 
| 
       3 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       4 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 3 
     | 
    
         
            +
              metadata.gz: 2367c31920261be5fd4ab3b50e3266c972f6f4eeb6f22a99e704a64904639ae3
         
     | 
| 
      
 4 
     | 
    
         
            +
              data.tar.gz: dccbc5fc244b455a3d2173dbde7c2814571d090d7fc8447fa34759bb1f2c80f8
         
     | 
| 
       5 
5 
     | 
    
         
             
            SHA512:
         
     | 
| 
       6 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       7 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 6 
     | 
    
         
            +
              metadata.gz: f0d440c2349b3543910236233e321a651677fcce1e96dfb300e86ae6f6cadd81865aedd0aa705ab0e3e0b4b046b74703f9cab91e4611bb3fa24bc17421f3c238
         
     | 
| 
      
 7 
     | 
    
         
            +
              data.tar.gz: d90267152e10e951260c2181b30b38209ab22bfdada3b4afe63d52b26207f8fabe08e5347a88cd179ce2f7f6d0f24a4dacba36444570da3f240ced03ae3d4541
         
     | 
    
        data/lib/taf/report.rb
    CHANGED
    
    | 
         @@ -18,47 +18,55 @@ module Taf 
     | 
|
| 
       18 
18 
     | 
    
         | 
| 
       19 
19 
     | 
    
         
             
                # print the test Step info to the test results file
         
     | 
| 
       20 
20 
     | 
    
         
             
                def self.print_test_step_header(test_step_idx, test_desc)
         
     | 
| 
       21 
     | 
    
         
            -
                  @ 
     | 
| 
      
 21 
     | 
    
         
            +
                  @start_time = current_time
         
     | 
| 
       22 
22 
     | 
    
         
             
                  Taf::MyLog.log.info "Test step: #{test_step_idx} : #{test_desc}"
         
     | 
| 
       23 
23 
     | 
    
         
             
                end
         
     | 
| 
       24 
24 
     | 
    
         | 
| 
      
 25 
     | 
    
         
            +
                def self.pass_func(test_file_name, test_step_idx, test_desc, metrics)
         
     | 
| 
      
 26 
     | 
    
         
            +
                  Taf::MyLog.log.info "Test #{test_step_idx} has Passed ".green
         
     | 
| 
      
 27 
     | 
    
         
            +
                  @current_test_fail = false
         
     | 
| 
      
 28 
     | 
    
         
            +
                  metrics.stepPasses += 1
         
     | 
| 
      
 29 
     | 
    
         
            +
                  Taf::TapReport.success(test_file_name, test_step_idx, test_desc)
         
     | 
| 
      
 30 
     | 
    
         
            +
                end
         
     | 
| 
      
 31 
     | 
    
         
            +
             
     | 
| 
      
 32 
     | 
    
         
            +
                def self.fail_func(test_file_name, test_step_idx, test_desc, metrics)
         
     | 
| 
      
 33 
     | 
    
         
            +
                  Taf::MyLog.log.warn "Test #{test_step_idx} has FAILED ".red
         
     | 
| 
      
 34 
     | 
    
         
            +
                  Taf::Screenshot.save_screenshot(test_step_idx)
         
     | 
| 
      
 35 
     | 
    
         
            +
                  @current_test_fail = true
         
     | 
| 
      
 36 
     | 
    
         
            +
                  metrics.stepFailures += 1
         
     | 
| 
      
 37 
     | 
    
         
            +
                  Taf::TapReport.failure(
         
     | 
| 
      
 38 
     | 
    
         
            +
                    test_file_name, test_step_idx, test_desc
         
     | 
| 
      
 39 
     | 
    
         
            +
                  )
         
     | 
| 
      
 40 
     | 
    
         
            +
                end
         
     | 
| 
      
 41 
     | 
    
         
            +
             
     | 
| 
      
 42 
     | 
    
         
            +
                def self.skip_func(test_file_name, test_step_idx, test_desc, metrics)
         
     | 
| 
      
 43 
     | 
    
         
            +
                  Taf::MyLog.log.info "Test #{test_step_idx} no checks performed ".blue
         
     | 
| 
      
 44 
     | 
    
         
            +
                  @current_test_fail = false
         
     | 
| 
      
 45 
     | 
    
         
            +
                  metrics.stepSkipped += 1
         
     | 
| 
      
 46 
     | 
    
         
            +
                  Taf::TapReport.skip(
         
     | 
| 
      
 47 
     | 
    
         
            +
                    test_file_name, test_step_idx, test_desc
         
     | 
| 
      
 48 
     | 
    
         
            +
                  )
         
     | 
| 
      
 49 
     | 
    
         
            +
                end
         
     | 
| 
      
 50 
     | 
    
         
            +
             
     | 
| 
       25 
51 
     | 
    
         
             
                # print the Pass / Fail status of a test to the test results file
         
     | 
| 
       26 
52 
     | 
    
         
             
                def self.test_pass_fail(
         
     | 
| 
       27 
53 
     | 
    
         
             
                  pass_fail,
         
     | 
| 
       28 
54 
     | 
    
         
             
                  test_file_name,
         
     | 
| 
       29 
55 
     | 
    
         
             
                  test_step_idx,
         
     | 
| 
       30 
     | 
    
         
            -
                   
     | 
| 
      
 56 
     | 
    
         
            +
                  test_desc,
         
     | 
| 
       31 
57 
     | 
    
         
             
                  metrics
         
     | 
| 
       32 
58 
     | 
    
         
             
                )
         
     | 
| 
       33 
59 
     | 
    
         
             
                  if pass_fail
         
     | 
| 
       34 
     | 
    
         
            -
                     
     | 
| 
       35 
     | 
    
         
            -
                    @current_test_fail = false
         
     | 
| 
       36 
     | 
    
         
            -
                    metrics.stepPasses += 1
         
     | 
| 
       37 
     | 
    
         
            -
                    Taf::TapReport.success(
         
     | 
| 
       38 
     | 
    
         
            -
                      test_file_name, test_step_idx, test_step_description
         
     | 
| 
       39 
     | 
    
         
            -
                    )
         
     | 
| 
      
 60 
     | 
    
         
            +
                    pass_func(test_file_name, test_step_idx, test_desc, metrics)
         
     | 
| 
       40 
61 
     | 
    
         
             
                  elsif pass_fail == false
         
     | 
| 
       41 
     | 
    
         
            -
                     
     | 
| 
       42 
     | 
    
         
            -
                    Taf::Screenshot.save_screenshot(test_step_idx)
         
     | 
| 
       43 
     | 
    
         
            -
                    @current_test_fail = true
         
     | 
| 
       44 
     | 
    
         
            -
                    metrics.stepFailures += 1
         
     | 
| 
       45 
     | 
    
         
            -
                    Taf::TapReport.failure(
         
     | 
| 
       46 
     | 
    
         
            -
                      test_file_name, test_step_idx, test_step_description
         
     | 
| 
       47 
     | 
    
         
            -
                    )
         
     | 
| 
      
 62 
     | 
    
         
            +
                    fail_func(test_file_name, test_step_idx, test_desc, metrics)
         
     | 
| 
       48 
63 
     | 
    
         
             
                  else
         
     | 
| 
       49 
     | 
    
         
            -
                     
     | 
| 
       50 
     | 
    
         
            -
                    @current_test_fail = false
         
     | 
| 
       51 
     | 
    
         
            -
                    metrics.stepSkipped += 1
         
     | 
| 
       52 
     | 
    
         
            -
                    Taf::TapReport.skip(
         
     | 
| 
       53 
     | 
    
         
            -
                      test_file_name, test_step_idx, test_step_description
         
     | 
| 
       54 
     | 
    
         
            -
                    )
         
     | 
| 
      
 64 
     | 
    
         
            +
                    skip_func(test_file_name, test_step_idx, test_desc, metrics)
         
     | 
| 
       55 
65 
     | 
    
         
             
                  end
         
     | 
| 
       56 
66 
     | 
    
         | 
| 
       57 
     | 
    
         
            -
                   
     | 
| 
       58 
     | 
    
         
            -
                   
     | 
| 
       59 
     | 
    
         
            -
             
     | 
| 
       60 
     | 
    
         
            -
                  ).humanize || 0
         
     | 
| 
       61 
     | 
    
         
            -
                  Taf::MyLog.log.info "Test step duration: #{test_duration} \n"
         
     | 
| 
      
 67 
     | 
    
         
            +
                  end_time = current_time
         
     | 
| 
      
 68 
     | 
    
         
            +
                  duration = TimeDifference.between(end_time, @start_time).humanize || 0
         
     | 
| 
      
 69 
     | 
    
         
            +
                  Taf::MyLog.log.info "Test step duration: #{duration} \n"
         
     | 
| 
       62 
70 
     | 
    
         
             
                end
         
     | 
| 
       63 
71 
     | 
    
         | 
| 
       64 
72 
     | 
    
         
             
                # check if the test failure threshold has been reached for total failures
         
     | 
    
        data/lib/taf/version.rb
    CHANGED
    
    
    
        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.4. 
     | 
| 
      
 4 
     | 
    
         
            +
              version: 0.4.1
         
     | 
| 
       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-06- 
     | 
| 
      
 11 
     | 
    
         
            +
            date: 2019-06-16 00:00:00.000000000 Z
         
     | 
| 
       12 
12 
     | 
    
         
             
            dependencies:
         
     | 
| 
       13 
13 
     | 
    
         
             
            - !ruby/object:Gem::Dependency
         
     | 
| 
       14 
14 
     | 
    
         
             
              name: bundler
         
     |