htmlcuke 2.0.1 → 2.0.2

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
  SHA1:
3
- metadata.gz: e080c19ba7db3b59d4b08df837b875ec0a6fd88d
4
- data.tar.gz: ed76f5027ddb5194623983141060be77786a4b60
3
+ metadata.gz: cc7424a52e612935d387baf757a96c92cfafce34
4
+ data.tar.gz: 9012fdc0d7e9e5d8fdb906a7754dd047f2218a41
5
5
  SHA512:
6
- metadata.gz: 46a1e1689b09a59c44cffa5a0d68370f34b93b5537f3aeedc132b774abe870ddbadfd38326b647c876601768bac8ea42d6a236d7af8352258f2f870cebfee4df
7
- data.tar.gz: 18710189864541d3bd57ca894ff2c74e82f5d8c7b8f56017accbefe7d4cd0db70f9088f268a1620cc662475cfdc65f0e8f9092ee82dd9109426436f25be4546c
6
+ metadata.gz: 5240baca3b5246806b96d0c547f971333c83ca76e3db292e3e248c8ba74fcda4467782aac14306adc200144431526e2223df301cfb050892aa25066b9aa9b68a
7
+ data.tar.gz: 4c284a3f49c8dde2761454262f2a2a7af18a8aa56c8ebc9acac58229efb46e5ccdb3ba3c9916eabb73570a00b4e768986a0728ab418b503ef6b73bb005eaf1d5
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # Htmlcuke
1
+ # Htmlcuke [![htmlcuke API Documentation](https://www.omniref.com/ruby/gems/htmlcuke.png)](https://www.omniref.com/ruby/gems/htmlcuke)
2
2
 
3
3
  A custom Html formatter for Cucumber that provides specific functionality.
4
4
  This formatter removes (if necessary) any color codes wrapped around puts statements within a suite that is using the ```colorized``` or similar gem.
@@ -24,7 +24,7 @@ This usage case assumes you have the directories ```reports``` and ```reports/sc
24
24
 
25
25
  Add this line to your cucumber.yml, Rakefile, or command line arguments:
26
26
  ```
27
- --format Htmlcuke::Formatter --out reports/cucumber_$(date '+%Y.%m.%d-%H.%M.%S').html
27
+ --format Htmlcuke::Formatter --out reports/cucumber_$(date '+%m-%d-%Y_%H.%M.%S').html
28
28
  ```
29
29
 
30
30
  The --out assumes you will output the .html files to the reports directory under the naming convention cucumber + timestamp, feel free to change this as you see fit.
@@ -38,14 +38,29 @@ After do |scenario|
38
38
  if scenario.failed?
39
39
  if scenario.respond_to?('scenario_outline')
40
40
  screenshot_format = "./reports/screens/FAILED_#{(scenario.scenario_outline.title + ' ' + scenario.name).gsub(' ','_').gsub(/[^0-9A-Za-z_]/, '')}.png"
41
+ screenshot_embed = "./screens/FAILED_#{(scenario.scenario_outline.title + ' ' + scenario.name).gsub(' ','_').gsub(/[^0-9A-Za-z_]/, '')}.png"
41
42
  else
42
43
  screenshot_format = "./reports/screens/FAILED_#{scenario.name.gsub(' ','_').gsub(/[^0-9A-Za-z_]/, '')}.png"
44
+ screenshot_embed = "./screens/FAILED_#{(scenario.scenario_outline.title + ' ' + scenario.name).gsub(' ','_').gsub(/[^0-9A-Za-z_]/, '')}.png"
45
+
43
46
  end
44
- embed(File.expand_path(screenshot_format), 'image/png', 'Failed Screenshot')
47
+ embed(screenshot_embed, 'image/png', 'Failed Screenshot')
45
48
  end
46
49
  end
47
50
  ```
48
51
 
52
+ ## Rake Task
53
+
54
+ Here is a sample rake task that can be used in conjunction with a tool like Jenkins - just make sure to archive the directories for the
55
+ output of your reports and screens in the job configuration.
56
+
57
+ ```ruby
58
+ Cucumber::Rake::Task.new :mobile_ios_smoke_test, 'Run Cucumber smoke tests on mobile ios emulator' do |t|
59
+ t.profile = 'automation-wip --tags ~@wip --tags ~@feature --tags @mocked'
60
+ t.cucumber_opts = ['DEVICE=sim_ios', 'features/smoke', '--format Htmlcuke::Formatter', "--out reports/cucumber_$(date '+%m-%d-%Y_%H.%M.%S').html", '--format pretty', '--guess']
61
+ end
62
+ ```
63
+
49
64
  ## Contributing
50
65
 
51
66
  1. Fork it ( https://github.com/[my-github-username]/htmlcuke/fork )
@@ -16,6 +16,10 @@ require 'cucumber/formatter/html'
16
16
  end
17
17
 
18
18
  def embed_image(src, label)
19
+ modified_src = src
20
+ modified_src = modified_src.split(',')
21
+ modified_src = modified_src.drop(1) unless modified_src.size != 2
22
+ modified_src = modified_src[0]
19
23
  id = "img_#{@img_id}"
20
24
  @img_id += 1
21
25
  @builder.span(:class => 'embed') do |pre|
@@ -1,3 +1,3 @@
1
1
  module Htmlcuke
2
- VERSION = "2.0.1"
2
+ VERSION = "2.0.2"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: htmlcuke
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.1
4
+ version: 2.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nathan Ray
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-10-28 00:00:00.000000000 Z
11
+ date: 2014-10-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: cucumber