ugly_face 0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +18 -0
- data/ChangeLog +2 -0
- data/Gemfile +13 -0
- data/Guardfile +19 -0
- data/LICENSE +21 -0
- data/README.md +25 -0
- data/Rakefile +19 -0
- data/autotrader.png +0 -0
- data/cucumber.yml +4 -0
- data/features/feature_pages.feature +110 -0
- data/features/pretty_face_report.feature +81 -0
- data/features/step_definitions/report_steps.rb +36 -0
- data/features/support/_feature_header.erb +2 -0
- data/features/support/_suite_header.erb +2 -0
- data/features/support/env.rb +20 -0
- data/features/support/error_display.rb +16 -0
- data/features/support/hooks.rb +11 -0
- data/features/support/logo.png +0 -0
- data/fixtures/advanced.feature +57 -0
- data/fixtures/background.feature +10 -0
- data/fixtures/basic.feature +20 -0
- data/fixtures/failing_background.feature +7 -0
- data/fixtures/more/more.feature +8 -0
- data/fixtures/onemore/deep/more.feature +8 -0
- data/fixtures/onemore/more.feature +8 -0
- data/fixtures/step_definitions/advanced_steps.rb +34 -0
- data/fixtures/step_definitions/basic_steps.rb +25 -0
- data/fixtures/support/env.rb +3 -0
- data/lib/.DS_Store +0 -0
- data/lib/ugly_face/.DS_Store +0 -0
- data/lib/ugly_face/formatter/html.rb +289 -0
- data/lib/ugly_face/formatter/report.rb +285 -0
- data/lib/ugly_face/formatter/view_helper.rb +61 -0
- data/lib/ugly_face/templates/_main_header.erb +1 -0
- data/lib/ugly_face/templates/_page_header.erb +2 -0
- data/lib/ugly_face/templates/_step.erb +39 -0
- data/lib/ugly_face/templates/debug.png +0 -0
- data/lib/ugly_face/templates/failed.png +0 -0
- data/lib/ugly_face/templates/feature.erb +143 -0
- data/lib/ugly_face/templates/logo.png +0 -0
- data/lib/ugly_face/templates/main.erb +162 -0
- data/lib/ugly_face/templates/passed.png +0 -0
- data/lib/ugly_face/templates/pending.png +0 -0
- data/lib/ugly_face/templates/screenshot.png +0 -0
- data/lib/ugly_face/templates/skipped.png +0 -0
- data/lib/ugly_face/templates/style.css +346 -0
- data/lib/ugly_face/templates/table_failed.png +0 -0
- data/lib/ugly_face/templates/table_passed.png +0 -0
- data/lib/ugly_face/templates/table_pending.png +0 -0
- data/lib/ugly_face/templates/table_skipped.png +0 -0
- data/lib/ugly_face/templates/table_undefined.png +0 -0
- data/lib/ugly_face/templates/undefined.png +0 -0
- data/lib/ugly_face/version.rb +3 -0
- data/lib/ugly_face.rb +45 -0
- data/spec/lib/customization_spec.rb +23 -0
- data/spec/lib/html_formatter_spec.rb +140 -0
- data/spec/spec_helper.rb +5 -0
- data/ugly_face.gemspec +29 -0
- metadata +199 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 5f8cf74da2e0daddffd8fdb0ee03a71b8357b974
|
4
|
+
data.tar.gz: 54ce14b5b3c72814ac4b295865c19213b855a723
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: d34d0ea7a0ba0978d70f4d2dd1fc54f5da2325977fc55dc586013110b2831a98e75563080710805ea8f9a3998a6a7ef9e7075f1db60400ea794aed626c9f1663
|
7
|
+
data.tar.gz: 940bed0678b652b5aeb25fa34c5a3a4f78473abd35080b35abc6b7ebffefc313dd1fd6c31ad026b8ab2e011da6e57e10c5827f52529f32bd606aa91bd4aa7590
|
data/.gitignore
ADDED
data/ChangeLog
ADDED
data/Gemfile
ADDED
@@ -0,0 +1,13 @@
|
|
1
|
+
source "http://rubygems.org"
|
2
|
+
|
3
|
+
gem 'rake'
|
4
|
+
gem 'fuubar'
|
5
|
+
gem 'rb-fsevent', :require => false if RUBY_PLATFORM =~ /darwin/i
|
6
|
+
gem 'growl'
|
7
|
+
gem 'guard-rspec'
|
8
|
+
gem 'guard-cucumber'
|
9
|
+
gem 'page-object'
|
10
|
+
gem 'syntax'
|
11
|
+
|
12
|
+
# Specify your gem's dependencies in ugly_face.gemspec
|
13
|
+
gemspec
|
data/Guardfile
ADDED
@@ -0,0 +1,19 @@
|
|
1
|
+
# A sample Guardfile
|
2
|
+
# More info at https://github.com/guard/guard#readme
|
3
|
+
|
4
|
+
guard 'rspec', :cli => '--color --format Fuubar' do
|
5
|
+
watch(%r{^spec/.+_spec\.rb$})
|
6
|
+
watch(%r{^lib/(.+)\.rb$}) { "spec" }
|
7
|
+
watch('spec/spec_helper.rb') { "spec" }
|
8
|
+
end
|
9
|
+
|
10
|
+
guard 'cucumber', :notification => true, :all_after_pass => false, :cli => '--profile focus' do
|
11
|
+
watch(%r{^features/.+\.feature$})
|
12
|
+
watch(%r{^features/support/.+$}) { 'features' }
|
13
|
+
watch(%r{^features/step_definitions/(.+)_steps\.rb$}) { |m| Dir[File.join("**/#{m[1]}.feature")][0] || 'features' }
|
14
|
+
watch(%r{^lib/.+\.rb$}) { "features" }
|
15
|
+
watch(%r{^lib/.+\.erb$}) { "features" }
|
16
|
+
watch(%r{^lib/.+\.css$}) { "features" }
|
17
|
+
|
18
|
+
end
|
19
|
+
|
data/LICENSE
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
Copyright (c) 2011-2012 Jeff Morgan
|
2
|
+
Copyright (c) 2015 Justin Commu
|
3
|
+
|
4
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
5
|
+
a copy of this software and associated documentation files (the
|
6
|
+
"Software"), to deal in the Software without restriction, including
|
7
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
8
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
9
|
+
permit persons to whom the Software is furnished to do so, subject to
|
10
|
+
the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be
|
13
|
+
included in all copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
16
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
17
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
18
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
19
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
20
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
21
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,25 @@
|
|
1
|
+
# ugly_face
|
2
|
+
|
3
|
+
Customized HTML report for cucumber.
|
4
|
+
|
5
|
+
|
6
|
+
## Getting Started
|
7
|
+
|
8
|
+
### Download gem
|
9
|
+
Add the gem to your Gemfile
|
10
|
+
|
11
|
+
`gem 'ugly_face'`
|
12
|
+
|
13
|
+
Then do a `bundle update` to get the latest version
|
14
|
+
|
15
|
+
### Add Formatter
|
16
|
+
Update your profile in cucumber.yml file with the following arguments
|
17
|
+
|
18
|
+
--format UglyFace::Formatter::Html --out index.html
|
19
|
+
|
20
|
+
You can also run cucumber from the command line with the same arguments.
|
21
|
+
|
22
|
+
|
23
|
+
## Copyright
|
24
|
+
|
25
|
+
Copyright (c) 2015 Justin Commu & Jeffrey S. Morgan. See LICENSE for details.
|
data/Rakefile
ADDED
@@ -0,0 +1,19 @@
|
|
1
|
+
require "bundler/gem_tasks"
|
2
|
+
require 'cucumber'
|
3
|
+
require 'cucumber/rake/task'
|
4
|
+
require 'rspec/core/rake_task'
|
5
|
+
|
6
|
+
Cucumber::Rake::Task.new(:features, "Run all features") do |t|
|
7
|
+
t.profile = 'default'
|
8
|
+
end
|
9
|
+
|
10
|
+
RSpec::Core::RakeTask.new(:spec) do |spec|
|
11
|
+
spec.ruby_opts = "-I lib:spec"
|
12
|
+
spec.pattern = 'spec/**/*_spec.rb'
|
13
|
+
end
|
14
|
+
task :spec
|
15
|
+
|
16
|
+
desc 'Run all specs and features'
|
17
|
+
task :test => %w[spec features]
|
18
|
+
|
19
|
+
task :default => :test
|
data/autotrader.png
ADDED
Binary file
|
data/cucumber.yml
ADDED
@@ -0,0 +1,110 @@
|
|
1
|
+
@no-clobber
|
2
|
+
Feature: pages that show details for features
|
3
|
+
|
4
|
+
Background:
|
5
|
+
When I run `cucumber fixtures --require fixtures/step_definitions --format UglyFace::Formatter::Html --out results/fixture.html`
|
6
|
+
|
7
|
+
@announce
|
8
|
+
@focus
|
9
|
+
Scenario: Generate the pages
|
10
|
+
Then the following files should exist:
|
11
|
+
| results/basic.html |
|
12
|
+
| results/advanced.html |
|
13
|
+
|
14
|
+
Scenario: Generating the basic html page from the erb
|
15
|
+
Then the file "results/basic.html" should contain "DOCTYPE html PUBLIC"
|
16
|
+
And the file "results/basic.html" should contain "<html xmlns='http://www.w3.org/1999/xhtml'>"
|
17
|
+
And the file "results/basic.html" should contain "<head>"
|
18
|
+
And the file "results/basic.html" should contain "<body"
|
19
|
+
And the file "results/basic.html" should contain "<title>Feature Results</title>"
|
20
|
+
|
21
|
+
Scenario: Including an image / logo
|
22
|
+
Then the file "results/basic.html" should contain "<img src="
|
23
|
+
|
24
|
+
Scenario: It should show start time and duration in the header
|
25
|
+
Then the file "results/basic.html" should contain "started:"
|
26
|
+
And the file "results/basic.html" should contain "duration:"
|
27
|
+
|
28
|
+
Scenario: Generating some basic stats from the erb
|
29
|
+
Then the file "results/basic.html" should contain "<th>Executed<"
|
30
|
+
And the file "results/basic.html" should contain "<th>Average Duration"
|
31
|
+
And the file "results/basic.html" should contain "Scenarios"
|
32
|
+
And the file "results/basic.html" should contain "Steps"
|
33
|
+
|
34
|
+
Scenario: It should capture scenario and step statuses
|
35
|
+
Then the file "results/basic.html" should contain "Passed"
|
36
|
+
And the file "results/basic.html" should contain "Failed"
|
37
|
+
And the file "results/basic.html" should contain "Pending"
|
38
|
+
And the file "results/basic.html" should contain "Undefined"
|
39
|
+
And the file "results/basic.html" should contain "Skipped"
|
40
|
+
|
41
|
+
Scenario: It should display scenario names
|
42
|
+
Then the file "results/basic.html" should contain "A passing scenario"
|
43
|
+
And the file "results/advanced.html" should contain "A scenario outline"
|
44
|
+
And the file "results/background.html" should contain "Another passing scenario"
|
45
|
+
|
46
|
+
Scenario: It should display scenario steps
|
47
|
+
Then the file "results/basic.html" should contain "it should say hello"
|
48
|
+
And the file "results/background.html" should contain "it should say hello"
|
49
|
+
And the file "results/advanced.html" should contain "I am using a scenario outline"
|
50
|
+
|
51
|
+
Scenario: It should display the step and data for scenario outline steps
|
52
|
+
Then the file "results/advanced.html" should contain "I use aaa"
|
53
|
+
And the file "results/advanced.html" should contain "I use bbb"
|
54
|
+
|
55
|
+
Scenario: It should display descriptions for features
|
56
|
+
Then the file "results/basic.html" should contain "As a stakeholder"
|
57
|
+
Then the file "results/basic.html" should contain "I want to see some details about this feature"
|
58
|
+
Then the file "results/basic.html" should contain "So that I have some idea why this test matters"
|
59
|
+
|
60
|
+
Scenario: It should display a nested table
|
61
|
+
Then the file "results/advanced.html" should contain "<th>key1</th>"
|
62
|
+
And the file "results/advanced.html" should contain "<th>key2</th>"
|
63
|
+
And the file "results/advanced.html" should contain "<th>key3</th>"
|
64
|
+
And the file "results/advanced.html" should contain "<td>value1</td>"
|
65
|
+
And the file "results/advanced.html" should contain "<td>value2</td>"
|
66
|
+
And the file "results/advanced.html" should contain "<td>value3</td>"
|
67
|
+
|
68
|
+
Scenario: It should display the multi-line argument
|
69
|
+
Then the file "results/advanced.html" should contain "Hello with"
|
70
|
+
And the file "results/advanced.html" should contain "more than one"
|
71
|
+
And the file "results/advanced.html" should contain "line in a string"
|
72
|
+
|
73
|
+
Scenario: It should display errors for features
|
74
|
+
Then the file "results/basic.html" should contain "RSpec::Expectations::ExpectationNotMetError"
|
75
|
+
And the file "results/advanced.html" should contain "RSpec::Expectations::ExpectationNotMetError"
|
76
|
+
And the file "results/failing_background.html" should contain "RSpec::Expectations::ExpectationNotMetError"
|
77
|
+
|
78
|
+
Scenario: It should display error message with a yellow background and red text
|
79
|
+
Then the file "results/basic.html" should contain "RSpec::Expectations::ExpectationNotMetError"
|
80
|
+
And the background of the error message row should be "rgba(249, 231, 8, 1)"
|
81
|
+
And the text of the of the error message row should be "rgba(0, 0, 0, 1)"
|
82
|
+
|
83
|
+
Scenario: Embedding an image into the page
|
84
|
+
Then the file "results/basic.html" should contain "<img id='img_0' style='display: none' src='images/autotrader.png'/>"
|
85
|
+
And the file "results/basic.html" should contain "<a href='' onclick="
|
86
|
+
And the file "results/basic.html" should contain "img=document.getElementById('img_0'); img.style.display = (img.style.display == 'none' ? 'block' : 'none');return false"
|
87
|
+
And the file "results/basic.html" should contain ">AutoTrader</a>"
|
88
|
+
|
89
|
+
Scenario: Displaying a background
|
90
|
+
Then the file "results/background.html" should contain "Background: A scenario can have a background"
|
91
|
+
And the file "results/background.html" should contain "When Cucumber puts"
|
92
|
+
|
93
|
+
Scenario: Feature pages should have a link back to the report summary
|
94
|
+
Then the file "results/advanced.html" should contain "<a href="
|
95
|
+
|
96
|
+
Scenario: Should create directories when directories exist in features directory
|
97
|
+
Then the following files should exist:
|
98
|
+
| results/more/more.html |
|
99
|
+
|
100
|
+
Scenario: Should create a directory for each directory under features
|
101
|
+
Then the following files should exist:
|
102
|
+
| results/onemore/more.html |
|
103
|
+
| results/onemore/deep/more.html |
|
104
|
+
|
105
|
+
Scenario: It should replace the header for the feature pages
|
106
|
+
When I have a feature header partial in the correct location
|
107
|
+
And I run `cucumber fixtures --profile fixture`
|
108
|
+
Then the file "results/basic.html" should contain "The Code Monkeys"
|
109
|
+
And the file "results/basic.html" should contain "Feature Results"
|
110
|
+
And I should remove the feature header partial file
|
@@ -0,0 +1,81 @@
|
|
1
|
+
@no-clobber
|
2
|
+
Feature: pretty face report
|
3
|
+
|
4
|
+
Background:
|
5
|
+
When I run `cucumber fixtures --profile fixture`
|
6
|
+
|
7
|
+
Scenario: Cucumber crefates an html report
|
8
|
+
Then the following files should exist:
|
9
|
+
| results/fixture.html |
|
10
|
+
|
11
|
+
Scenario: Generating the basic html page from the erb
|
12
|
+
Then the file "results/fixture.html" should contain "DOCTYPE html PUBLIC"
|
13
|
+
And the file "results/fixture.html" should contain "<html xmlns='http://www.w3.org/1999/xhtml'>"
|
14
|
+
And the file "results/fixture.html" should contain "<head>"
|
15
|
+
And the file "results/fixture.html" should contain "<body"
|
16
|
+
And the file "results/fixture.html" should contain "<title>Test Results</title>"
|
17
|
+
|
18
|
+
Scenario: Generating some basic stats from the erb
|
19
|
+
Then the file "results/fixture.html" should contain "<th>Executed<"
|
20
|
+
And the file "results/fixture.html" should contain "<th>Average Duration"
|
21
|
+
And the file "results/fixture.html" should contain "Scenarios"
|
22
|
+
And the file "results/fixture.html" should contain "Steps"
|
23
|
+
|
24
|
+
Scenario: Including the styles for the main page
|
25
|
+
Then the file "results/fixture.html" should contain "<link href='stylesheets/style.css' type='text/css' rel='stylesheet' />"
|
26
|
+
And the file "results/fixture.html" should not contain "</style>"
|
27
|
+
|
28
|
+
Scenario: Including an image / logo
|
29
|
+
Then the file "results/fixture.html" should contain "<img src="
|
30
|
+
|
31
|
+
Scenario: It should copy the style sheet to the stylesheets directory
|
32
|
+
Then the following files should exist:
|
33
|
+
| results/stylesheets/style.css |
|
34
|
+
|
35
|
+
Scenario: It should copy the logo image to the images directory
|
36
|
+
Then the following files should exist:
|
37
|
+
| results/images/face.png |
|
38
|
+
|
39
|
+
Scenario: It should show start time and duration in the header
|
40
|
+
Then the file "results/fixture.html" should contain "started:"
|
41
|
+
And the file "results/fixture.html" should contain "duration:"
|
42
|
+
|
43
|
+
Scenario: It should capture scenario and step statuses
|
44
|
+
Then the file "results/fixture.html" should contain "Passed"
|
45
|
+
And the file "results/fixture.html" should contain "Failed"
|
46
|
+
And the file "results/fixture.html" should contain "Pending"
|
47
|
+
And the file "results/fixture.html" should contain "Undefined"
|
48
|
+
And the file "results/fixture.html" should contain "Skipped"
|
49
|
+
|
50
|
+
Scenario: It should display all of the tests with failures
|
51
|
+
Then the file "results/fixture.html" should contain "Tests With Failures:"
|
52
|
+
|
53
|
+
Scenario: It should display a list of all features / scenarios
|
54
|
+
Then the file "results/fixture.html" should contain "Feature Overview:"
|
55
|
+
|
56
|
+
Scenario: It should display useful information about each scenario
|
57
|
+
Then the file "results/fixture.html" should contain "Feature"
|
58
|
+
And the file "results/fixture.html" should contain "File"
|
59
|
+
And the file "results/fixture.html" should contain "Passed"
|
60
|
+
And the file "results/fixture.html" should contain "Failed"
|
61
|
+
And the file "results/fixture.html" should contain "Pending"
|
62
|
+
And the file "results/fixture.html" should contain "Undefined"
|
63
|
+
And the file "results/fixture.html" should contain "Skipped"
|
64
|
+
|
65
|
+
Scenario: It should display the data from scenario outlines
|
66
|
+
Then the file "results/fixture.html" should contain "| aaa | bbb |"
|
67
|
+
And the file "results/fixture.html" should contain "| ccc | ddd |"
|
68
|
+
|
69
|
+
Scenario: It should replace the logo image on the top level page
|
70
|
+
When I have a logo file in the correct location
|
71
|
+
And I run `cucumber fixtures --profile fixture`
|
72
|
+
Then the file "results/fixture.html" should contain "img src='images/logo.png'"
|
73
|
+
And I should remove the logo file
|
74
|
+
|
75
|
+
Scenario: It should replace the header for the main page of the report
|
76
|
+
When I have a suite header partial in the correct location
|
77
|
+
And I run `cucumber fixtures --profile fixture`
|
78
|
+
Then the file "results/fixture.html" should contain "The Code Monkeys"
|
79
|
+
And the file "results/fixture.html" should contain "Test Results"
|
80
|
+
And I should remove the suite header partial file
|
81
|
+
|
@@ -0,0 +1,36 @@
|
|
1
|
+
require 'fileutils'
|
2
|
+
|
3
|
+
When /^I have a logo file in the correct location$/ do
|
4
|
+
FileUtils.cp "features/support/logo.png", "features/support/ugly_face/"
|
5
|
+
end
|
6
|
+
|
7
|
+
Then /^I should remove the logo file$/ do
|
8
|
+
FileUtils.rm "features/support/ugly_face/logo.png"
|
9
|
+
end
|
10
|
+
|
11
|
+
When /^I have a suite header partial in the correct location$/ do
|
12
|
+
FileUtils.cp "features/support/_suite_header.erb", "features/support/ugly_face/"
|
13
|
+
end
|
14
|
+
|
15
|
+
Then /^I should remove the suite header partial file$/ do
|
16
|
+
FileUtils.rm "features/support/ugly_face/_suite_header.erb"
|
17
|
+
end
|
18
|
+
|
19
|
+
When /^I have a feature header partial in the correct location$/ do
|
20
|
+
FileUtils.cp "features/support/_feature_header.erb", "features/support/ugly_face/"
|
21
|
+
end
|
22
|
+
|
23
|
+
Then /^I should remove the feature header partial file$/ do
|
24
|
+
FileUtils.rm "features/support/ugly_face/_feature_header.erb"
|
25
|
+
end
|
26
|
+
|
27
|
+
Then(/^the background of the error message row should be "(.*?)"$/) do |background|
|
28
|
+
@browser = Watir::Browser.new :firefox
|
29
|
+
visit ErrorDisplay do |page|
|
30
|
+
expect(page.error_background).to include background
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
34
|
+
Then(/^the text of the of the error message row should be "(.*?)"$/) do |color|
|
35
|
+
expect(on(ErrorDisplay).error_text_color).to include color
|
36
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '../../', 'lib'))
|
2
|
+
|
3
|
+
require 'aruba/cucumber'
|
4
|
+
require 'page-object'
|
5
|
+
require 'ugly_face'
|
6
|
+
require 'watir-webdriver'
|
7
|
+
|
8
|
+
World PageObject::PageFactory
|
9
|
+
|
10
|
+
Aruba.configure do |config|
|
11
|
+
config.working_directory = "."
|
12
|
+
end
|
13
|
+
|
14
|
+
Before do
|
15
|
+
@dirs = [File.join(File.dirname(__FILE__), '..', '..')]
|
16
|
+
end
|
17
|
+
|
18
|
+
After do
|
19
|
+
@browser.close if @browser
|
20
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
class ErrorDisplay
|
2
|
+
include PageObject
|
3
|
+
|
4
|
+
page_url "file://#{File.dirname(__FILE__)}/../../results/basic.html"
|
5
|
+
|
6
|
+
element(:error, :tr, :class => 'error')
|
7
|
+
|
8
|
+
def error_background
|
9
|
+
error_element.style('background-color')
|
10
|
+
end
|
11
|
+
|
12
|
+
def error_text_color
|
13
|
+
error_element.style('color')
|
14
|
+
end
|
15
|
+
|
16
|
+
end
|
Binary file
|
@@ -0,0 +1,57 @@
|
|
1
|
+
Feature: Advanced scenarios
|
2
|
+
|
3
|
+
Scenario Outline: A scenario outline
|
4
|
+
Given I am using a scenario outline
|
5
|
+
When I use <first>
|
6
|
+
And I use <second>
|
7
|
+
Then the examples should work
|
8
|
+
|
9
|
+
Examples:
|
10
|
+
| first | second |
|
11
|
+
| aaa | bbb |
|
12
|
+
| ccc | ddd |
|
13
|
+
| eee | fff |
|
14
|
+
|
15
|
+
Scenario: Nested table in a step
|
16
|
+
When I have a nested table step like this:
|
17
|
+
| key1 | key2 | key3 |
|
18
|
+
| value1 | value2 | value3 |
|
19
|
+
Then the table should be displayed in the results
|
20
|
+
|
21
|
+
Scenario: A scenario with muti-line arguments
|
22
|
+
When Cucumber puts
|
23
|
+
"""
|
24
|
+
Hello with
|
25
|
+
more than one
|
26
|
+
line in a string
|
27
|
+
"""
|
28
|
+
Then it should say
|
29
|
+
"""
|
30
|
+
Hello with
|
31
|
+
more than one
|
32
|
+
line in a string
|
33
|
+
"""
|
34
|
+
|
35
|
+
Scenario Outline: Fails during examples
|
36
|
+
Given I am using a scenario outline
|
37
|
+
When I fail with <first>
|
38
|
+
Then I use <second>
|
39
|
+
Then the examples should not work
|
40
|
+
|
41
|
+
Examples:
|
42
|
+
| first | second |
|
43
|
+
| aaa | bbb |
|
44
|
+
| ccc | ddd |
|
45
|
+
| eee | fff |
|
46
|
+
|
47
|
+
Scenario Outline: Fails before examples
|
48
|
+
Given the first step fails
|
49
|
+
When I use <first>
|
50
|
+
And I use <second>
|
51
|
+
Then the examples should not work
|
52
|
+
|
53
|
+
Examples:
|
54
|
+
| first | second |
|
55
|
+
| aaa | bbb |
|
56
|
+
| ccc | ddd |
|
57
|
+
| eee | fff |
|
@@ -0,0 +1,20 @@
|
|
1
|
+
Feature: Basic scenarios
|
2
|
+
As a stakeholder
|
3
|
+
I want to see some details about this feature
|
4
|
+
So that I have some idea why this test matters
|
5
|
+
|
6
|
+
Scenario: A passing scenario
|
7
|
+
When Cucumber puts "hello"
|
8
|
+
Then it should say hello
|
9
|
+
|
10
|
+
Scenario: A failing scenario
|
11
|
+
When the first step fails
|
12
|
+
Then the second step should not execute
|
13
|
+
|
14
|
+
Scenario: A pending scenario
|
15
|
+
When the first step is pending
|
16
|
+
Then the second step is undefined
|
17
|
+
|
18
|
+
Scenario: A undefined scenario
|
19
|
+
When all steps are undefined
|
20
|
+
Then the scenario is undefined
|
@@ -0,0 +1,34 @@
|
|
1
|
+
Given /^I am using a scenario outline$/ do
|
2
|
+
|
3
|
+
end
|
4
|
+
|
5
|
+
When /^I use (.*?)$/ do |value|
|
6
|
+
|
7
|
+
end
|
8
|
+
|
9
|
+
When /^I fail with (.*?)$/ do |value|
|
10
|
+
expect(true).to be false
|
11
|
+
end
|
12
|
+
|
13
|
+
|
14
|
+
Then /^the examples should(?: not)? work$/ do
|
15
|
+
sleep 1
|
16
|
+
end
|
17
|
+
|
18
|
+
When /^I have a nested table step like this:$/ do |table|
|
19
|
+
|
20
|
+
end
|
21
|
+
|
22
|
+
Then /^the table should be displayed in the results$/ do
|
23
|
+
|
24
|
+
end
|
25
|
+
|
26
|
+
When /^Cucumber puts$/ do |some_string|
|
27
|
+
puts some_string
|
28
|
+
@last_string = some_string
|
29
|
+
sleep 1
|
30
|
+
end
|
31
|
+
|
32
|
+
Then /^it should say$/ do |some_string|
|
33
|
+
expect(@last_string).to eql some_string
|
34
|
+
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
When /^Cucumber puts "(.*?)"$/ do |some_string|
|
2
|
+
puts some_string
|
3
|
+
embed('autotrader.png', 'image/png', 'AutoTrader')
|
4
|
+
sleep 1
|
5
|
+
end
|
6
|
+
|
7
|
+
When /^Cucumber puts "(.*?)" in a background$/ do |some_string|
|
8
|
+
puts some_string
|
9
|
+
end
|
10
|
+
|
11
|
+
Then /^it should say hello$/ do
|
12
|
+
puts "It said hello"
|
13
|
+
end
|
14
|
+
|
15
|
+
When /^the first step fails$/ do
|
16
|
+
expect(true).to be false
|
17
|
+
end
|
18
|
+
|
19
|
+
Then /^the second step should not execute$/ do
|
20
|
+
puts "Should not execute"
|
21
|
+
end
|
22
|
+
|
23
|
+
When /^the first step is pending$/ do
|
24
|
+
pending
|
25
|
+
end
|
data/lib/.DS_Store
ADDED
Binary file
|
Binary file
|