testobject_api

2.0.1 • Public • Published

node testobject_api

Wrapper around the Test Object REST API for Node.js.

Install

npm install testobject_api

Test

To run the test suite, first invoke the following command within the repo, installing the development dependencies:

npm install

Then run the tests:

npm test

Authors

Writing a script

const TestObject = require('testobject_api');

const myAccount = new TestObject({
  username: "your-TestObject-username",
  apiKey: "your-test-object-api-key",
  password: "your-test-object-password"
});

/* 
  update the job status.

  updateTest() must be invoked either during test execution
  or ~10 seconds after tests complete execution
  (timeOut may vary based on your distance to the Test Object device farm)
  
*/

 myAccount.updateTest(sessionID, {"passed": false});

//set job status === skipped
 myAccount.skipTest(sessionID);

Supported Methods

REST Node Wrapper
PUT appium/session/${sessionID}/test
Update the status of a test as passed or failed
updateTest(sessionID, status, cb) -> cb(err, res, body)
PUT appium/session/${sessionID}/test/skiptest
Update the test status to skipped
skipTest(sessionID, cb) -> cb(err, res, body)
GET /devices
Returns a list per data center containing all devices, including private devices and those not currently available for testing. This endpoint requires API Key authentication.
getDevices(cb) -> cb(err, res, body)
GET /devices/all
Get a list of all devices, including those that are currently unavailable for testing. This endpoint requires API Key authentication and will also return your private devices.
getAllDevices(cb) -> cb(err, res, body)
GET /devices/all/available
Returns a list per data center containing the IDs of all devices currently available for testing, including private devices. This endpoint requires API Key authentication.
getAllAvailable(cb) -> cb(err, res, body)
GET /devices/available
Get a list of all devices available for testing.
getAvailable(cb) -> cb(err, res, body)
GET devices/popular
Get a list of popular devices based on region.
getPopular(cb) -> cb(err, res, body)

More documentation

Check out the Test Object Rest API for more information.

License

Copyright (c) 2017 Sean Enright

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Readme

Keywords

none

Package Sidebar

Install

npm i testobject_api

Weekly Downloads

15

Version

2.0.1

License

ISC

Unpacked Size

18.5 kB

Total Files

8

Last publish

Collaborators

  • pizzasaurusrex