All Projects → allure-framework → Allure Pytest

allure-framework / Allure Pytest

Licence: other
Deprecated, please use https://github.com/allure-framework/allure-python instead

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Allure Pytest

Allure Python
Allure integrations for Python test frameworks
Stars: ✭ 387 (+143.4%)
Mutual labels:  reporting, pytest
Sonar Cnes Report
Generates analysis reports from SonarQube web API.
Stars: ✭ 145 (-8.81%)
Mutual labels:  reporting
Python Blueprint
🐍 Example Python project using best practices 🔩
Stars: ✭ 123 (-22.64%)
Mutual labels:  pytest
Ipytest
Pytest in IPython notebooks.
Stars: ✭ 139 (-12.58%)
Mutual labels:  pytest
Extentreports Java
Extent Reporting Library, Java
Stars: ✭ 129 (-18.87%)
Mutual labels:  reporting
Pdf reports
📕 Python library and CSS theme to generate PDF reports from HTML/Pug
Stars: ✭ 142 (-10.69%)
Mutual labels:  reporting
Ara Archive
This repository is an historical archive of https://github.com/dmsimard/ara, please use https://github.com/openstack/ara instead.
Stars: ✭ 121 (-23.9%)
Mutual labels:  reporting
Automationtest
Pytest测试框架,UI, API, DataBase,部分功能已封装,可根据实际需求修改
Stars: ✭ 159 (+0%)
Mutual labels:  pytest
Testbook
🧪 📗 Unit test your Jupyter Notebooks the right way
Stars: ✭ 146 (-8.18%)
Mutual labels:  pytest
Pytest Datadir
pytest plugin for manipulating test data directories and files
Stars: ✭ 135 (-15.09%)
Mutual labels:  pytest
Pytest Check
A pytest plugin that allows multiple failures per test.
Stars: ✭ 131 (-17.61%)
Mutual labels:  pytest
Python Pytest Cases
Separate test code from test cases in pytest.
Stars: ✭ 127 (-20.13%)
Mutual labels:  pytest
Pytest Parallel
A pytest plugin for parallel and concurrent testing
Stars: ✭ 146 (-8.18%)
Mutual labels:  pytest
Jxls
Java library for creating Excel reports using Excel templates
Stars: ✭ 128 (-19.5%)
Mutual labels:  reporting
Xcrash
🔥 xCrash provides the Android app with the ability to capture java crash, native crash and ANR. No root permission or any system permissions are required.
Stars: ✭ 148 (-6.92%)
Mutual labels:  reporting
Kubetest
Kubernetes integration testing in Python via pytest
Stars: ✭ 122 (-23.27%)
Mutual labels:  pytest
Dynamicreports
Java reporting library for creating dynamic report designs at runtime
Stars: ✭ 129 (-18.87%)
Mutual labels:  reporting
Bbr
An open source tool to aid in command line driven generation of bug bounty reports based on user provided templates.
Stars: ✭ 142 (-10.69%)
Mutual labels:  reporting
Expand
DevExpress XAF extension framework. 𝗹𝗶𝗻𝗸𝗲𝗱𝗶𝗻.𝗲𝘅𝗽𝗮𝗻𝗱𝗳𝗿𝗮𝗺𝗲𝘄𝗼𝗿𝗸.𝗰𝗼𝗺, 𝘆𝗼𝘂𝘁𝘂𝗯𝗲.𝗲𝘅𝗽𝗮𝗻𝗱𝗳𝗿𝗮𝗺𝗲𝘄𝗼𝗿𝗸.𝗰𝗼𝗺 and 𝘁𝘄𝗶𝘁𝘁𝗲𝗿 @𝗲𝘅𝗽𝗮𝗻𝗱𝗳𝗿𝗮𝗺𝗲𝘄𝗼𝗿𝗸 and or simply 𝗦𝘁𝗮𝗿/𝘄𝗮𝘁𝗰𝗵 this repository and get notified from 𝗚𝗶𝘁𝗛𝘂𝗯
Stars: ✭ 158 (-0.63%)
Mutual labels:  reporting
Machine Learning With Python
Practice and tutorial-style notebooks covering wide variety of machine learning techniques
Stars: ✭ 2,197 (+1281.76%)
Mutual labels:  pytest

[DEPRICATED]

Please follow https://github.com/allure-framework/allure-python

Allure Pytest Adaptor

.. image:: https://badges.gitter.im/Join%20Chat.svg :alt: Join the chat at https://gitter.im/allure-framework/allure-core :target: https://gitter.im/allure-framework/allure-core?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge

.. image:: https://travis-ci.org/allure-framework/allure-pytest.svg?branch=master :alt: Build Status :target: https://travis-ci.org/allure-framework/allure-pytest/ .. image:: https://pypip.in/v/pytest-allure-adaptor/badge.png :alt: Release Status :target: https://pypi.python.org/pypi/pytest-allure-adaptor .. image:: https://pypip.in/d/pytest-allure-adaptor/badge.png :alt: Downloads :target: https://pypi.python.org/pypi/pytest-allure-adaptor

This repository contains a plugin for py.test which automatically prepares input data used to generate Allure Report. Note: this plugin currently supports only Allure 1.4.x series.

Installation and Usage

.. code:: python

py.test --alluredir [path_to_report_dir]

WARNING [path_to_report_dir] will be purged at first run

This plugin gets automatically connected to py.test via entry point if installed.

Connecting to IDE:

.. code:: python

pytest_plugins = 'allure.pytest_plugin',\

Allure Features

Attachments

To attach some content to test report:

.. code:: python

import allure

def test_foo(): allure.attach('my attach', 'Hello, World')

Steps

To divide a test into steps:

.. code:: python

import pytest

def test_foo(): with pytest.allure.step('step one'): # do stuff

 with pytest.allure.step('step two'):
     # do more stuff

Can also be used as decorators. By default step name is generated from method name:

.. code:: python

import pytest

@pytest.allure.step def make_test_data_foo(): # do stuff

def test_foo(): assert make_some_data_foo() is not None

@pytest.allure.step('make_some_data_foo') def make_some_data_bar(): # do another stuff

def test_bar(): assert make_some_data_bar() is not None

Steps can also be used without pytest. In that case instead of pytest.allure.step simply use allure.step:

.. code:: python

import allure

@allure.step('some operation') def do_operation(): # do stuff

allure.step decorator supports step name formatting with function parameters:

.. code:: python

import allure

@allure.step('some operation for bar={0}') def do_operation(bar): # do stuff

def test_foo(): assert do_operation('abcdef')

The step in the latter case will have name some operation for bar=abcdef. Formatting is done via python's built-in string.format and supports it's options. Arguments are passed to format method in the same way they are passed to the decorated function.

Steps support is limited when used with fixtures.

Severity

Any test, class or module can be marked with different severity:

.. code:: python

import pytest

@pytest.allure.severity(pytest.allure.severity_level.MINOR) def test_minor(): assert False

@pytest.allure.severity(pytest.allure.severity_level.CRITICAL) class TestBar:

 # will have CRITICAL priority
 def test_bar(self):
     pass

 # will have BLOCKER priority via a short-cut decorator
 @pytest.allure.BLOCKER
 def test_bar(self):
     pass

To run tests with concrete priority:

.. code:: rest

py.test my_tests/ --allure_severities=critical,blocker

Issues

Issues can be set for test.

.. code:: python

import pytest

@pytest.allure.issue('http://jira.lan/browse/ISSUE-1') def test_foo(): assert False

import allure

@allure.issue('http://jira.lan/browse/ISSUE-2') class TestBar:

 # test will have ISSUE-2, ISSUE-3 and ISSUE-4 label
 @allure.issue('http://jira.lan/browse/ISSUE-3')
 def test_bar1(self):
     # You can use this feature like a function inside the test
     allure.dynamic_issue('http://jira.lan/browse/ISSUE-4')
     pass

 # test will have only ISSUE-2 label
 def test_bar2(self):
     pass

Test cases

Test cases links can be set for test also.

.. code:: python

import pytest

@pytest.allure.testcase('http://my.tms.org/TESTCASE-1') def test_foo(): assert False

import allure

@allure.testcase('http://my.tms.org/browse/TESTCASE-2') class TestBar:

 # test will have TESTCASE-2 and TESTCASE-3 label
 @allure.testcase('TESTCASE-3')
 def test_bar1(self):
     pass

 # test will have only TESTCASE-2 label
 def test_bar2(self):
     pass

Features & Stories

Feature and Story can be set for test.

.. code:: python

import allure

@allure.feature('Feature1') @allure.story('Story1') def test_minor(): assert False

@allure.feature('Feature2') @allure.story('Story2', 'Story3') @allure.story('Story4') class TestBar:

 # will have 'Feature2 and Story2 and Story3 and Story4'
 def test_bar(self):
     pass

To run tests by Feature or Story:

.. code:: rest

py.test my_tests/ --allure_features=feature1,feature2 py.test my_tests/ --allure_features=feature1,feature2 --allure_stories=story1,story2

Environment Parameters

You can provide test environment parameters such as report name, browser or test server address to allure test report.

.. code:: python

import allure import pytest

def pytest_configure(config): allure.environment(report='Allure report', browser=u'Я.Браузер')

@pytest.fixture(scope="session") def app_host_name(): host_name = "my.host.local" allure.environment(hostname=host_name) return host_name

@pytest.mark.parametrize('country', ('USA', 'Germany', u'Россия', u'Япония')) def test_minor(country): allure.environment(country=country) assert country

More details about allure environment you can know from documentation_.

.. _documentation: https://github.com/allure-framework/allure-core/wiki/Environment

Development

Use allure.common.AllureImpl class to bind your logic to this adapter.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].