-
Notifications
You must be signed in to change notification settings - Fork 169
Upgrading to 1.4
We have changed some APIs in order to support new features of Allure 1.4.0. The following sections describe exactly what was changed.
In Allure 1.3.x, all tests which were not executed were marked as skipped. In fact, these skipped tests consist of two different groups: pending and canceled tests.
The first group contains tests that are explicitly ignored and not implemented. In 1.4.0, we call such tests pending because they are pending for execution somewhere in the future when ready. For example, tests with the @Ignore annotation are in this group.
The second group corresponds to tests which were planned to be executed but were not executed for some reason. This can usually happen with dependent tests - when the second test is executed only after the first one is finished. If the first test is broken, the second test never gets executed and can be treated as canceled.
Allure searches for this file on the classpath and uses it to override some standard properties. See AllureConfig class for the list of available properties.
First of all, we deprecated the @Attach annotation and added @Attachment. Starting from 1.4.0, you are expected to use @Attachment.
The second change affects method signatures. Starting from 1.4.0, you can return an array of bytes (byte[]) instead of File or String. Allure will write the provided bytes to the file itself.
Before:
@Attach(name = "Page Screenshot", type = AttachmentType.PNG)
public File makeScreenshot() {
return ((TakesScreenshot) driver).getScreenshotAs(OutputType.FILE);
}
After:
@Attachment(name = "Page screenshot", type = "image/png")
public byte[] makeScreenshot() {
return ((TakesScreenshot) driver).getScreenshotAs(OutputType.BYTES);
}
The attachment type is now optional and should contain the MIME type instead of AttachmentType constants. If you omit it, Allure tries to detect the MIME type using the file signature. We recommend explicitly specifying the MIME type only for plain text files that need a non-"text/plain" MIME type (e.g. application/json).
In 1.4.0 we changed the XML schema definition, so XML generated with a 1.4.0 adapter is incompatible with Allure CLI 1.3.x.
- No need to write generate, just use:
$ allure path/to/xml
- Fixed the issue with the report face not being copied when running on Windows (Allure CLI 1.3.9 was not usable in Windows).
- CLI now ignores invalid XML files.
- Shows the report generation time.
- Shows the total size of attachments and individual sizes.
- New report tab - Overview showing top defects and test statistics.
- Defects are now grouped by title.
Added SPI support to the Allure adapter - no need to explicitly specify the class name in the TestNG configuration.
Added steps support for @Test(timeout=100) annotation.
- aShot - WebDriver Screenshot utility. Take screenshots, crop, prettify, compare.
- HTML Elements - A Java framework that provides easy-to-use interaction with page elements in webpage tests.
- Properties - A Java library for populating beans with system environment properties in a simple and convenient way.
- Perspective - API and shell to orchestrate multiple clouds.