How to generate cucumber reports not using a test runner - cucumber

I have created an application which runs cucumber tests on demand
Previously I was running cucumber through a test runner in junit, but I now run the tests using cucumbers own io.cucumber.core.cli.Main.
Is there a way to use cucumber plugin "pretty" to generate cucumber reports with this approach?

You should add -p "html:target/cucumber-report/cucumber.html" to your options . See here.

Related

Existing cucumber bdd steps do not work with Karate

I have recently started using karate. I have an existing project which has steps with cucumber and now I am writing tests using karate. As Karate is built on cucumber, I am still not able to run my custom written step definitions.
I tried adding all cucumber and karate dependencies, adding cucumber option in karateRunner
NA
com.intuit.karate.exception.KarateException: KarateTesting.feature:14 - no step-definition method match found for: Then verify the transaction calculation and logic

Cucumber+TestNG and Cucumber+JUNIT comparison

Can anyone please help me in understanding what is difference or advantages of using Cucumber+TestNG over Cucumber+Junit ?
TestNG provides more Annotations Like #BeforeSuite .
TestNG it self provides support for Junit.
With Latest upgrade of cucumber(4.0) Cucumber - TestNg provides Parallel Execution at Scenario Level where as Junit provides at Feature level.
TestNG and Junit are just a unit testing frameworks, when you use Cucumber with Junit you can use Junit Annotation/Assertions in step definition file and similarly when you use Cucumber with TestNG you can use TestNG Annotation/Assertions in step definition file.
Actually in both cases you would be writing the Test Steps using selenium and probably will use the classes inside JUnit or TestNG to run the cucumber Feature file.
As per my knowledge the only place I used such file was the when I'm creating the TestRunner.java class.
It's much easier to do with JUnit since you just have to import org.junit.runner.RunWith But if you are using TestNG you'll need to use dataProviders and go on a bit more complex path to create the TestRunner Class
Other than that there won't be any other differences since you will be using cucumber features for testing.
Due to the above mentioned advantage, I recommend to use JUnit + Cucumber + Selenium for your scripting
I tried both but decided for JUNIT 4.12 (JUNIT 5 does not seem to work with cucumber yet). It has all that you need. But i have to test that parallel thing in Test NG i guess. ;)
I use Cucumber in a Spring Boot Project and therefore JUNIT did not cause any problems for me. I can hand over a browser instance over multiple classes here (#Autowired) and this makes my code so much more modularizable.
You may have more annotation-options with Test NG but somehow i have the feeling that more people work with JUnit, so you have more support and a bigger community here.

How do I make a suite of unit [and functional] browser tests?

Intern says it allows browser unit tests, in addition to functional tests running over webdriver. IIUC a unit test can assume it's running in a browser and freely access document and window etc.
If I write a set of such browser unit tests, how do I run all of them and collect the results into one report? And how would I run a set of unit tests and functional tests combined together?
All test suites that are defined in the suites key of your your Intern configuration are loaded and reported using whatever the reporter is that you’ve configured regardless of platform. The same is true of functionalSuites when running tests using the runner. Running tests all at once is explained in the multi-platform section of the running tests documentation.

Can I generate code coverage from deployments on azure?

We would like to be able to deploy our code to azure and then run integration/acceptance tests on the deployed instances to validate the functionality, as using the emulator does not always give realistic results.
We would also like to have these tests generate code coverage reports which we could then merge in with the code coverage from our unit tests. We are using TeamCity as our build server with the built in dotcover as our code coverage tool.
Can we do this? Does anyone have any pointers on where to start?
Check out this video
Kudu can be extended to run Unit Tests and much more more using Custom Deployment Scripts.
http://www.windowsazure.com/en-us/documentation/videos/custom-web-site-deployment-scripts-with-kudu/

Running Unit Tests on NodeJS with Jenkins

How might I setup Jenkins to start my Node.JS Testing Server, run Unit Test probably JSTestDriver/Jasmine, and then top Node.JS?
I can start Node.JS using Execute Shell, but it "hangs" the build (expected since Node runs as a daemon)
I've written an article that explains how I've managed to run my unit tests with Mocha and ant.
The basic idea is:
Set your environment variables so that jenkins can control them
Use mocha's xunit reporter to generate a result report
Use Jenkins' Publish JUnit test result report option to read the result report.
You can read the full article here.
JSTestDriver outputs it's results in a xUnit compliant xml format. Which the Hudson 'xUnit' plugin can then interpret.
We are planning to integrate jsTestDriver into Jenkins. To test our javaScript code in a selection of supported browsers.
there is a plugin to execute nodejs with possibility to choice the nodejs version
https://wiki.jenkins-ci.org/display/JENKINS/NodeJS+Plugin

Resources