• Stars
    star
    135
  • Rank 269,297 (Top 6 %)
  • Language
    Java
  • License
    MIT License
  • Created over 9 years ago
  • Updated about 3 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Never debug a test again: Detailed failure reports and hassle free assertions for Java tests - Power Asserts for Java

License Maven Central Build Status Quality Gate Status

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.

Scott in Action

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:

Supports Java 7+ (up to Java 17).

How to use

Just drop it into your project, and Scott will automatically enhance your test reports. You don't have to use any special APIs 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 "4.0.1"
}

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>4.0.1</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>4.0.1</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.

HTML

Example project:

Wire it up manually

If you can't use the Gradle or Maven Plugin for some reason, you can do the necessary integration 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, and for an actual example, see GhostWriter.

Changelog

See Releases.

Highlights from the latest releases:

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.

More Repositories

1

vim-disapprove-deep-indentation

ಠ_ಠ Vim plugin to disapprove deeply indented code. ಠ_ಠ
Vim Script
558
star
2

vim-fibo-indent

Fibonacci Indentation for Vim.
Vim Script
272
star
3

testing-in-bash

Bash test framework comparison
Shell
100
star
4

tracing-paper-sketching

Android App to copy images from the screen to physical paper.
JavaScript
15
star
5

time-admin

A simple web application for time tracking.
Scala
10
star
6

jvm-dynamic-optimizations-performance-test

Performance tests to demonstrate some of the profile-based (optimistic, speculative) optimizations performed by the JVM.
Java
7
star
7

bash-preprocessor

Bash Macros: replace snippets in a script file with their output
Shell
4
star
8

cucumber-gifreporter-experiment

Experiment to embed animated GIFs to Cucumber test reports.
Java
4
star
9

srtm-map-renderer

Java application to render SRTM data
Java
3
star
10

java-helpful-npe-demo

Java 14 Helpful NullPointerExceptions Demo
Java
2
star
11

unreal-engine-stealthgame-tutorial

A very simple single/multiplayer FPS game
C++
2
star
12

working-with-structured-data-in-java

Examples for updating, merging and comparing hierarchical data in Java, using Maps, POJOs and JsonStructures with Jackson, Apache Commons Lang, JSON-P and Guava.
Java
2
star
13

unreal-coop-shooter-game

C++
1
star
14

unreal-bullcowgame-tutorial

Word guessing terminal game in Unreal Engine 4
C++
1
star
15

AJAX-activity-indicator

This script adds onOpenGlobal and onDoneGlobal functions and numberOfOpenCalls property to XMLHttpRequest.
JavaScript
1
star
16

cucumber-attached-tests-example

Java
1
star
17

java-tutorials

Java Tutorials and Examples
Java
1
star
18

bash-jq-tutorial

Showcasing bash with jq by creating statistics based on the contents a dummy blog engine
TSQL
1
star