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 Sep 23, 2014 · 2 revisions

API changes

We have changed some APIs in order to support new features of Allure 1.4.0. The following sections describe exactly what 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 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.

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

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.

Attachments modifications (Java API)

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).

Incompatible XML format

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.

Allure CLI modifications

  • 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.

Other Improvements

Report Face

  • 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.

TestNG

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

JUnit

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