Skip to content
This repository has been archived by the owner on Jan 14, 2019. It is now read-only.

Upgrading to 1.4

Ivan Krutov edited this page Jul 10, 2014 · 2 revisions

API changes

To support new features of Allure 1.4.0 we changed some APIs. The following sections describe what exactly was changed.

Canceled and pending tests

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 explicitly ignored and not implemented tests. 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 @Ignore annotation go to 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 when the first one is finished. If the first test is broken then the second test never gets executed and can be treated as canceled.

Renamed allure.report.properties to allure.properties (Java API)

Allure searches for this file on classpath and uses it to override some standard properties. See AllureConfig class for the list of available properties.

Attachments modifications (Java API)

First of all we deprecated @Attach annotation and added @Attachment. Starting from 1.4.0 you are expected to use @Attachment.

The second change affects method signature. From 1.4.0 you can return an array of bytes (byte[]) instead of File or String. Allure will write 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);
    }

Attachment type became optional and should contain MIME type instead of AttachmentType constants. If you omit it Allure tries to detect MIME type using file signature. We recommend to explicitly specify MIME type only for plain text files which need non-"text/plain" MIME type (e.g. application/json).

Incompatible XML format

In 1.4.0 we changed XML schema definition and thus XML generated with 1.4.0 adapter is incompatible with Allure CLI 1.3.x.

Allure CLI modifications

  • No need to write generate, simply: $ allure path/to/xml
  • Fixed issue with not copied report face when running on Windows (Allure CLI 1.3.9 was not usable in Windows)
  • CLI now ignores invalid XML files

Other Improvements

Report Face

  • Shows report generation time
  • Shows full size of attachments and individual sizes
  • New report tab - Overview showing top defects and test statistics
  • Defects are now grouped by title

TestNG

Added SPI support to Allure adapter - no need to explicitly specify class name in TestNG configuration.

JUnit

Added steps support for @Test(timeout=100) annotation.