Skip to main content

Modern style test report based on unittest framework.

Project description

Modern style test report based on unittest framework.

基于unittest框架现代风格测试报告。

特点

  • 简洁、美观具有现代风格的测试报告。
  • 支持HTML/XML不同格式。
  • 支持单元Web UIAPI各种类型的测试。
  • 集成邮件/钉钉/企微/飞书 发送消息。
  • 支持用例错误/失败重跑。
  • 支持标签黑、白名单。
  • 针对Selenium运行失败/错误自动截图(HTML格式)。
  • 支持多语言enzh-CN(HTML格式)。

Report

Install

> pip install XTestRunner

If you want to keep up with the latest version, you can install with github repository url:

> pip install -U git+https://github.com/SeldomQA/XTestRunner.git@master

demo

查看更多使用 例子

  • unittest测试
import unittest
from XTestRunner import HTMLTestRunner


class TestDemo(unittest.TestCase):
    """测试用例说明"""

    def test_success(self):
        """执行成功"""
        self.assertEqual(2 + 3, 5)

    @unittest.skip("skip case")
    def test_skip(self):
        """跳过用例"""
        pass

    def test_fail(self):
        """失败用例"""
        self.assertEqual(5, 6)

    def test_error(self):
        """错误用例"""
        self.assertEqual(a, 6)


if __name__ == '__main__':
    suit = unittest.TestSuite()
    suit.addTests([
        TestDemo("test_success"),
        TestDemo("test_skip"),
        TestDemo("test_fail"),
        TestDemo("test_error")
    ])

    with(open('./result.html', 'wb')) as fp:
        runner = HTMLTestRunner(
            stream=fp,
            title='<project name>test report',
            description='describe: ... ',
            language='en',
            rerun=3
        )
        runner.run(suit)

Document

更多例子,请阅读 中文文档

感谢

感谢从以下项目中得到思路和帮助。

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

xtestrunner-1.7.7.tar.gz (35.4 kB view details)

Uploaded Source

Built Distribution

xtestrunner-1.7.7-py3-none-any.whl (43.8 kB view details)

Uploaded Python 3

File details

Details for the file xtestrunner-1.7.7.tar.gz.

File metadata

  • Download URL: xtestrunner-1.7.7.tar.gz
  • Upload date:
  • Size: 35.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.11.9

File hashes

Hashes for xtestrunner-1.7.7.tar.gz
Algorithm Hash digest
SHA256 8381e6e737b6dfd02983ac287648b8a3d353dddbcaf7fb75aee98e64c75404a7
MD5 be952b548f0b5eb7fc18aa5e1d4cdcb7
BLAKE2b-256 955eaa69166d5b644b802629ab54c941df3d38847906d08db10a2acc7ee5c7a2

See more details on using hashes here.

File details

Details for the file xtestrunner-1.7.7-py3-none-any.whl.

File metadata

  • Download URL: xtestrunner-1.7.7-py3-none-any.whl
  • Upload date:
  • Size: 43.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.11.9

File hashes

Hashes for xtestrunner-1.7.7-py3-none-any.whl
Algorithm Hash digest
SHA256 93a54a334fa9b1af65b9474273682bc9fe0b6eb9dc19946e8c2f231cd6c7a82e
MD5 9f91c21652b768cd6b71012f122f4545
BLAKE2b-256 e89f9ed7296eb45f26fa68d68d2d3732a95bd7095a938d68d8524aa39dcd644d

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page