A Python library client for TestObject API
For more on the API you can visit TestObject's docs here.
To install on your machine run:
pip install testobjectOnce installed you can run something like:
importtestobjectclient=testobject.TestObject('myusername','my_api_key', password='password')
# Password only needed if using Session Reportsresponse=client.devices.get_devices()
devices=response.json()
us_devices=devices['US']Tests are done with pytest. To run these simply run:
pytestresponse=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()data= {}
data['title'] ="New Suite Title"response=client.suites.update_suite(suite_number,data)
content=response.json()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 listresponse=to.suites.start_suite(suite_number, data)
content=response.json()response=to.suites.stop_suite(suite_number, suite_report_number)
content=response.json()response=to.suites.stop_suite_test(suite_number, suite_report_number, suite_test_number, True)
content=response.json()response=to.suites.stop_suite_test(suite_number, suite_report_number, suite_test_number)
content=response.json()response=to.watcher.skip_test_report(appium_session_id)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)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)response=to.reports.get_xcuitest_log(test_report_id)- Enrique Gonzalez - Maintainer - enriquegh
This project is licensed under the MIT License - see the LICENSE file for details