TestObject 的 Python API 包装器
项目描述
TestObject API 的 Python 库客户端
有关 API 的更多信息,您可以 在此处访问 TestObject 的文档。
入门
安装
要在您的机器上安装,请运行:
pip install testobject
安装后,您可以运行以下内容:
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']
运行测试
测试是用 pytest 完成的。要运行这些,只需运行:
pytest
文档
获取所有设备
response = client.devices.get_devices()
devices = response.json()
us_devices = devices['US']
获取可用设备
response = client.devices.get_available_devices()
devices = response.json()
us_devices = devices['US']
获取设备
response = client.devices.get_device('iPhone_5_free')
device = response.json()
获取会话报告
response = client.devices.get_session_reports(last_days=30, offset=1, limit=50)
reports = response.json()
更新 Appium 套件
data = {}
data['title'] = "New Suite Title"
response = client.suites.update_suite(suite_number,data)
content = response.json()
启动 Appium Suite 报告
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()
停止 Appium 套件报告
response = to.suites.stop_suite(suite_number, suite_report_number)
content = response.json()
停止 Appium Suite 测试
response = to.suites.stop_suite_test(suite_number, suite_report_number, suite_test_number, True)
content = response.json()
跳过 Appium 套件测试
response = to.suites.stop_suite_test(suite_number, suite_report_number, suite_test_number)
content = response.json()
跳过 Appium 测试报告
response = to.watcher.skip_test_report(appium_session_id)
发送 Appium 测试报告
response = to.watcher.report_test_result(appium_session_id,True)
将应用程序上传到项目
response = to.storage.upload_app(upload_app_path, display_name, False)
获取测试报告
response = to.reports.get_test_report(test_report_id)
获取屏幕截图
response = to.reports.get_screenshot(test_report_id, screenshot_id)
获取会议视频
response = to.reports.get_video(video_id)
获取 Appium 日志
response = to.reports.get_appium_log(test_report_id)
获取设备日志
response = to.reports.get_device_log(test_report_id)
获取设备生命体征日志
response = to.reports.get_vitals_log(test_report_id)
获取 XCUITest 日志
response = to.reports.get_xcuitest_log(test_report_id)
执照
该项目在 MIT 许可下获得许可 - 请参阅 LICENSE文件了解详细信息
项目详情
关
testobject -1.0.0.post1.tar.gz 的哈希值
算法 | 哈希摘要 | |
---|---|---|
SHA256 | 6306764899460bb603c9efe17204946e877aba9f2946719f81c3fe0a324473ff |
|
MD5 | b9d154a07f5dea3cbfffd249b3a65f6e |
|
布莱克2-256 | 0329eb7d7986d4f157a384149a7bfb237d27ef7c6b01ff47e23cbf820425b54d |
关
testobject -1.0.0.post1-py2.py3-none-any.whl 的哈希值
算法 | 哈希摘要 | |
---|---|---|
SHA256 | e9852fb252f29da31af08c002146cd2e88bab11aa046f2766f34e4344faf8d93 |
|
MD5 | aec1bc83b5732e2fa41a62ab287272b2 |
|
布莱克2-256 | 84db4a53f79cf67397d71808503d9ab974f07381f892a007634e00fec605e9d0 |