-
Notifications
You must be signed in to change notification settings - Fork 169
Creating Allure Adapter
This page describes internal details of Allure adapters developments process and is mainly aimed to developers and contributors.
With existing diversity of mainstream programming languages and test frameworks it's very important to follow the same approach when implementing Allure adapters. That's why we're sure that any implementation of Allure adapter for any test framework and any programming language should consist of two main layers:
- Events API. Should contain the implementation of core Allure events and the logic of saving information about risen events to XML. See below for events list.
- Test framework API. Should contain logic which handles events of concrete test framework and maps them to generic Allure events. Right now this approach is used with Java-based test frameworks. We already provide events API in allure-java-commons module and simply use it in such adapters as JUnit and TestNG adapters. This is why adapter modules only contain framework-specific code.
- Every XML file should be named like the following: -testsuite.xml, where is a universally unique identifier.
- Every XML files should be valid when checked with Allure schema.
- Allure adapter output result should store not only XML files with information about tests but also copies of all attached files.
- Every attachment file should be like the following: -attachment., where is file contents cryptographic hash sum (e.g. MD5, SHA1, Whirlpool and so on), - file extension corresponding to the MIME type in XML file. We require cryptographic hash sums in order to avoid storing files with duplicate content.
The implementation of Allure events for Java is located in https://github.com/allure-framework/allure-core/tree/master/allure-java-commons/src/main/java/ru/yandex/qatools/allure/events.
Notifies about parameter passed to test (name and value).
Notifies about new attachment (attachment byte stream, name and MIME type).
Notifies about removed attachments. For example you can remove screenshot taken during the test run when the test passes.
Notify about canceled steps. For example when one step depends on another and it fails we mark the first one as canceled.
Notify about failed steps. That means that one or more of assertions in the step were false.
Notify that step execution was finished. Mainly used to save timestamp.
Notify that step execution was started. Mainly used to save timestamp.
The same as StepCanceledEvent but for test cases.
The same as StepFinishedEvent but for test cases.
Notify about test case explicitly marked as ignored or not implemented. Suitable for tests having no assertions (risky tests).
The same as StepStartedEvent but for test cases.
The same as StepFinishedEvent but for test suites.
The same as StepStartedEvent but for test suites.
- 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.