-
Notifications
You must be signed in to change notification settings - Fork 168
Parameters
Parameter is any value describing your test environment or current test case. A parameter can store something that doesn't change during all tests (such as the test stand address), or something that changes from test case to test case (such as the test page URL).
Adding parameters in Java looks like this (see https://github.com/allure-framework/allure-core/pull/286):
public class TestClass {
...
@Parameter("My Param")
private String myParameter;
...
}
Any value assigned to such a field will be shown in the report.
Note: Constant fields (static final) with a String or primitive value type (int, float, long, etc.) don't work with @Parameter annotation because of Java implementation particularities.
Some test frameworks support parametrized tests, i.e. the same test is executed multiple times with different parameters. Test parameter names and values can be made visible in Allure report.
Test method parameters can be marked with @Parameter
annotation:
public void parametrizedTest(@Parameter int age,
@Parameter("Name") String parameter2,
@Parameter("Surname") String parameters3) {
...
}
Parameter names can be defined in following ways:
-
@Parameter
without arguments - by default parameter names are generated as arg1, arg2, etc. -
@Parameter
without arguments, but test classes compiled with Java 8 javac -parameters key - parameter names will be taken from variable names in source code. -
@Parameter("parameter name")
with argument - you can overwrite options above.
- aShot - WebDriver Screenshot utility. Take screenshots, crop, prettify, compare.
- HTML Elements - A Java framework that provides easy-to-use interaction with page elements in webpage tests.
- Properties - A Java library for populating beans with system environment properties in a simple and convenient way.
- Perspective - API and shell to orchestrate multiple clouds.