XTestRunner


NameXTestRunner JSON
Version 1.7.7 PyPI version JSON
download
home_pagehttps://github.com/seldomQA/XTestRunner/
SummaryModern style test report based on unittest framework.
upload_time2024-10-09 02:59:57
maintainerNone
docs_urlNone
authorbugmaster
requires_python<4.0,>=3.8
licenseApache-2.0
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            ![](./XTestRunner_logo.jpg)

> Modern style test report based on unittest framework.

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

### 特点

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

## Report

![](./img/test_report_1.7.3.png)

## Install

```shell
> pip install XTestRunner
```

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

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

## demo

查看更多使用 [例子](./tests)。

* unittest测试

```python
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

更多例子,请阅读 [中文文档](./docs/README.md)

## 感谢

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

* [HTMLTestRunner](http://tungwaiyip.info/software/HTMLTestRunner.html)

* [HTMLTestRunner_cn](https://github.com/GoverSky/HTMLTestRunner_cn)

* [Theme style](https://clever-dashboard.webpixels.work/pages/tasks/list-view.html)


            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/seldomQA/XTestRunner/",
    "name": "XTestRunner",
    "maintainer": null,
    "docs_url": null,
    "requires_python": "<4.0,>=3.8",
    "maintainer_email": null,
    "keywords": null,
    "author": "bugmaster",
    "author_email": "fnngj@126.com",
    "download_url": "https://files.pythonhosted.org/packages/95/5e/aa69166d5b644b802629ab54c941df3d38847906d08db10a2acc7ee5c7a2/xtestrunner-1.7.7.tar.gz",
    "platform": null,
    "description": "![](./XTestRunner_logo.jpg)\n\n> Modern style test report based on unittest framework.\n\n\u57fa\u4e8eunittest\u6846\u67b6\u73b0\u4ee3\u98ce\u683c\u6d4b\u8bd5\u62a5\u544a\u3002\n\n### \u7279\u70b9\n\n* \u7b80\u6d01\u3001\u7f8e\u89c2\u5177\u6709\u73b0\u4ee3\u98ce\u683c\u7684\u6d4b\u8bd5\u62a5\u544a\u3002\n* \u652f\u6301`HTML/XML`\u4e0d\u540c\u683c\u5f0f\u3002\n* \u652f\u6301`\u5355\u5143`\u3001`Web UI`\u3001`API`\u5404\u79cd\u7c7b\u578b\u7684\u6d4b\u8bd5\u3002\n* \u96c6\u6210`\u90ae\u4ef6/\u9489\u9489/\u4f01\u5fae/\u98de\u4e66` \u53d1\u9001\u6d88\u606f\u3002\n* \u652f\u6301\u7528\u4f8b`\u9519\u8bef/\u5931\u8d25`\u91cd\u8dd1\u3002\n* \u652f\u6301\u6807\u7b7e\u9ed1\u3001\u767d\u540d\u5355\u3002\n* \u9488\u5bf9`Selenium`\u8fd0\u884c\u5931\u8d25/\u9519\u8bef\u81ea\u52a8\u622a\u56fe\uff08HTML\u683c\u5f0f\uff09\u3002\n* \u652f\u6301\u591a\u8bed\u8a00`en`\u3001`zh-CN`\uff08HTML\u683c\u5f0f\uff09\u3002\n\n## Report\n\n![](./img/test_report_1.7.3.png)\n\n## Install\n\n```shell\n> pip install XTestRunner\n```\n\nIf you want to keep up with the latest version, you can install with github repository url:\n\n```shell\n> pip install -U git+https://github.com/SeldomQA/XTestRunner.git@master\n```\n\n## demo\n\n\u67e5\u770b\u66f4\u591a\u4f7f\u7528 [\u4f8b\u5b50](./tests)\u3002\n\n* unittest\u6d4b\u8bd5\n\n```python\nimport unittest\nfrom XTestRunner import HTMLTestRunner\n\n\nclass TestDemo(unittest.TestCase):\n    \"\"\"\u6d4b\u8bd5\u7528\u4f8b\u8bf4\u660e\"\"\"\n\n    def test_success(self):\n        \"\"\"\u6267\u884c\u6210\u529f\"\"\"\n        self.assertEqual(2 + 3, 5)\n\n    @unittest.skip(\"skip case\")\n    def test_skip(self):\n        \"\"\"\u8df3\u8fc7\u7528\u4f8b\"\"\"\n        pass\n\n    def test_fail(self):\n        \"\"\"\u5931\u8d25\u7528\u4f8b\"\"\"\n        self.assertEqual(5, 6)\n\n    def test_error(self):\n        \"\"\"\u9519\u8bef\u7528\u4f8b\"\"\"\n        self.assertEqual(a, 6)\n\n\nif __name__ == '__main__':\n    suit = unittest.TestSuite()\n    suit.addTests([\n        TestDemo(\"test_success\"),\n        TestDemo(\"test_skip\"),\n        TestDemo(\"test_fail\"),\n        TestDemo(\"test_error\")\n    ])\n\n    with(open('./result.html', 'wb')) as fp:\n        runner = HTMLTestRunner(\n            stream=fp,\n            title='<project name>test report',\n            description='describe: ... ',\n            language='en',\n            rerun=3\n        )\n        runner.run(suit)\n```\n\n## Document\n\n\u66f4\u591a\u4f8b\u5b50\uff0c\u8bf7\u9605\u8bfb [\u4e2d\u6587\u6587\u6863](./docs/README.md)\n\n## \u611f\u8c22\n\n\u611f\u8c22\u4ece\u4ee5\u4e0b\u9879\u76ee\u4e2d\u5f97\u5230\u601d\u8def\u548c\u5e2e\u52a9\u3002\n\n* [HTMLTestRunner](http://tungwaiyip.info/software/HTMLTestRunner.html)\n\n* [HTMLTestRunner_cn](https://github.com/GoverSky/HTMLTestRunner_cn)\n\n* [Theme style](https://clever-dashboard.webpixels.work/pages/tasks/list-view.html)\n\n",
    "bugtrack_url": null,
    "license": "Apache-2.0",
    "summary": "Modern style test report based on unittest framework.",
    "version": "1.7.7",
    "project_urls": {
        "Homepage": "https://github.com/seldomQA/XTestRunner/",
        "Repository": "https://github.com/seldomQA/XTestRunner/"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "e89f9ed7296eb45f26fa68d68d2d3732a95bd7095a938d68d8524aa39dcd644d",
                "md5": "9f91c21652b768cd6b71012f122f4545",
                "sha256": "93a54a334fa9b1af65b9474273682bc9fe0b6eb9dc19946e8c2f231cd6c7a82e"
            },
            "downloads": -1,
            "filename": "xtestrunner-1.7.7-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "9f91c21652b768cd6b71012f122f4545",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<4.0,>=3.8",
            "size": 43780,
            "upload_time": "2024-10-09T02:59:55",
            "upload_time_iso_8601": "2024-10-09T02:59:55.713090Z",
            "url": "https://files.pythonhosted.org/packages/e8/9f/9ed7296eb45f26fa68d68d2d3732a95bd7095a938d68d8524aa39dcd644d/xtestrunner-1.7.7-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "955eaa69166d5b644b802629ab54c941df3d38847906d08db10a2acc7ee5c7a2",
                "md5": "be952b548f0b5eb7fc18aa5e1d4cdcb7",
                "sha256": "8381e6e737b6dfd02983ac287648b8a3d353dddbcaf7fb75aee98e64c75404a7"
            },
            "downloads": -1,
            "filename": "xtestrunner-1.7.7.tar.gz",
            "has_sig": false,
            "md5_digest": "be952b548f0b5eb7fc18aa5e1d4cdcb7",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<4.0,>=3.8",
            "size": 35432,
            "upload_time": "2024-10-09T02:59:57",
            "upload_time_iso_8601": "2024-10-09T02:59:57.541017Z",
            "url": "https://files.pythonhosted.org/packages/95/5e/aa69166d5b644b802629ab54c941df3d38847906d08db10a2acc7ee5c7a2/xtestrunner-1.7.7.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-10-09 02:59:57",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "seldomQA",
    "github_project": "XTestRunner",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "xtestrunner"
}
        
Elapsed time: 0.88393s