@spawn Feature: JUnit output formatter In order for developers to create test reports with ant Cucumber should be able to output JUnit xml files Background: Given the standard step definitions And a file named "features/one_passing_one_failing.feature" with: """ Feature: One passing scenario, one failing scenario Scenario: Passing Given this step passes Scenario: Failing Given this step fails """ And a file named "features/some_subdirectory/one_passing_one_failing.feature" with: """ Feature: Subdirectory - One passing scenario, one failing scenario Scenario: Passing Given this step passes Scenario: Failing Given this step fails """ And a file named "features/pending.feature" with: """ Feature: Pending step Scenario: Pending Given this step is pending Scenario: Undefined Given this step is undefined """ And a file named "features/pending.feature" with: """ Feature: Pending step Scenario: Pending Given this step is pending Scenario: Undefined Given this step is undefined """ And a file named "features/scenario_outline.feature" with: """ Feature: Scenario outlines Scenario Outline: Using scenario outlines Given this step Examples: | type | | passes | | fails | """ Scenario: one feature, one passing scenario, one failing scenario When I run `cucumber --format junit --out tmp/ features/one_passing_one_failing.feature` Then it should fail with: """ """ And the junit output file "tmp/TEST-features-one_passing_one_failing.xml" should contain: """ """ Scenario: one feature in a subdirectory, one passing scenario, one failing scenario When I run `cucumber --format junit --out tmp/ features/some_subdirectory/one_passing_one_failing.feature --require features` Then it should fail with: """ """ And the junit output file "tmp/TEST-features-some_subdirectory-one_passing_one_failing.xml" should contain: """ """ Scenario: pending and undefined steps are reported as skipped When I run `cucumber --format junit --out tmp/ features/pending.feature` Then it should pass with: """ """ And the junit output file "tmp/TEST-features-pending.xml" should contain: """ """ Scenario: pending and undefined steps with strict option should fail When I run `cucumber --format junit --out tmp/ features/pending.feature --strict` Then it should fail with: """ """ And the junit output file "tmp/TEST-features-pending.xml" should contain: """ """ Scenario: run all features When I run `cucumber --format junit --out tmp/ features` Then it should fail with: """ """ And a file named "tmp/TEST-features-one_passing_one_failing.xml" should exist And a file named "tmp/TEST-features-pending.xml" should exist Scenario: show correct error message if no --out is passed When I run `cucumber --format junit features` Then the stderr should not contain: """ can't convert .* into String \(TypeError\) """ And the stderr should contain: """ You *must* specify --out DIR for the junit formatter """ Scenario: one feature, one scenario outline, two examples: one passing, one failing When I run `cucumber --format junit --out tmp/ features/scenario_outline.feature` Then it should fail with: """ """ And the junit output file "tmp/TEST-features-scenario_outline.xml" should contain: """ ']]> """