How to generate two seperate serenity reports for two seperate cucumber tests using the same runner class? - selenium

I have two cucumber feature files.
1) Feature 1
2) Feature 2
I have one CucumberWithSerenity runner class.
When I run both feature files together, using the same runner class the report generation is failing with the below error.
FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':runTests'.
Multiple build operations failed.
Could not write XML test results
It's a gradle based project, and the task fails.
My observations:
As the serenity is saving the results/screenshots for both the feature files in the same below directory : /target/site/ it's failing to generate two seperate reports at run time. Please can I get some help on how to generate two seperate reports for both feature files using the same runner class.

Related

Tests order execution using jmeter maven plugin

I'm traying to execute few Jmeter tests using Jmeter maven plugin in my case the tests order can be important, I tried to figure how can I control the different tests order using the Jmeter maven plugin with no success , any idea if it's possible ?
<!-- The flows we want to execute -->
<testFilesIncluded>
<jMeterTestFile>flows/flow1</jMeterTestFile>
<jMeterTestFile>flows/flow2</jMeterTestFile>
<jMeterTestFile>flows/flow3</jMeterTestFile>
</testFilesIncluded>
in this case 3 runs first then 1 and last is 2
The order of execution is not guaranteed, if you need to run tests in particular order either execute your Maven build 3 times providing a single .jmx script or combine these scripts into one "umbrella" script which will be invoking the others stored as Test Fragments via Include Controller or Module Controller.

Empty test suite error when running unit test case in intellij

I check out the source code of Cassandra, and I want to run a unit test case in debug mode to understand how it works
Below is my JUnit run configuration set up. The code can compile correctly using ant. And I tried both targets build and build-test.
IntelliJ can pick up the class in the run configuration, but when I run this profile, I got.
Process finished with exit code 1
Class not found: "org.apache.cassandra.tools.SSTableExportTest"
Empty test suite.
What part do I need to change the configuration so that IntelliJ can run this unit test cases?
Since you're trying to debug Cassandra. You can reference https://wiki.apache.org/cassandra/RunningCassandraInIDEA. They have already set up a ant target to generate required configurations.

Parallel execution of features files : maven-failsafe-plugin vs cucumber-jvm-parallel-plugin

Currently I'm using maven-failsafe-plugin to run multiple feature files in parallel with Selenium Grid + nodes ( all running in docker containers )
I'm basic questions as below
when to use cucumber-jvm-parallel-plugin ?
what benefits / disadvantages of cucumber-jvm-parallel-plugin over maven-failsafe-plugin parallel execution ?
Thanks in advance.
Below is the answer
"A common approach for running Cucumber features in parallel is to create a suite of Cucumber runners, one for each suite of tests you wish to run in parallel. For maximum parallelism, there should be a runner per feature file.
This is a pain to maintain and not very DRY."
https://github.com/temyers/cucumber-jvm-parallel-plugin/issues/139
additional details -
..Despite its name cucumber-jvm-parallel-plugin does not run any tests, it just automatically generates the Cucumber runners for you. This saves you time from making empty runner files and also just by changing the config of the cucumber-jvm-parallel-plugin you can have brand new set of runner files..
copied from http://automationrhapsody.com/running-cucumber-tests-in-parallel/#comment-3455579028

Running NUnit/SpecFlow tests in TFS2017

I'm not sure whether the issue is with NUnit or SpecFlow but whenever I add the 'Run Functional Tests' task to my build, I get the following error when running a build in TFS2017...
2017-05-06T00:11:00.4676774Z ##[warning]DistributedTests: Test discovery started.
2017-05-06T00:11:00.4676774Z ##[warning]DistributedTests: Test Run Discovery Aborted . Test run id : 5
2017-05-06T00:11:00.4676774Z ##[warning]DistributedTests: UnExpected error occured during test execution. Try again.
2017-05-06T00:11:00.4676774Z ##[warning]DistributedTests: Error : NUnit Adapter 3.7.0.0: Test discovery complete
2017-05-06T00:11:00.4676774Z
2017-05-06T00:11:00.4676774Z ##[warning]DistributedTests: Test run aborted. Test run id: 5
2017-05-06T00:11:00.4676774Z ##[error]System.Exception: The test run was aborted, failing the task.
2017-05-06T00:11:00.5175379Z ##[error]PowerShell script completed with 1 errors.
Does anyone know what the problem is?
Many thanks,
Run Functional Tests task are used for below scenarios.
Typical scenarios include:
Tests that require additional installations on the test machines, such as different browsers for Selenium tests
Coded UI tests
Tests that require a specific operating system configuration
To execute a large number of unit tests more quickly by using multiple test machines
If you are using specflow you need to make sure that you implement using MS Test.
Regardless of the fact which unit test provider you use for SpecFlow, because all the major unit test frameworks provide the necessary adapter for it (this is the same adapter that you need to run the tests from the Visual Studio Test Explorer Window)
So you need to use Visual Studio Test task in this scenario(Also for handling standard unit tests). For details of the settings please refer this blog: SpecFlow Tips--Run only specific scenarios in TFS/VSTS build

Stop TeamCity Build when process exits with code 1

I am creating a TeamCity build configuration with a few steps. One of those steps is running tests using MSTest. Currently, my tests are failing (by design so I can test the build process), but the build steps after the step for running the tests happen, even though I can see the test process exits with code 1 (ie, something other than code 0) in the build log. It does mark the build as failed, but I'd prefer it if the steps in the build stopped once failing tests were detected. Is that possible and I'm just missing something in the configuration?
When you create build step there are select Execute step for execution policy. Where you should select Only if all previous steps were successful.
Here is it:
But in your case there are bug in the MsTest and NUnit build steps. Here is workaround. And here is related issue.