[Open Source] A full-featured testing framework based on unittest, supporting Web/APP/API testing

Open SourceProcess Management
2026-06-28 06:04 1 次浏览 • 0 次下载 0KB
[Open Source] A full-featured testing framework based on unittest, supporting Web/APP/API testing

1. Project Overview

Image

Seldom is an automation testing framework based on unittest.

seldom is an automated testing framework based on unittest.

A full-featured testing framework based on unittest, supporting Web/App/API testing.

2. Open Source License

Licensed under Apache-2.0

3. Screenshots

View Reports

You can find the test reports in the mypro\reports\ directory.

Image

4. Feature Overview

Features

⭐ Full-featured Web/App/API testing framework

⭐ Provides a scaffolding tool for quickly creating automation projects

⭐ Integrates XTestRunner for modern, visually appealing test reports

⭐ Provides a rich set of assertions

⭐ Provides powerful data-driven testing

⭐ Supports platform-based integration

5. Tech Stack

Install

pip install seldom

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

> pip install -U git+seldom
> pip install -U git+seldom

 Quick Start

1. View help:

seldom --help
Usage: seldom [OPTIONS]
  seldom CLI.
Options:
  --version                       Show version.
  --project-api TEXT              Create an API automation test project.
  --project-app TEXT              Create an App automation test project.
  --project-web TEXT              Create an Web automation test project.
  -cc, --clear-cache BOOLEAN      Clear all caches of seldom.
  -p, --path TEXT                 Run test case file path.
  -c, --collect / -nc, --no-collect
                                  Collect project test cases. Need the
                                  `--path`.
  -l, --level [data|method]       Parse the level of use cases. Need the
                                  --path.
  -j, --case-json TEXT            Test case files. Need the `--path`.
  -e, --env TEXT                  Set the Seldom run environment `Seldom.env`.
  -b, --browser [chrome|firefox|ie|edge|safari]
                                  The browser that runs the Web UI automation
                                  tests. Need the `--path`.
  -u, --base-url TEXT             The base-url that runs the HTTP automation
                                  tests. Need the `--path`.
  -d, --debug / -nd, --no-debug   Debug mode. Need the `--path`.
  -rr, --rerun INTEGER            The number of times a use case failed to run
                                  again. Need the `--path`.
  -r, --report TEXT               Set the test report for output. Need the
                                  `--path`.
  -m, --mod TEXT                  Run tests modules, classes or even
                                  individual test methods from the command
                                  line.
  -ll, --log-level [TRACE|DEBUG|INFO|SUCCESS|WARNING|ERROR]
                                  Set the log level.
  -h2c, --har2case TEXT           HAR file converts an seldom test case.
  -s2c, --swagger2case TEXT       Swagger file converts an seldom test case.
  --api-excel TEXT                Run the api test cases in the excel file.
  --help                          Show this message and exit.

 

2. Create a project:

> seldom --project-api myapi  # API automation test project.
> seldom --project-app myapp  # or App automation test project.
> seldom --project-web myweb  # or Web automation test project.

 

The directory structure is as follows:

myweb/
├── test_dir/
│   ├── __init__.py
│   └── test_sample.py
├── test_data/
│   └── data.json
├── reports/
└── confrun.py
  • test_dir/ Test case directory.
  • test_data/ Test data files directory.
  • reports/ Test report directory.
  • confrun.py Execution configuration file.

3. Run the project:

  • ❌️ Execute by right-clicking in PyCharm.
  • ✔️ Execute using the command-line tool.
> seldom-ptest_dir# Run the test_dir test directory


              \__    __
   __________//___//_____________
/___/_\\//__/__\\/___`___/
(__)__///_///_///////
/____/\\___/_/\\_,_/\\____/_//_//_/v3.x.x
-----------------------------------------
                             @itest.info
...

2022-04-3018:37:36log.py|INFO|✅Find 1 element:id=sb_form_q->input'seldom'.
2022-04-3018:37:39log.py|INFO|assertIn title:seldom-Search.
.52022-04-3018:37:39log.py|INFO|[https://cn.bing.com
2022-04-3018:37:41log.py|INFO|✅Find](https://cn.bing.com
2022-04-3018:37:41log.py|INFO|✅Find) 1 element:id=sb_form_q->input'poium'.
2022-04-3018:37:42log.py|INFO|assertIn title:poium-Search.
.62022-04-3018:37:42log.py|INFO|[https://cn.bing.com
2022-04-3018:37:43log.py|INFO|✅Find](https://cn.bing.com
2022-04-3018:37:43log.py|INFO|✅Find) 1 element:id=sb_form_q->input'XTestRunner'.
2022-04-3018:37:44log.py|INFO|assertIn title:XTestRunner-Search.
.72022-04-3018:37:44log.py|INFO|[http://www.itest.info
2022-04-3018:37:52log.py|INFO|assertIn](http://www.itest.info
2022-04-3018:37:52log.py|INFO|assertIn) url:[http://www.itest.info/.
.82022-04-3018:37:52log.py|SUCCESS|generated](http://www.itest.info/.
.82022-04-3018:37:52log.py|SUCCESS|generated) html file:file:///D:\mypro\reports\2022_04_30_18_37_29_result.html
2022-04-3018:37:52log.py|SUCCESS|generated log file:file:///D:\mypro\reports\seldom_log.log
#1
资源直链https://gitee.com/fnngj/seldom
去下载
星河码客

发现和分享优质开源项目,传承互联网精神,为开发者服务。

关于本站

联系我们

微信/广告合作:ITcloub (备注星河码客)

免责声明:本站资源版权归原作者所有,仅供学习与交流。如有侵权,请通过「关于我们 - 侵权投诉」联系删除。

Powered by Nuxt · Deployed on Cloudflare