Description
Scott provides detailed failure messages for tests written in Java,
without the use of complex assertion libraries to aid developers in rapid development,
troubleshooting and debugging of tests.
It automatically tracks the state of the test to provide the important details for a failing scenario, favoring simple assertions expressed mostly in plain Java over the extensive use of test libraries, such as Hamcrest or AssertJ. (Although it plays nicely with other testing tools and frameworks.)
Scott does not intend to be a testing framework, nor does it provide an API to use in the tests. Instead, it aims to be a small tool that can be dropped into a project to do its job automatically, so you can worry much less about expressing assertions, and still have meaningful failure messages.
Supports Java 7 and above.
Scott Test Reporter alternatives and similar libraries
Based on the "Testing" category.
Alternatively, view scott alternatives based on common mentions on social networks and blogs.
-
Karate
Karate is the only open-source tool to combine API test-automation, mocks, performance-testing and even UI automation into a single, unified framework. -
TestContainers
Provides throwaway instances of common databases, Selenium web browsers, or anything else that can run in a Docker container. -
PowerMock
Enables mocking of static methods, constructors, final classes and methods, private methods and removal of static initializers. -
PIT
Fast mutation-testing framework for evaluating fault-detection abilities of existing JUnit or TestNG test-suites. -
JUnitParams
Creation of readable and maintainable parametrised tests. -
GreenMail
In-memory email server for integration testing. Supports SMTP, POP3 and IMAP including SSL. -
Fixture Factory
Generates fake objects from a template. -
System Rules
A collection of JUnit rules for testing code which uses java.lang.System. -
Mutability Detector
Reports on whether instances of a given class are immutable. -
junit-dataprovider
A TestNG like dataprovider runner for JUnit. -
Arquillian
Integration and functional testing platform for Java EE containers. -
Randomized Testing
JUnit test runner and plugins for running JUnit tests with pseudo-randomness. -
Hoverfly Java
Native bindings for Hoverfly a proxy which allows you to simulate HTTP services. -
beanmother
A library for setting up Java Bean as test data. -
J8Spec
J8Spec is a library that allows tests written in Java to follow the BDD style introduced by RSpec and Jasmine.
Get performance insights in less than 4 minutes.
* Code Quality Rankings and insights are calculated and provided by Lumnify.
They vary from L1 to L5 with "L5" being the highest. Visit our partner's website for more details.
Do you think we are missing an alternative of Scott Test Reporter or a related project?
README
Scott Test Reporter for Maven and Gradle
Get extremely detailed failure messages for your tests without assertion libraries, additional configuration or changes on existing tests.
As you can see, besides the usual assertion error, Scott reports the state changes and assignments in the test cases, nicely visualized on the source code of the test method.
Works well with other testing tools and frameworks, for example:
- JUnit 5
- JUnit 4
- Cucumber Java
- Mockito
Supports Java 7+ (up to Java 13).
How to use
Just drop it into your project, and Scott will automatically enhance your test reports. You don't have to use its API or modify your existing tests to make it work.
Scott: All systems automated and ready. A chimpanzee and two trainees could run her.
Kirk: Thank you, Mr. Scott. I'll try not to take that personally.
Gradle
Add hu.advanceweb.scott-gradle-plugin to your build.gradle:
plugins {
id "hu.advanceweb.scott-gradle-plugin" version "3.6.0"
}
Example projects:
Maven
Add the following to your pom.xml:
<build>
<plugins>
<!-- Add the Scott Plugin. -->
<plugin>
<groupId>hu.advancedweb</groupId>
<artifactId>scott-maven-plugin</artifactId>
<version>3.6.0</version>
<executions>
<execution>
<goals>
<goal>prepare-agent</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
<dependencies>
<!-- Add Scott as a dependency -->
<dependency>
<groupId>hu.advancedweb</groupId>
<artifactId>scott</artifactId>
<version>3.6.0</version>
<scope>test</scope>
</dependency>
</dependencies>
The scott-maven-plugin
automatically configures maven-surefire-plugin
and maven-failsafe-plugin
to use Scott via the argLine
project property. If you wish to further customize the argLine
property for these plugins, you have to pass the managed argLine
as well to ensure Scott works properly. For an example, check the following snippet that configures the surefire plugin to enable preview language features for Java:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<argLine>${argLine} --enable-preview</argLine>
</configuration>
</plugin>
Example projects:
Cucumber
Scott for Cucumber tracks whole scenarios, and in case of a failure it prints the details of every step involved.
This feature provides valuable information if a test fails in a CI environment, as it can make it much easier to reproduce and fix browser-based tests, especially for flaky tests.
Example projects with Cucumber tests:
Wire it up manually
If you can't use the Gradle or Maven Plugin for some reason, you can do the necessary steps manually.
Configuration
In case you are not satisfied with the default tracking behavior, the Scott Maven Plugin and Gradle Plugin provides configuration options to fine-tune its behaviour.
Using Scott as an instrumentation library
Scott's instrumentation module can be invoked programmatically with fine-tuned instrumentation rules so you can build your own solution on top of Scott. For more information, check the user guide.
Changelog
See Releases.
Highlights from the latest releases:
- Java 13 support
- Gradle Plugin
- Maven Plugin
- Scott Cucumber Java now records whole scenarios, supports io.cucumber:cucumber-java and info.cukes:cucumber-java
- Customizable tracking behavior
Contributing
Contributions are welcome! Please make sure to visit the contribution and development guide for some important notes on how to build and debug Scott. If you are looking for issues that can get you started with the development, see Issues marked with the help-wanted tag.
*Note that all licence references and agreements mentioned in the Scott Test Reporter README section above
are relevant to that project's source code only.