Releases: giulong/spectrum
Version 1.21.x
Datafaker
As requested in feature #313, an instance of datafaker is now available in all tests and pages. You can use it to generate fake data like this:
@Test
void test() {
String name = faker.name().fullName(); // Miss Samanta Schmidt
String number = faker.numerify("##");
String anotherNumber = faker.expression("#{numerify '##'}");
...
}
Check all the details on how to configure it in the docs.
Version 1.20.x
Highlight WebElements
It's now possible to highlight the web elements your test interacts with. This might be helpful to visually debug the execution. You just need to configure this:
application:
highlight: { }
and a 3px red border will be applied to web elements targeted by the test, as the username input field in this screenshot:
The highlight is fully customisable. Check the docs for all the details.
Version 1.19.x
New Configuration Keys
The following configuration keys were added.
Keep the driver open at the end of execution
By default, the driver is closed at the end of execution. To leave it open, just add this (docs):
drivers:
keepOpen: true
Break tests on events consumers' errors
By default, exceptions in events consumers (such as those to send notifications) do not make the tests fail. If you'd like to change this behaviour, set failOnError
to true
in the corresponding consumer(s) (docs):
eventsConsumers:
- mail:
failOnError: true
Slack notification text
It's now possible to customise the text of the Slack notification (docs):
eventsConsumers:
- slack:
text: Notification text
Version 1.18.x
Artifacts Retention Policy by Date
It's now possible to specify a number of days after which reports are automatically deleted:
retention:
days: 3
By applying the above retention configuration, reports older than 3 days will be deleted. The retention
node applies to extent reports and others, such as summary and testbook, for instance:
extent:
retention:
days: 3
testBook:
reporters:
- html:
retention:
days: 2
- txt:
retention:
days: 10
Check the full docs to see all the details, such as how to combine days
retention with successful
and total
.
Version 1.17.x
Test Steps Report
Introducing a new kind of report that displays just the events fired from the web driver for each test:
Time | Time taken | Message
----------------------------------------------------------------------------------------------------
2024-11-30T21:53:00.516414 | 0.400s | About to get https://the-internet.herokuapp.com/
2024-11-30T21:53:02.849405 | 2.332s | Text of tag name: h1 is 'Welcome to the-internet'
2024-11-30T21:53:02.870003 | 0.200s | Clicking on link text: Checkboxes
2024-11-30T21:53:03.053361 | 0.183s | Element css selector: #checkboxes -> tag name: input is selected? false
2024-11-30T21:53:03.067100 | 0.130s | Element css selector: #checkboxes -> tag name: input is selected? true
2024-11-30T21:53:03.067445 | 0.000s | Clicking on css selector: #checkboxes -> tag name: input
2024-11-30T21:53:03.291913 | 0.224s | Element css selector: #checkboxes -> tag name: input is selected? true
It is fully customisable, you can write your own template in a different format as well, such as html. Check how to configure it in the docs section.
Version 1.16.x
Hide Sensitive Data in Reports and Logs
You can now annotate sensitive WebElements with the @Secured
annotation like this:
import io.github.giulong.spectrum.interfaces.Secured;
@FindBy(id = "password")
@Secured
private WebElement password;
This will ensure no password will be logged in plain text nor it will be added to the reports.
More on this in the Secured WebElements docs
Version 1.15.x
Sort tests in Extent Report
You can now specify the order in which tests are shown in the produced html report, for example by their name:
extent:
sort:
name: { }
Be sure to check the Tests Order docs section for the details about available sorting methods.
Version 1.14.x
Extent Reports enhancements
- JUnit's tags are now shown in the corresponding test reported in the html report.
- Javascript support: you can now provide a custom script to be applied to the html report, using the
extent.js
key in yourconfiguration.yaml
. Mind its value is resolved as a path relative to the resources folder. By default it'sjs/report.js
. - You can now provide a path for your custom css to be applied to the html report, using the
extent.css
key in yourconfiguration.yaml
. Mind its value is resolved as a path relative to the resources folder. By default it'scss/report.css
.
Be sure to always check the internal configuration.default.yaml for all the available keys. Leveraging the Json Schema comes in handy for this!
No profile active by default
The local
profile is not loaded by default anymore. If you use it, which means you have a configuration-local.yaml
and/or a data-local.yaml
, you now have to provide the local
profile explicitly. Check the Configuration docs for details on how to do it.
Version 1.13.x
Automatically open generated reports
You can now provide the openAtEnd
flag in those reporters that produce a file at the end of the execution. By setting it to true
, the corresponding report will be automatically opened once ready. Check these sections in the docs: Html Report, Summary Reporters, and TestBook Reporters.
Dropped data.fqdn
key
The Data class you provide as a generic in your SpectrumTest
s and/or SpectrumPage
s is now loaded at runtime automatically. This means if you used data, you now have to delete the fqdn
key from your configuration*.yaml
files.
Added video.skipDuplicateFrames
key
By default, Spectrum discards consecutive duplicate frames when generating the video of the execution. You can now disable this behaviour by explicitly setting video.skipDuplicateFrames
to false
. Check the Automatic Execution Video Generation section for details.
Version 1.12.x
Dynamic tests html report support
Though JUnit's dynamic tests execution was already supported, the html report generation wasn't. Dynamic tests are now shown as nested collapsible blocks, as you can see in the screenshot below. Please refer to the full docs for details.