Skip to main content
# itester

## 依赖

- xlrd
- nose
- click
- requests

## 介绍

看了不少测试框架 py.test、nose、unittest, 书写case 都需要写代码,所以简单写了一个 Excel 驱动的接口自动化框架。

开发过程中考虑了使用jenkins 调用的情况,输出的日志会有彩色标识


## 更新LOG

- [1.0.5] : 1、更新中文处理方式 2、更新Mac 下-s 参数 3、增加casepath 从环境变量ITESTER_CASE_PATH中获取

## TODO

- Excel 中增加setup SQL/teardown SQL

## 安装

```
pip install itester
```

or

```
make build
make install
```

## 使用

### 查看帮助

```
itester --help
```

```
Usage: itester [OPTIONS]

Excel - driven interface automation framework

Options:
-c, --casepath TEXT case路径,默认当前路径
-m, --mailto TEXT 收件人列表,使用逗号分割
-o, --outputpath TEXT 测试报告输出路径,默认当前路径
-p, --prefix TEXT 邮件内容中的url的前缀, 如不输入发送附件
--help Show this message and exit.
```

### 运行测试

#### itester 运行方式
建议在-o 的路径上增加nginx 的配置,配合使用-p 参数,发送的邮件中变只发一个访问的url

```
itester -c /path/testcase/ -m mail1@mail.com,mail2@mail.com -o /path/report/ -p http://url/auto/report/

or

itester -c /path/testcase/ -m mail1@mail.com,mail2@mail.com -o /path/report/
```

#### nosetests 的运行方式

```
export ITESTER_CASE_PATH="/path/excel_autotest/"; cd /path/itester/itester; nosetests -s -v test_main.py --with-html --html-report=/path/result/test_report.html
```

## 原理

- 从excel中获取case
- 然后分别校验实际返回值和预计返回值的区别

## 模板

在testcase 文件夹中获取,excel中基本都有注释

Metadata

Release files for itester 1.0.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for itester 1.0.5
File Size Uploaded
itester-1.0.5.tar.gz 103.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for itester 1.0.5
File Interpreter ABI Platform
itester-1.0.5-py2-none-any.whl Python 2 none any Details

Total release size: 124.2 kB

Release files / itester-1.0.5.tar.gz

Download URL itester-1.0.5.tar.gz
Size 103.2 kB
Tags Source
SHA-256 checksum
How to use checksums
85104d6b4ade1702df1a210caae06f1b7220f950a02fa6d140c3e02768efb4ba
BLAKE2b-256 checksum
How to use checksums
7706bb74d3d96dc1a74be022446177c3ece03bdad90237bc0ecb8f5905dcb12c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / itester-1.0.5-py2-none-any.whl

Download URL itester-1.0.5-py2-none-any.whl
Size 21.1 kB
Tags Python 2
SHA-256 checksum
How to use checksums
0be59b6513da716292a028b956a7a11017c794f0f4aca3b26ab25f48e304c831
BLAKE2b-256 checksum
How to use checksums
677be6af8742621e95293e627ec41201baec8e77eea848ba4b051732ac3de4aa
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

1.0.5 This release

2 release files

1.0.4

2 release files

1.0.3

2 release files

1.0.2

2 release files

1.0.1

2 release files

1.0.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page