Skip to main content

testobject-python-api

Build Status Build status codecov PyPI version

A Python library client for TestObject API

For more on the API you can visit TestObject’s docs here.

Getting Started

Installing

To install on your machine run:

pip install testobject

Once installed you can run something like:

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:

pytest

Docs

Get All Devices

response = client.devices.get_devices()
devices = response.json()
us_devices = devices['US']

Get Available Devices

response = client.devices.get_available_devices()
devices = response.json()
us_devices = devices['US']

Get Device

response = client.devices.get_device('iPhone_5_free')
device = response.json()

Get Session Reports

response = client.devices.get_session_reports(last_days=30, offset=1, limit=50)
reports = response.json()

Update Appium Suite

data = {}
data['title'] = "New Suite Title"
response = client.suites.update_suite(suite_number,data)
content = response.json()

Start Appium Suite Report

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

response = to.suites.stop_suite(suite_number, suite_report_number)
content = response.json()

Stop Appium Suite Test

response = to.suites.stop_suite_test(suite_number, suite_report_number, suite_test_number, True)
content = response.json()

Skip Appium Suite Test

response = to.suites.stop_suite_test(suite_number, suite_report_number, suite_test_number)
content = response.json()

Skip Appium Test Report

response = to.watcher.skip_test_report(appium_session_id)

Send Appium Test Report

response = to.watcher.report_test_result(appium_session_id,True)

Upload Application to Project

response = to.storage.upload_app(upload_app_path, display_name, False)

Get Test Report

response = to.reports.get_test_report(test_report_id)

Get Screenshot

response = to.reports.get_screenshot(test_report_id, screenshot_id)

Get Session Video

response = to.reports.get_video(video_id)

Get Appium Log

response = to.reports.get_appium_log(test_report_id)

Get Device Log

response = to.reports.get_device_log(test_report_id)

Get Device Vitals Log

response = to.reports.get_vitals_log(test_report_id)

Get XCUITest Log

response = to.reports.get_xcuitest_log(test_report_id)

Authors

License

This project is licensed under the MIT License - see the LICENSE file for details

Metadata

Release files for testobject 1.0.0.post1

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

Source distribution (sdist)

Source distribution for testobject 1.0.0.post1
File Size Uploaded
testobject-1.0.0.post1.tar.gz 4.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for testobject 1.0.0.post1
File Interpreter ABI Platform
testobject-1.0.0.post1-py2.py3-none-any.whl Python 3, Python 2 none any Details

Total release size: 11.5 kB

Release files / testobject-1.0.0.post1.tar.gz

Download URL testobject-1.0.0.post1.tar.gz
Size 4.7 kB
Tags Source
SHA-256 checksum
How to use checksums
6306764899460bb603c9efe17204946e877aba9f2946719f81c3fe0a324473ff
BLAKE2b-256 checksum
How to use checksums
0329eb7d7986d4f157a384149a7bfb237d27ef7c6b01ff47e23cbf820425b54d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.12.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.8.0 tqdm/4.30.0 CPython/2.7.16

Release files / testobject-1.0.0.post1-py2.py3-none-any.whl

Download URL testobject-1.0.0.post1-py2.py3-none-any.whl
Size 6.8 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
e9852fb252f29da31af08c002146cd2e88bab11aa046f2766f34e4344faf8d93
BLAKE2b-256 checksum
How to use checksums
84db4a53f79cf67397d71808503d9ab974f07381f892a007634e00fec605e9d0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.12.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.8.0 tqdm/4.30.0 CPython/2.7.16

Release history Release notifications | RSS feed

This release

1.0.0.post1 This release

2 release files

1.0.0

2 release files

0.3.0

3 release files

0.2.0

2 release files

0.1.2

1 release file

0.1.1

1 release file

0.1.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