Previously I was using Maven+Selenide+JUnit4 for my tests and it was fine, parallel running worked perfectly. Example:
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>${maven.surefire.plugin}</version>
<configuration>
<parallel>all</parallel>
<perCoreThreadCount>true</perCoreThreadCount>
<threadCount>4</threadCount>
<perCoreThreadCount>false</perCoreThreadCount>
<redirectTestOutputToFile>true</redirectTestOutputToFile>
</configuration>
</plugin>
And in Jenkins job I was able to run tests (example below)
mvn -Dtest=TestClassName test
My tests were running in 4 browsers.
Before I switched to JUnit5, because I would like to use running tests by tags, for example
@Test
@Tag("smoke")
public void test1() {}
And run all tests which marked as 'smoke' by next command:
mvn -Dtag=smoke test
But I got next problem: parallel execution does not work and I still did not find solution. I found this bug https://github.com/junit-team/junit5/issues/1424
How can I run tests in parallel with JUnit5?
I have tried to use in pom.xml
<forkCount>2</forkCount>
<reuseForks>true</reuseForks>
<parallel>all</parallel>
It did not help, I have created a file junit-platform.properties and insert there
junit.jupiter.execution.parallel.enabled = true
junit.jupiter.execution.parallel.config.strategy = fixed
But anyway I was not able to solve this problem.
junit-platform.properties
file reside? And can you perhaps share a sample project demonstrating that the tests do not run in parallel? – Globoidjunit-platform.properties
tosrc/test/resources
. – Galateah