Releases: TNG/JGiven
v0.8.2
New Features
- Introduced the annotation
@DoNotIntercept
, to completely circumvent the JGiven interception mechanism of step methods. #103 - Introduced new feature to directly show image attachment in the HTML report. This is done by calling
showDirectly()
on theAttachment
object. #117 - Introduced the possibility to automatically number the rows or columns of a table parameter. #116
- HTML Report: introduce pagination to better deal with large lists of scenarios. #120
Fixed Issues
- HTML Report: fixed an issue that caused the scenario list to only shows the first 20 entries #119
v0.8.1
New Features
- Parameters of test methods can now also be formatted with formatters like step parameters. This is only relevant, however, when you have scenarios with multiple cases that do not generate a data table, but multiple cases #114
Fixed Issues
- Fixed the issue that test classes had to be compiled with the -parameters option of javac when using Java 8. This was fixed by upgrading to the newest version of the Paranamer library that now fully supports Java 8 #106
- Fixed an issue where different formatted parameters having the same value in all cases were collapsed to a single parameter #104
- Fixed issue introduced with v0.8.0 that tag descriptions that differ depending on a tag value are not correctly reported
- Fixed an issue that the dataprovider with TestNG could not be used in parallel mode #105
- Fixed an issue that when using TestNG only a report for one test class was generated #115
v0.8.0
New Features
Hierarchical Tags #99
Tags can now have parent tags by tagging a tag annotation. This allows you to define tag hierarchies.
Example
The following example tags the FeatureHtml5Report
annotation with the FeatureReport
annotation:
@FeatureReport
@IsTag( name = "HTML5 Report" )
@Retention( RetentionPolicy.RUNTIME )
public @interface FeatureHtml5Report { }
Enhanced Spring Support #94
- The Spring support has been greatly improved. JGiven Stages can now be directly managed by the Spring framework, resulting in a much better Spring integration.
- Note that the usage of Spring is optional and is provided by the
jgiven-spring
module.
- Note that the usage of Spring is optional and is provided by the
- Introduced
@JGivenStage
to ease writing spring beans that act as JGiven stage - Thanks to TripleNail for providing this enhancement!
New features in the HTML5 Report
- Classes are shown now in hierarchical navigation tree and scenarios can be listed by package #91
- Durations are now shown in appropriate units instead of only showing them in seconds #92
- The navigation bar can now be hidden and resized #96
- Failed scenarios are now colored in red, pending scenarios are greyed out
- In the Summary section, the number of scenarios for each status are shown
New style
attribute for the @IsTag
annotation
- The new
style
attribute allows you to define arbitrary inline styles for tags that will be applied to the tag in the HTML5 report
JUnit: New StandaloneScenarioRule
- With this rule it is now easier to use JGiven without inheriting from
ScenarioTest
. Just put this rule as a@Rule
and theScenarioReportRule
as a@ClassRule
into your test class and you can use JGiven by injecting stages with@ScenarioStage
.
Removed Features
Removed the old static HTML report generator #101
- As the HTML5 report supports all the features of the static HTML report, the static HTML report has been completely removed to avoid duplicate efforts when implementing new features.
Fixed Issues
- HTML5 Report: fixed issue with duplicate entries in tables when used as step parameters #89
- HTML5 Report: fixed navigation and added searching in the mobile version
- HTML5 Report: fixed slow scrolling in case of large lists of scenarios
- Fixed an issue that the
@Description
annotation was not regarded for methods with the@IntroWord
#87 - TestNG: fixed missing support for injection of stages into the test class using the
@ScenarioStage
annotation - TestNG: fixed missing support for
@ScenarioState
annotation in test classes - Removed unneeded ICU dependency
New Annotations
- Introduced the
@As
annotation that replaces the@Description
annotation when used on step methods and test methods. The@Description
annotation should only be used for descriptions of test classes. - Added
@Pending
annotation to replace the@NotImplementedYet
annotation. #100
Backwards incompatible JSON Model Changes
- The field
notImplementedYet
of theScenarioModel
was renamed topending
- The
StepStatus
NOT_IMPLEMENTED_YET
was renamed toPENDING
.
Note: in general, backwards incompatible model changes should be no problem, as long as you use the same version for all JGiven modules (core, html5-report, maven-plugin).
v0.7.3
Fixed Issues
- Fixed major issue with Java 8 that prevented the usage of lambda expressions inside Stage classes #85.
- Note that due to this fix you have to compile your test classes with the
-parameters
flag of javac if you are using Java 8.
- Note that due to this fix you have to compile your test classes with the
- Fixed an issue in the HTML5 report which shows only attachments of the first case when having a parameterized scenario with multiple cases #77
Changed Behavior
Intro words are not necessary anymore #74
The following example is now a valid JGiven scenario, i.e. intro words are not required anymore:
given().frozen_strawberries()
.a_banana()
.milk();
when().mixing_everything_in_a_mixer();
then().you_get_a_delicious_smoothie();
The report will then look as follows:
Given frozen_strawberries
a banana
milk
When mixing everything in a mixer
Then you get a delicious smoothie
In previous versions of JGiven you would have to add an and()
before a_banana()
and milk()
New Features
- The HTML5 report now supports grouping, sorting, and filtering of result lists PR #81
v0.7.2
v0.7.1
New Features
- Introduce
columnTitles
attribute for the@Table
annotation #64 - Ignore
null
values of POJOs by default when using the@Table
annotation. This behavior can be overridden with theincludeNullColumns
attribute. - Allow $ to be escaped in step descriptions when using the
@Description
tag #19 - Speed-up the overall performance of JGiven by caching reflection-based look-ups
v0.7.0
New Features
- Support for attachments on steps (Pull Request #56)
- Descriptions for tags can be dynamically created (Issue #55)
- Custom annotations can now be used to format arguments when they are annotated with the
@Format
annotation - Introduced a new
@Quoted
annotation to surround arguments with double quotes (" ") in reports
Changed Behavior
- String arguments are no longer put into single quotes (' ') when printed to the console
Fixed Issues
- Methods annotated with
@Hidden
see now injected values from the previous stage if they are the first method called on a stage - Fixes issue with IntelliJ JUnit runner that stays yellow when executing JGiven tests (Issue #58)
v0.6.2
New Features
Data tables as parameters
- Step parameters can now be annotated with
@Table
. - Such parameters are stored as a table instead of a plain string in the report model.
- Reporters present these parameters as data tables instead of plain strings.
- The type of these parameters can be
- A list of list (actually all types implementing Iterable are supported)
- A two-dimensional array
- A list or array of POJOs. In this case each POJO represents a single row and the fields of the POJOs are taken as columns
Example
POJO
class CoffeeWithPrice {
String name;
double price_in_EUR;
CoffeeWithPrice(String name, double priceInEur) {
this.name = name;
this.price_in_EUR = priceInEur;
}
}
The Step Method
public SELF the_prices_of_the_coffees_are( @Table CoffeeWithPrice... prices ) {
...
}
Invocation of the step method
given().the_prices_of_the_coffees_are(
new CoffeeWithPrice("Espresso", 2.0),
new CoffeeWithPrice("Cappuccino", 2.5));
Text Report
Given the prices of the coffees are
| name | price in EUR |
+------------+--------------+
| Espresso | 2.0 |
| Cappuccino | 2.5 |
Without POJO
The same effect can be achieved without a POJO by using a two-dimensional array or a list of list.
given().the_prices_of_the_coffees_are( new Object[][] {
{ "name", "price in EUR" },
{ "Espresso", 2.0 },
{ "Cappuccino", 2.5}});
Bookmarks in the HTML5 Report
The HTML5 report now allows you to make bookmarks of arbitrary pages. The bookmarks are stored in the local storage of the browser.
v0.6.1
New Features
@Hidden
annotation can be applied to step parameters
Step parameters can now be hidden in the report if they are annotated with the @Hidden
annotation.
Bug Fixes
- Core: Exceptions that are thrown after a scenario has been executed, e.g., in
@After
-annotated methods in JUnit, are not hiding the original exception thrown in the scenario (#49). - HTML5 Report: Split the JSON model into multiple files to avoid
script too large
errors in Firefox (#51) - HTML5 Report: Fixed issue with the encoding of tag URLs (#47)
v0.6.0
Major New Features
HTML5 Report
There is a new HTML5 report that is completely written from scratch. Instead of mutliple static HTML pages it only consists of a single HTML page that dynamically loads its content from a single jsonp file that contains the model of the scenario report. As a result the overall size of the generated files is much smaller. In addition, the new report is based on Foundation, which is a modern CSS framework, so the new report also looks much nicer then the old static one. One of the main new features is also that the HTML5 report has a full text search built in that works without having to open all scenarios in a single HTML page. As it heavily relies on JavaScript, don't expect that it works on old Browsers.
See the HTML5 Report of JGiven for an example.
Bug Fixes
- Core: An issue has been fixed where methods annotated with
@AfterStage
and@AfterScenario
could accidentally appear in the report when they have been overriden and not annotated again. - Core: An issue has been fixed where methods annotated with
@AfterStage
and@AfterScenario
have not been executed when an exception has been thrown (#46)
Breaking Changes
Non-public step methods appear in the report now
So far JGiven only reported public step methods. This behavior can lead to confusion, because it is not obvious that methods that are actually executed do not appear in the report. For this reason this behavior has been changed so that the visibility modifier is not taken into account anymore when reporting step methods.
How to migrate
If you have relied on the fact that non-public methods actually do not appear in the report, you can easily port your existing code by adding the @Hidden
annotation to the corresponding method to explicitly state that the method should be hidden in the report.
Removed deprecated Schritte
class (only used for German scenarios)
Use Stufe
class instead
Removed @CasesAsTable
annotation
As data tables are the default this annotation had no effect anymore, you can safely delete all usages.
Removed @ScenarioDescription
annotation
The annotation is now just called @Description
.