Skip to content

Could not generate test report because of outline examples #972

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Closed
azlekov opened this issue Mar 12, 2016 · 11 comments
Closed

Could not generate test report because of outline examples #972

azlekov opened this issue Mar 12, 2016 · 11 comments

Comments

@azlekov
Copy link

azlekov commented Mar 12, 2016

I have following scenario outline with examples:

Scenario Outline: Example sale with adjustment
      Given fiscal device in normal state
      When open fiscal receipt with operator 1 and password "0000"
      And user try to sell <text> for $0.99 single price in Tax group "A" with quantity of 2 with adjustment <type> of <value>
      Examples:
        | text                 | type                      | value |
        | "discount by perc"   | "DISCOUNT_BY_PERCENTAGE"  | 10.0  |
        | "discount by value"  | "DISCOUNT_BY_SUM"         | 0.10  |
        | "surcharge by perc"  | "SURCHARGE_BY_PERCENTAGE" | 10.0  |
        | "surcharge by value" | "SURCHARGE_BY_SUM"        | 0.10  |

and defined test class as follow:

@RunWith(Cucumber.class)
@CucumberOptions(
        plugin = {"pretty", "html:target/cucumber-html-report"},
        features = "src/test/resources/"
)
public class SalesTest {

}

Then my build failed because of:

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':devices:test'.
> Could not generate test report to 'D:\Intellij\DatecsFiscalFramework\devices\build\reports\tests'.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

Total time: 17.053 secs
D:\Intellij\DatecsFiscalFramework\devices\build\reports\tests\packages\| "discount by perc" | "DISCOUNT_BY_PERCENTAGE" | 10.html (The filename, directory name, or volume label syntax is incorrect)
16:08:25: External task execution finished 'build'.

I saw there was and --expand option but my project is configured with 1.2.4. How can make my build not failing and optionally to have successfully generated report.

dependencies {
    ...
    testCompile 'info.cukes:cucumber-java:1.2.4'
    testCompile 'info.cukes:cucumber-junit:1.2.4'
    testCompile 'junit:junit:4.12'
}

I'm on windows.
Thanks.

@OanaPasnicu
Copy link

Could you give more information and sample how you have defined the ':devices:test' task?

@mrduguo
Copy link

mrduguo commented Apr 17, 2016

It happens to me as well on Windows due to the generated step name contain illegal windows characters with root cause:
Caused by: java.io.FileNotFoundException: ...\github\mrduguo\gradle-sample-cucumber\build\reports\tests\packages\| 127.0.0.html (The filename, directory name, o r volume label syntax is incorrect) at org.gradle.internal.IoActions$TextFileWriterIoAction.execute(IoActions.java:108) ... 77 more

You may reproduce by clone the repo then run ./gradlew from there

@mrduguo
Copy link

mrduguo commented Apr 17, 2016

Found related discussion: only fail if the outline value contain DOT
http://stackoverflow.com/questions/25174141/could-not-generate-test-report-in-gradle-due-to-cucumber-step-syntax

@mrduguo
Copy link

mrduguo commented Apr 17, 2016

Created sample project gradle-cucumber-jvm-issue-972 to reproduce:

git clone https://github.com/mrduguo/gradle-cucumber-jvm-issue-972.git

./gradlew

@RohitVerma0123
Copy link

I am not able to generate cucumber reports , I have added plugin ={"html:target/cucumber-html-report"} to my test runner file but when I run this using TestRunner file , It gives me only Reports.js file under target folder , Index.HTML file was missing from the folder , Only reprts.js file was there

Please help !!

image

@brasmusson
Copy link
Contributor

@RohitVerma0123 This is an issue tracker, please ask for help in a support forum.

@AnilKumar345
Copy link

Hello, Let me help with the following error, How to Resolve?

cucumber.runtime.CucumberException: Failed to create scenario runner
at cucumber.runtime.junit.FeatureRunner.buildFeatureElementRunners(FeatureRunner.java:85)
at cucumber.runtime.junit.FeatureRunner.(FeatureRunner.java:31)
at cucumber.api.junit.Cucumber.addChildren(Cucumber.java:95)
at cucumber.api.junit.Cucumber.(Cucumber.java:67)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at org.junit.internal.builders.AnnotatedBuilder.buildRunner(AnnotatedBuilder.java:104)
at org.junit.internal.builders.AnnotatedBuilder.runnerForClass(AnnotatedBuilder.java:86)
at org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.java:59)
at org.junit.internal.builders.AllDefaultPossibilitiesBuilder.runnerForClass(AllDefaultPossibilitiesBuilder.java:26)
at org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.java:59)
at org.junit.internal.requests.ClassRequest.getRunner(ClassRequest.java:33)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestLoader.createUnfilteredTest(JUnit4TestLoader.java:84)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestLoader.createTest(JUnit4TestLoader.java:70)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestLoader.loadTests(JUnit4TestLoader.java:43)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:444)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:675)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192)
Caused by: org.junit.runners.model.InitializationError
at org.junit.runners.ParentRunner.validate(ParentRunner.java:418)
at org.junit.runners.ParentRunner.(ParentRunner.java:84)
at org.junit.runners.Suite.(Suite.java:112)
at cucumber.runtime.junit.ExamplesRunner.(ExamplesRunner.java:19)
at cucumber.runtime.junit.ScenarioOutlineRunner.(ScenarioOutlineRunner.java:21)
at cucumber.runtime.junit.FeatureRunner.buildFeatureElementRunners(FeatureRunner.java:81)
... 20 more

@mlvandijk
Copy link
Member

@AnilKumar345 This is an issue tracker. Please ask for help in a support forum. Also, please provide additional information (i.e. which version of Cucumber do you use, what is the code of your runner?)

@AnilKumar345
Copy link

Thanks for your reply

I am using the following dependencies, Can you please suggest me which version is supports all the cucumber functionalities?

	<dependency>
		<groupId>info.cukes</groupId>
		<artifactId>cucumber-java</artifactId>
		<version>1.1.5</version>
		<scope>test</scope>
	</dependency>

	<dependency>
		<groupId>info.cukes</groupId>
		<artifactId>cucumber-jvm</artifactId>
		<version>1.2.5</version>
		<type>pom</type>
	</dependency>

	<dependency>
		<groupId>info.cukes</groupId>
		<artifactId>cucumber-junit</artifactId>
		<version>1.1.5</version>
		<scope>test</scope>
	</dependency>

	<dependency>
		<groupId>info.cukes</groupId>
		<artifactId>cucumber-jvm-deps</artifactId>
		<version>1.0.5</version>
	</dependency>
	
	<dependency>
		<groupId>net.masterthought</groupId>
		<artifactId>cucumber-reporting</artifactId>
		<version>1.0.0</version>
	</dependency>
	
	<dependency>
		<groupId>info.cukes</groupId>
		<artifactId>gherkin</artifactId>
		<version>2.12.2</version>
	</dependency>

@mlvandijk
Copy link
Member

@AnilKumar345 Please find installation info in the docs

@lock
Copy link

lock bot commented May 29, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators May 29, 2019
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants