Allure Framework

40 %
60 %
Information about Allure Framework
Technology

Published on March 11, 2014

Author: ArtemEroshenko

Source: slideshare.net

Allure Framework

Artem Eroshenko eroshenkoam@ инженер по автоматизации разработка инструментов

Отчеты автотестов

Хорошие отчеты скорость и точность

Чем дальше от кода тем меньше точность

Юнит тесты

Тесты через API

Web-тесты

Хорошие отчеты необходимые данные содержат

Хорошие отчеты понятны всем

Хорошие отчеты легко читать всем

В Яндексе нет единого универсального отчета

Хабра-подход /company/yandex/blog/200364/

Отчет для функциональных тестов

Allure Framework

Allure Framework Функциональные тесты

Легкость интеграции Allure Framework

Понятность отчета Allure Framework

Allure Framework расширение xUnit

Стандартный xUnit

Стандартный xUnit TestSuite Class

Стандартный xUnit TestSuite Class TestCase Method

Расширение xUnit Аттачменты (Аттачи)

Аттачменты HTML IMAGE JSON XML TXT OTHER

Шаги (Степы) Расширение xUnit

Шаги Вложенность

Шаги Статус завершения Вложенность

Шаги Статус завершения Вложенность Содержат аттачменты

Лейблы Расширение xUnit

Лейблы Способ группировки

Allure Framework = + Стандартный xUnit Шаги Аттачменты Лейблы

Архитектура Allure

Allure Model Allure Adaptor Allure Report Архитектура Allure

Allure Model Test Suite .xml расширение xUnit

<testsuite time=“188”! name=“company.TestMe”! tests=“1” skipped=“0”! errors=“0” failures=“0”>! <testcase! time=“180" name=“testMe”! classname=“company.TestMe” ! />! </testsuite> xUnit Model

Allure Model Test Suite .xml start/stop status test info расширение xUnit severity

<test-suite start="3" stop="25">! <title>Test Suite</title>! <test-cases>!    <test-case start=“5" stop=“23”! status=“passed”! severity="normal">!      <title>Test Case</title>!    </test-case>! </test-cases>! </testsuite> Allure Model

Allure Model steps attachments Test Suite .xml start/stop status severity test info расширение xUnit

<test-case … >! <title>Test Case</title>! <steps>! <step start="3" start="17" ! title=“Open Main Page”/>! </steps>! <attachments>! <attachment title="Image"! source=“image.png“/>! </attachments>! </test-case> Allure Model

<testcase … >! <steps>! <step start="3" start="17" ! title=“Open Main Page”>! <attachments>! <attachment title="Image"! source=“image.png“/>! </attachments>! </step>! </steps>! </testcase> Allure Model

<testcase … >! <steps>! <step start="3" start="17" ! title=“Search by [test]”>! <steps>! <step start="7" start="10"! title=“Type [test]” />! </steps>! </step>! </steps>! </testcase> Allure Model

<testcase … >! <labels>! <label name=“Feature” ! value=“Search”/>! <label name=“Component”! value=“Web Interface”/>! <label name=“Since Version”! value=“1.7.2”/>! </labels>! </testcase> Allure Model

Allure Framework = + Стандартный xUnit Шаги Аттачменты Лейблы

Allure Adaptor jUnit pyUnit Karma Test Suite .xml

Allure Adaptor jUnit pyUnit Karma jUnit Adaptor Test Suite .xml

Allure Adaptor jUnit pyUnit Karma jUnit Adaptor pyUnit Adaptor Test Suite .xml

Allure Adaptor jUnit pyUnit Karma jUnit Adaptor pyUnit Adaptor Karma Adaptor Test Suite .xml

Allure Report Test Suite .xml Test Suite .xml Test Suite .xml

Allure Report Test Suite .xml Test Suite .xml Test Suite .xml Report Data Generator Test Suite .json Test Suite .json Test Suite .json Run Status .json

Allure Report Angular JS + Test Suite .json Test Suite .json Test Suite .json Run Status .json Report Face

Архитектура Allure jUnit jUnit Adaptor Test Suite .xml Data GEN Report

Allure Model Allure Adaptor Allure Report Архитектура Allure

Allure In Action

Allure Lifecycle Allure TestNG Allure jUnit Allure Java Adaptors

Allure Lifecycle Allure.LIFECYCLE.fire(TestSuiteStarted);! Allure.LIFECYCLE.fire(TestCaseStarted);! Allure.LIFECYCLE.fire(StepStarted);! Allure.LIFECYCLE.fire(MakeAttach);! Allure.LIFECYCLE.fire(StepStarted);! Allure.LIFECYCLE.fire(StepFinished);! Allure.LIFECYCLE.fire(StepFinished);! Allure.LIFECYCLE.fire(TestCaseFinished);! Allure.LIFECYCLE.fire(TestSuiteFinished);

Allure jUnit public class AllureRunListener ! extends RunListener{! ! @Override! public void testStarted (…) {! TestSuiteStartedEvent suiteStarted =! new TestSuiteStartedEvent(…);! getLifecycle().fire(suiteStarted);! }! …! } RunListener

public class AllureTestListener ! implements ITestListener{! ! @Override! public void onTestStart (…) {! TestSuiteStartedEvent suiteStarted =! new TestSuiteStartedEvent(…);! getLifecycle().fire(suiteStarted);! }! …! } Allure testNG ITestListener

Allure jUnit Example

Чистый xUnit public void SearchTest {! @Test! public void searchResultsTest() {! …! }! }

Добавляем шаги @Step! public void openMainPage () {! driver.get(“http://yandex.ru”);! }! ! @Step! public void searchBy (String key) {! driver.findElement(id(“text”))! .type(key);! driver.findElement(id(“srch”)).click();! }

Добавляем аттачи @Attach(type=AttachmentType.PNG)! public File makeScreenshot () {! driver.getScreenshotAs(OutputType.File)! }! @Step! public void checkResultHas(String text) {! //получаем текст результатов! //с помощью драйвера, проверяем текст! ! makeScreenShot(); ! }

Пишем тест public void SearchTest {! @Test! public void searchResultsTest() {! openMainPage();! searchBy(“Yandex”);! checkResultsHas(“Yandex”);! }! }

Получаем отчет http://bit.ly/allure-reports

Allure Python Adaptors Allure Lifecycle Allure pyTest

Allure Report Builder Allure Maven Plugin Allure Jenkins Plugin

Демо

Вопросы? https://github.com/allure-framework eroshenkoam@

Add a comment

Related presentations

Related pages

GitHub - allure-framework/allure-core: A flexible ...

allure-core - A flexible lightweight multi-language test report tool with the possibility to add steps, attachments, parameters and so on.
Read more

Allure Framework · GitHub

Allure Test Report Framework. ... allure-core. A flexible lightweight multi-language test report tool with the possibility to add steps, attachments ...
Read more

Allure | Test report and framework for writing self ...

Allure Test Report. There are lots of cool testing frameworks for different programming languages. Unfortunately only few of them can ...
Read more

Introducing Allure in C# project – Ilya Murzinov

And then I discovered Allure Framework - open-source tool which was developed by Yandex test team and it provides really great reports.
Read more

Create WebDriver HTML Reports With The Allure Framework ...

Allure framework can help with generating HTML reports for your Selenium WebDriver projects. The reporting framework is very flexible and it works with ...
Read more

java - Allure Framework: using @Step and @Attachment ...

I am working on a project that uses Allure framework with Java, TestNG and Maven. But I'm unable to generate correct XML files while using Allure @Step and ...
Read more

How to integrate Allure Framework with TestNG Framework ...

Hi, I am new to automation, i have started working on Selenium and TestNG with Java just a month ago. Now there is a new requirement where i have to ...
Read more

java - Allure Framework: TestNG adapter generates ...

I am trying to use Allure with TestNG and Maven using this example. Each time I run this example duplicate copies of xml files are generated. I am using ...
Read more

allure-framework/allure-core - Gitter

Where communities thrive Free for communities Join over 500k people Join over 50k communities Create your own community Explore more communities
Read more