This repository has been archived by the owner on Jun 16, 2020. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
61 changed files
with
687 additions
and
298 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
Feature: Bin - Failure | ||
Scenario: Run a failing test | ||
Given there is no existing "spec/report.txt" file | ||
When I run `bin/jasmine-headless-webkit -j spec/jasmine/failure/failure.yml --format HeadlessFileReporter --out spec/report.txt` | ||
Then the exit status should be 1 | ||
And the report file "spec/report.txt" should have 1 total, 1 failure, no console usage | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
Feature: Bin - Filtered Run - Both Runs | ||
Background: | ||
Given there is no existing "spec/report.txt" file | ||
|
||
Scenario: Run one and fail | ||
When I run `bin/jasmine-headless-webkit -j spec/jasmine/filtered_failure/filtered_failure.yml --format HeadlessFileReporter --out spec/report.txt ./spec/jasmine/filtered_failure/failure_spec.js` | ||
Then the exit status should be 1 | ||
And the report file "spec/report.txt" should have 1 total, 1 failure, no console usage | ||
|
||
Scenario: Run both and succeed | ||
When I run `bin/jasmine-headless-webkit -j spec/jasmine/filtered_success/filtered_success.yml --format HeadlessFileReporter --out spec/report.txt ./spec/jasmine/filtered_success/success_one_spec.js` | ||
Then the exit status should be 0 | ||
And the report file "spec/report.txt" should have 2 total, 0 failures, no console usage | ||
|
||
Scenario: Run both with console.log | ||
When I run `bin/jasmine-headless-webkit -j spec/jasmine/filtered_success_with_console/filtered_success.yml --format HeadlessFileReporter --out spec/report.txt ./spec/jasmine/filtered_success_with_console/success_one_spec.js` | ||
Then the exit status should be 2 | ||
And the report file "spec/report.txt" should have 2 total, 0 failures, yes console usage |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
Feature: Bin - No Full Run | ||
Background: | ||
Given there is no existing "spec/report.txt" file | ||
|
||
Scenario: Only run the filtered run | ||
When I run `bin/jasmine-headless-webkit -j spec/jasmine/filtered_success/filtered_success.yml --format HeadlessFileReporter --out spec/report.txt --no-full-run ./spec/jasmine/filtered_success/success_one_spec.js` | ||
Then the exit status should be 0 | ||
And the report file "spec/report.txt" should have 1 total, 0 failure, no console usage | ||
|
||
Scenario: Use a file outside of the normal test run | ||
When I run `bin/jasmine-headless-webkit -j spec/jasmine/filtered_success/filtered_success.yml --format HeadlessFileReporter --out spec/report.txt ./spec/jasmine/filtered_success/success_other_file.js` | ||
Then the exit status should be 0 | ||
And the report file "spec/report.txt" should have 1 total, 0 failure, no console usage | ||
|
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
Feature: Bin - Success | ||
Scenario: Run a successful test | ||
Given there is no existing "spec/report.txt" file | ||
When I run `bin/jasmine-headless-webkit --seed 1234 -j spec/jasmine/success/success.yml --format HeadlessFileReporter --out spec/report.txt` | ||
Then the exit status should be 0 | ||
And the report file "spec/report.txt" should have 1 total, 0 failures, no console usage | ||
And the report file "spec/report.txt" should have seed 1234 | ||
|
||
Scenario: Run a successful test with legacy file reporting | ||
Given there is no existing "spec/report.txt" file | ||
When I run `bin/jasmine-headless-webkit -j spec/jasmine/success/success.yml --report spec/report.txt` | ||
Then the exit status should be 0 | ||
And the report file "spec/report.txt" should have 1 total, 0 failures, no console usage | ||
|
||
Scenario: Run a successful test with shortened format definition | ||
Given there is no existing "spec/report.txt" file | ||
When I run `bin/jasmine-headless-webkit -j spec/jasmine/success/success.yml --format HeadlessFileReporter:spec/report.txt` | ||
Then the exit status should be 0 | ||
And the report file "spec/report.txt" should have 1 total, 0 failures, no console usage | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
Feature: Bin - Success with JS Error | ||
Scenario: Succeed | ||
Given there is no existing "spec/report.txt" file | ||
When I run `bin/jasmine-headless-webkit -j spec/jasmine/success_with_error/success_with_error.yml --format HeadlessFileReporter --out spec/report.txt` | ||
Then the exit status should be 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
Feature: Bin - Try to Leave Page | ||
Scenario: Fail on trying to leave the page | ||
Given there is no existing "spec/report.txt" file | ||
When I run `bin/jasmine-headless-webkit -j spec/jasmine/leave_page/leave_page.yml --format HeadlessFileReporter --out spec/report.txt` | ||
Then the exit status should be 1 | ||
And the report file "spec/report.txt" should exist | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
Feature: Bin - Try to Click A Button | ||
Scenario: Don't leave page when clicking a button | ||
Given there is no existing "spec/report.txt" file | ||
When I run `bin/jasmine-headless-webkit -j spec/jasmine/click_button/click_button.yml --format HeadlessFileReporter --out spec/report.txt` | ||
Then the exit status should be 0 | ||
And the report file "spec/report.txt" should have 0 total, 0 failures, no console usage | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
Feature: Bin - With CoffeeScript error | ||
Scenario: Fail on CoffeeScript error | ||
Given there is no existing "spec/report.txt" file | ||
When I run `bin/jasmine-headless-webkit -j spec/jasmine/coffeescript_error/coffeescript_error.yml --format HeadlessFileReporter --out spec/report.txt` | ||
Then the exit status should be 1 | ||
And the report file "spec/report.txt" should not exist | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
Feature: Bin - With console.log | ||
Scenario: Run a successful test that uses console.log | ||
Given there is no existing "spec/report.txt" file | ||
When I run `bin/jasmine-headless-webkit -j spec/jasmine/console_log/console_log.yml --format HeadlessFileReporter --out spec/report.txt` | ||
Then the exit status should be 2 | ||
And the report file "spec/report.txt" should have 1 total, 0 failures, yes console usage | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
Feature: Reporters | ||
In order to allow for multiple types of output | ||
I should be able to | ||
Manage reporters and decide which ones to use | ||
|
||
Scenario: Use default reporters | ||
Given I have the default runner options | ||
When I get a runner | ||
And I get a template writer | ||
Then the template should use the "HeadlessConsoleReporter" reporter to "stdout" | ||
And the command to run the runner should not include a report file | ||
|
||
Scenario: Use a file reporter | ||
Given I have the default runner options | ||
And I have the following reporters: | ||
| Name | File | | ||
| ConsoleReporter | | | ||
| FileReporter | file | | ||
When I get a runner | ||
And I get a template writer | ||
Then the template should use the "ConsoleReporter" reporter to "stdout" | ||
And the template should use the "FileReporter" reporter to "report:0" | ||
And the command to run the runner should include the report file "file" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
Given /^there is no existing "([^"]*)" file$/ do |file| | ||
FileUtils.rm_rf file | ||
end | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
Given /^I have the default runner options$/ do | ||
@options = Jasmine::Headless::Options.new | ||
end | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
Given /^I have the following reporters:$/ do |table| | ||
@options[:reporters] = [] | ||
|
||
table.hashes.each do |hash| | ||
reporter = [ hash['Name'] ] | ||
reporter << hash['File'] if !hash['File'].empty? | ||
|
||
@options[:reporters] << reporter | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
Then /^the exit status should be (\d+)$/ do |exitstatus| | ||
$?.exitstatus.should == exitstatus.to_i | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
Then /^the report file "([^"]*)" should not exist$/ do |file| | ||
File.file?(file).should be_false | ||
end | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
Then /^the report file "([^"]*)" should exist$/ do |file| | ||
File.file?(file).should be_true | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
Then /^the report file "(.*)" should have (\d+) total, (\d+) failures?, (no|yes) console usage$/ do |file, total, failures, console_usage| | ||
report = Jasmine::Headless::Report.load(file) | ||
|
||
report.total.should == total.to_i | ||
report.failed.should == failures.to_i | ||
report.has_used_console?.should == (console_usage == 'yes') | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
Then /^the report file "([^"]*)" should have seed (\d+)$/ do |file, seed| | ||
report = Jasmine::Headless::Report.load(file) | ||
report.seed.should == seed.to_i | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
Then /^the command to run the runner should include the report file "([^"]*)"$/ do |file| | ||
@runner.jasmine_command.should include("-r #{file}") | ||
end | ||
|
3 changes: 3 additions & 0 deletions
3
features/steps/then/runner/it_should_not_include_report_file.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
Then /^the command to run the runner should not include a report file$/ do | ||
@runner.jasmine_command.should_not include('-r') | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
Then /^the template should use the "([^"]*)" reporter to "([^"]*)"$/ do |reporter, target| | ||
output = @template_writer.render | ||
|
||
output.should include(%{jasmine.#{reporter}("#{target}")}) | ||
end | ||
|
Oops, something went wrong.