# testobject-python-api
[![Build Status](https://travis-ci.org/enriquegh/testobject-python-api.svg?branch=master)](https://travis-ci.org/enriquegh/testobject-python-api) [![Build status](https://ci.appveyor.com/api/projects/status/6pd46pbwrggq7rwa/branch/master?svg=true)](https://ci.appveyor.com/project/enriquegh/testobject-python-api/branch/master) [![codecov](https://codecov.io/gh/enriquegh/testobject-python-api/branch/master/graph/badge.svg)](https://codecov.io/gh/enriquegh/testobject-python-api) [![PyPI version](https://badge.fury.io/py/testobject.svg)](https://badge.fury.io/py/testobject)
A Python library client for TestObject API
For more on the API you can visit TestObject's docs [here](https://api.testobject.com/).
## Getting Started
### Installing
To install on your machine run:
```bash
pip install testobject
```
Once installed you can run something like:
```python
import testobject
client = testobject.TestObject('myusername','my_api_key', password='password')
# Password only needed if using Session Reports
response = client.devices.get_devices()
devices = response.json()
us_devices = devices['US']
```
## Running the tests
Tests are done with pytest.
To run these simply run:
```bash
pytest
```
## Docs
### Get All Devices
```python
response = client.devices.get_devices()
devices = response.json()
us_devices = devices['US']
```
### Get Available Devices
```python
response = client.devices.get_available_devices()
devices = response.json()
us_devices = devices['US']
```
### Get Device
```python
response = client.devices.get_device('iPhone_5_free')
device = response.json()
```
### Get Session Reports
```python
response = client.devices.get_session_reports(last_days=30, offset=1, limit=50)
reports = response.json()
```
### Update Appium Suite
```python
data = {}
data['title'] = "New Suite Title"
response = client.suites.update_suite(suite_number,data)
content = response.json()
```
### Start Appium Suite Report
```python
report = {'className': 'TOTestClass', 'dataCenterId': 'US', 'methodName': 'testMethod', 'deviceId': 'iPhone_5_free'}
data = [report] # If more than one test and/or class add more reports to the data list
response = to.suites.start_suite(suite_number, data)
content = response.json()
```
### Stop Appium Suite Report
```python
response = to.suites.stop_suite(suite_number, suite_report_number)
content = response.json()
```
### Stop Appium Suite Test
```python
response = to.suites.stop_suite_test(suite_number, suite_report_number, suite_test_number, True)
content = response.json()
```
### Skip Appium Suite Test
```python
response = to.suites.stop_suite_test(suite_number, suite_report_number, suite_test_number)
content = response.json()
```
### Skip Appium Test Report
```python
response = to.watcher.skip_test_report(appium_session_id)
```
### Send Appium Test Report
```python
response = to.watcher.report_test_result(appium_session_id,True)
```
### Upload Application to Project
```python
response = to.storage.upload_app(upload_app_path, display_name, False)
```
### Get Test Report
```python
response = to.reports.get_test_report(test_report_id)
```
### Get Screenshot
```python
response = to.reports.get_screenshot(test_report_id, screenshot_id)
```
### Get Session Video
```python
response = to.reports.get_video(video_id)
```
### Get Appium Log
```python
response = to.reports.get_appium_log(test_report_id)
```
### Get Device Log
```python
response = to.reports.get_device_log(test_report_id)
```
### Get Device Vitals Log
```python
response = to.reports.get_vitals_log(test_report_id)
```
### Get XCUITest Log
```python
response = to.reports.get_xcuitest_log(test_report_id)
```
## Authors
* **Enrique Gonzalez** - *Maintainer* - [enriquegh](https://github.com/enriquegh)
## License
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details
没有合适的资源?快使用搜索试试~ 我知道了~
温馨提示
共17个文件
py:8个
txt:4个
pkg-info:2个
资源分类:Python库 所属语言:Python 资源全名:testobject-1.0.0.post1.tar.gz 资源来源:官方 安装方法:https://lanzao.blog.csdn.net/article/details/101784059
资源推荐
资源详情
资源评论
收起资源包目录
testobject-1.0.0.post1.tar.gz (17个子文件)
testobject-1.0.0.post1
MANIFEST.in 51B
PKG-INFO 7KB
testobject
storage.py 679B
reports.py 2KB
client.py 2KB
__init__.py 31B
watcher.py 698B
suites.py 2KB
devices.py 1KB
setup.cfg 61B
testobject.egg-info
PKG-INFO 7KB
requires.txt 16B
SOURCES.txt 362B
top_level.txt 11B
dependency_links.txt 1B
setup.py 1KB
README.md 4KB
共 17 条
- 1
资源评论
挣扎的蓝藻
- 粉丝: 13w+
- 资源: 15万+
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功