We use convention over configuration to configure the behavior of recheck. Thus unless your setup does not fit to the default mechanism, you should not have to configure anything.
Tools we use for code development, and thus are configured as the default:
Tools we do not (actively) use, but support:
RecheckOptions are used to configure the behavior of
Recheck or similar classes that may use a
Recheck instance internally. They use the builder pattern and cannot be changed, once they are created (i.e. they are immutable).
RecheckOptions options = RecheckOptions.builder() // Do your configuration here .build()
If the default or automatic systems does not fit your needs or produce the wrong results, you must specify the respective options manually.
The options can be easily passed to the
Recheckoptions opts = RecheckOptions.builder() // Do your configuration here .build(); Recheck re = new RecheckImpl( opts );
Recheck instances should honor all available options from
Below is a list of the available options you may configure with corresponding methods on
RecheckOptionsBuilder. Please refer to the detailed sections below.
All options annotated with "Evaluate" below will be queried with the creation of the
RecheckOptions instance, either retrieving (by the methods described), instantiating or loading the proper value.
||Defines the name for the phase of the lifecycle.|
||Defines where the Golden Masters and reports are located.|
||Overwrite the name for the suite.
||Upload reports to rehub.|
||Set the filter used for reporting the differences after a test phase.
See examples below.
RecheckOptions.builder() .namingStrategy( new ClassAndMethodBasedShortNamingStrategy() ) .projectLayout( new GradleProjectLayout() ) .suiteName( "my-custom-suite-name" ) .enableReportUpload() .addIgnore( "MyCustomIgnore.filter" ) .build();
Per default, we assume a Maven project with JUnit. The files are located under the following folders:
- Golden Masters:
suiteName is evaluated to provide a consistent name for the
RecheckOptions. The automatic system does not work with some usages (e.g. inheritance) and thus require a custom
suiteName to be defined.
Upload Reports to rehub
When executing your tests on a CI, it may not be straightforward to access the created reports. For this we offer a way to upload your reports to rehub so that you can easily update your Golden Masters.
Per default, we load the
recheck.ignore files as specified in filters. Thus, the
suiteName is a required dependency to be evaluated before, so that the filters are loaded from the correct Golden Master.
If you want specify additional filters (e.g. your custom project filters), you may use their full name (e.g.
"MyCustomIgnore.filter"). There are several methods to add, update or disable filters:
RecheckOptionsBuilder#addIgnore( String ): Will append a filter.
RecheckOptionsBuilder#setIgnore( String ): Will overwrite the filter.
RecheckOptions#ignoreNothing(): Will remove all filters.
recheck offers some properties that can be used for configuration. You can either set these via the
.retest/retest.properties file or using actual system properties. (Note that the latter overwrites the former.)
# If true, reports will be uploaded to rehub. # "true" or "false". de.retest.recheck.rehub.reportUploadEnabled=false # Always ignore these attributes, even if no ignore or filter is active. # Any string, separate values with ";". de.retest.recheck.ignore.attributes=absolute-outline # If set, recheck will use this path as the project root (containing e.g. the .retest folder). # Any valid absolute path. de.retest.recheck.project.root=null # Minimal match threshold between old and new element to safely assume it's actually the same. # Any double in the interval [0.0, 1.0]. de.retest.recheck.elementMatchThreshold=0.3
Note that JUnit and TestNG is supported by default through