Closed harsharg closed 4 years ago
Hi Prasanth, Please let me know if you need additional info, adding the folder structure
@prashant-ramcharan
Tried multiple ways, still seeing same issue, the test starts but fails to execute in Jenkins.Please help.
Runner:
Jenkins console:
Hello,
It looks like the Courgette runner is being pick up.
Can you provide the cucumber.json ?
Can you also confirm that your tests run fine without Courgette in Jenkins?
I noticed that the cucumber.json is pointing to the execution on 13th June, it's not showing the latest execution
The issue seems to be with your tests + chrome browser + Jenkins setup.
Looking at the cucumber.json
you provided, there is a org.openqa.selenium.WebDriverException
causing the error.
This error is not related to Courgette so please first make sure that you can run your tests successfully in Jenkins without Courgette.
Sure, will do, wanted to check if using this dependency will cause any issues
The issue is not with Courgette because your tests does execute.
In your Jenkins build a CourgetteTestFailureException
is raised which means Courgette successfully executed the tests but there was failures / errors with your Cucumber tests. You will have to resolve those failures / errors first.
Hope this helps.
I tried to run the tests without courgette and was able to execute them in Jenkins.Please advice.
Runner: @RunWith(Cucumber.class) @CucumberOptions (features="src/test/resources/features", tags = "@smokeTest", glue = "steps",//For instance, once cucumber runs I want to add //plugin = {"pretty", "html:target/cucumber-htmlreport","json:target/cucumber-report.json"} monochrome = true, dryRun = false, strict=false, plugin= {"pretty","json:target/cucumber-report/cucumber.json","html:target/cucumber-htmlreport","junit:target/cucumber-report/cucumber.xml"} )
Unfortunately, I cannot advise any further because the error in your Jenkins build is not related to a Courgette error.
courgette.runtime.CourgetteTestFailureException: Please refer to Courgette / Cucumber report for more info
This means that Courgette ran your tests but there were failures in your tests. This Courgette exception is not the cause of your issue.
Does your tests run fine locally with Courgette?
Yes, it works fine locally. The error in jenkins occurs when executing before hooks.
As it's a Cucumber exception that's being thrown it might be an issue with dependencies / classes in your Jenkins agent / workspace.
Perhaps you can try the following:
mvn dependency:purge-local-repository
The tests run fine locally, but when running in Jenkins, the tests are getting failed.It's a multi module maven project , getting below error and the tests are not executed.Please advice.
Error:
INFO] Running null [ERROR] Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.032 s <<< FAILURE! - in null [ERROR] Time elapsed: 0.002 s <<< ERROR! courgette.runtime.CourgetteTestFailureException: Please refer to Courgette / Cucumber report for more info.
Runner file: @RunWith(Courgette.class) @CourgetteOptions( threads = 1, runLevel = CourgetteRunLevel.SCENARIO, rerunFailedScenarios = false, rerunAttempts = 1, showTestOutput = true, reportTargetDir = "build", cucumberOptions = @CucumberOptions( tags = {"@smokeTest"}, features = {"src/test/resources/features"}, glue = {"steps"}, monochrome = true, dryRun = false, plugin = {"pretty", "json:build/cucumber-report/cucumber.json", "html:build/cucumber-report/cucumber.html", "junit:build/cucumber-report/cucumber.xml"}))
POM: