cucumberhtml 0.1.3 → 0.1.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c938beb36ef059aa255e098f578514b5146725cfec48d122aaabe1ab999041c5
4
- data.tar.gz: 6f5a1a6424c4f0184ddce685c9abab5b887565fb5585558eea7ce65f7f30e5e7
3
+ metadata.gz: 8bb02f96c665f121706b41100bad8a7dca2433e39e581814437df3aa49184edf
4
+ data.tar.gz: d62793ed6a27e10b15e6bb625beeb369f110c07aebf4ba744feb24748c93f1cb
5
5
  SHA512:
6
- metadata.gz: 5a70cd2ec4755e015f75909de140f0efe4f01b1111311d37c86379f5ccab26795931017f6170798aea05f08286686454028c842122b79d87e321b2fa6f8319b3
7
- data.tar.gz: 047b15f68ca736f4a41a07d713f5db8a3c59a1dc5706b76e3eafaa7ee4c96ccdd31ae2c8e473faef706556eb60283ffc86fb28341b2a24e87d5c8832476a9a7c
6
+ metadata.gz: 5175b0af847c61b865e417c3e2d61aac4ce92f2451f39280b2bca63d6eef678b9b7aee36e4178260352b0504b3ef6c937789d18a259f71abd1dec5659a521b3b
7
+ data.tar.gz: 2aafd8efa64eaabf579ad45cecdb3e2965df1fc710ebceda778c8c1b3b62ec10a9e6ba38e34ec5288b85cf263b687163241d49b1e7151ca5c30128cc2606213e
@@ -44,8 +44,10 @@ module CucumberToHtml::Cell
44
44
  Scenario.call(element).call
45
45
  when 'Background'
46
46
  Element.call(element).call if element == element_list[0]
47
+ when 'Scenario Outline'
48
+ ScenarioOutline.call(element).call
47
49
  else
48
- raise 'Unknown element'
50
+ raise "Unknown element: #{element['keyword']}"
49
51
  end
50
52
  end
51
53
  end
@@ -0,0 +1,31 @@
1
+ # frozen_string_literal: true
2
+
3
+ module CucumberToHtml::Cell
4
+ class ScenarioOutline < Element
5
+ def success?
6
+ model['steps'].all? do |step|
7
+ step.dig('result', 'status') == 'passed'
8
+ end
9
+ end
10
+
11
+ def failure?
12
+ false # TBD
13
+ end
14
+
15
+ def border_classes
16
+ if success?
17
+ 'border-success'
18
+ elsif failure?
19
+ 'border-danger'
20
+ end
21
+ end
22
+
23
+ def body_classes
24
+ if success?
25
+ 'text-success'
26
+ elsif failure?
27
+ 'text-danger'
28
+ end
29
+ end
30
+ end
31
+ end
@@ -0,0 +1,7 @@
1
+ .card.mb-3 class=border_classes
2
+ .card-body
3
+ /h5.card-title = "Scenario: #{name}"
4
+ h5.card-title = name
5
+ p.card-text
6
+ - steps.each do |step|
7
+ = step(step)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Cucumberhtml
4
- VERSION = '0.1.3'
4
+ VERSION = '0.1.4'
5
5
  end
@@ -16,7 +16,7 @@ namespace :cucumberhtml do
16
16
  file = File.read(filename)
17
17
  json = JSON.parse(file)
18
18
  html = CucumberToHtml::Cell::Gherkin.call(json)
19
- open(outfile, 'w') do |f|
19
+ File.open(outfile, 'w') do |f|
20
20
  f << html
21
21
  end
22
22
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cucumberhtml
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Erik Axel Nielsen
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-01-22 00:00:00.000000000 Z
11
+ date: 2018-04-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rubocop
@@ -80,12 +80,14 @@ files:
80
80
  - app/concepts/cucumber_to_html/cell/feature.rb
81
81
  - app/concepts/cucumber_to_html/cell/gherkin.rb
82
82
  - app/concepts/cucumber_to_html/cell/scenario.rb
83
+ - app/concepts/cucumber_to_html/cell/scenario_outline.rb
83
84
  - app/concepts/cucumber_to_html/cell/step.rb
84
85
  - app/concepts/cucumber_to_html/view/element.slim
85
86
  - app/concepts/cucumber_to_html/view/feature.slim
86
87
  - app/concepts/cucumber_to_html/view/feature_menu_item.slim
87
88
  - app/concepts/cucumber_to_html/view/gherkin.slim
88
89
  - app/concepts/cucumber_to_html/view/scenario.slim
90
+ - app/concepts/cucumber_to_html/view/scenario_outline.slim
89
91
  - app/concepts/cucumber_to_html/view/step.slim
90
92
  - app/controllers/cucumberhtml/application_controller.rb
91
93
  - app/controllers/cucumberhtml/cucumber_to_html_controller.rb
@@ -116,7 +118,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
116
118
  version: '0'
117
119
  requirements: []
118
120
  rubyforge_project:
119
- rubygems_version: 2.7.3
121
+ rubygems_version: 2.7.6
120
122
  signing_key:
121
123
  specification_version: 4
122
124
  summary: Cucumber to HTML converter.