Skip to main content

Python API wrapper for TestObject

Project description

# 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.skip_test_report(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_device_log(test_report_id) `

### Get XCUITest Log

`python response = to.reports.get_xcuitest_log(test_report_id) `

## Authors

## License

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

testobject-0.3.0.tar.gz (3.8 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

testobject-0.3.0-py2.py3-none-any.whl (6.5 kB view details)

Uploaded Python 2Python 3

testobject-0.3.0-py2-none-any.whl (6.5 kB view details)

Uploaded Python 2

File details

Details for the file testobject-0.3.0.tar.gz.

File metadata

  • Download URL: testobject-0.3.0.tar.gz
  • Upload date:
  • Size: 3.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.0.0 requests-toolbelt/0.8.0 tqdm/4.30.0 CPython/2.7.15

File hashes

Hashes for testobject-0.3.0.tar.gz
Algorithm Hash digest
SHA256 e3a8a6d0562151a9896f2c3936080220e4a8f33177a2da19aaca45a316156568
MD5 ba339d9e9fc13808df74cdeb77da0f2c
BLAKE2b-256 592d909a7f58688f63665edfaa9faf62d553a101e45b2637237a111863a51f0a

See more details on using hashes here.

File details

Details for the file testobject-0.3.0-py2.py3-none-any.whl.

File metadata

  • Download URL: testobject-0.3.0-py2.py3-none-any.whl
  • Upload date:
  • Size: 6.5 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.0.0 requests-toolbelt/0.8.0 tqdm/4.30.0 CPython/2.7.15

File hashes

Hashes for testobject-0.3.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 5499be76ac789e8f98524a4d8f110b5d4d163d3539b73f82f3e13e863747a7da
MD5 1fb2c0e4036992746d48c9bc23a60398
BLAKE2b-256 e014cbe6c052bc704ff13327d1e81737e227c1e7baf1d8cb819001a9a1b88800

See more details on using hashes here.

File details

Details for the file testobject-0.3.0-py2-none-any.whl.

File metadata

  • Download URL: testobject-0.3.0-py2-none-any.whl
  • Upload date:
  • Size: 6.5 kB
  • Tags: Python 2
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.0.0 requests-toolbelt/0.8.0 tqdm/4.30.0 CPython/2.7.15

File hashes

Hashes for testobject-0.3.0-py2-none-any.whl
Algorithm Hash digest
SHA256 199119d685782f5563e3cf9953eff831ff25e9d2072ef4c4332b9b3c79b3bfb4
MD5 64c32d040095ac4b8a62235f6328744b
BLAKE2b-256 9b398e2e03d9c0df7a0fc88c5c027128d422f116887840b897d830e7b7b3d0c5

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page