-
Notifications
You must be signed in to change notification settings - Fork 11
JUnit
Neodymium provides an extended JUnit4 test runner. The NeodymiumRunner
is used to provide our features like test data handling, multi browser support and the consequential test multiplication.
The NeodymiumRunner
can be used easily by annotating the test case class. Please see example below:
@RunWith(NeodymiumRunner.class)
public class DemoTest
{
@Test
public void ensureFunctionality()
{
// add test code
}
}
Neodymium provides a set of annotations that can be used to configure a test case using the NeodymiumRunner
.
@Browser
@SuppressBrowser
Please check the Multi browser support page for detailed information.
@DataSet
@SuppressDataSet
@DataFile
Please check the Test data provider page for detailed information.
In general the standard test execution order of JUnit > 4.11 applies. More info here https://github.com/junit-team/junit4/wiki/Test-execution-order. This means in default there is no fixed order within the methods annotated with @Test
since they are retrieved as map.
For Neodymium this results in a mixture of ordered and unordered. The test methods are retrieved as map but while computing the test multiplication for test data sets and browsers they are added as a complete sets (cross product of method, test data sets and browsers) for each method that is effected by Neodymium's annotations(see above).
In addition it's possible to fix the method order by using JUnit's @FixMethodOrder
annotation. Please see example below:
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
@RunWith(NeodymiumRunner.class)
public class DemoTest
{
@Test
public void ensureFunctionalityC()
{
System.out.println("third");
// add test code
}
@Test
public void ensureFunctionalityB()
{
System.out.println("second");
// add test code
}
@Test
public void ensureFunctionalityA()
{
System.out.println("first");
// add test code
}
}
Overview
Neodymium features
- Neodymium configuration properties
- Neodymium context
- Utility classes
- Test data provider
- Test Environments
- Multi browser support
- Applitools Plugin
- Localization
- Highlight and Wait
- Advanced Screenshots
- Seperate Browser Sessions for Setup and Cleanup
Best practices and used frameworks
Special