Wrapper around the TestingBot REST API for Node.js.
npm install testingbot-api
You can use environment variables TESTINGBOT_KEY
and TESTINGBOT_SECRET
to pass your TestingBot key and secret to the API client.
The key and secret can be obtained from TestingBot
const TestingBot = require('testingbot-api');
const tb = new TestingBot({
api_key: "your-tb-key",
api_secret: "your-tb-secret"
});
Gets a list of browsers you can test on
api.getBrowsers(function(error, browsers) {});
Gets a list of physical mobile devices you can test on
api.getDevices(function(error, devices) {});
Gets a list of available physical mobile devices for your account
api.getAvailableDevices(function(error, availableDevices) {});
Gets details for a specific physical device
api.getDevice(deviceId, function(error, deviceDetails) {});
Gets your user information
api.getUserInfo(function(error, userInfo) {});
Updates your user information
api.updateUserInfo(newUserdata, function(error, userInfo) {});
Gets list of your latest tests
api.getTests(function(error, tests) {}, offset, limit);
Gets details for a single test, pass the WebDriver's SessionID
api.getTestDetails(sessionId, function(error, testDetails) {});
Updates a single test. For example, update the passed
state of a test (whether it was successful or not).
const testData = { "test[success]" : "1", "test[status_message]" : "test" };
api.updateTest(testData, sessionId, function(error, testDetails) {});
Deletes a single test, pass the WebDriver's SessionID
api.deleteTest(sessionId, function(error, success) {});
Stops a single test, pass the WebDriver's SessionID
api.stopTest(sessionId, function(error, success) {});
Gets list of active tunnels
api.getTunnelList(function(error, tunnelList) {});
Deletes a single Tunnel
api.deleteTunnel(tunnelId, function(error, success) {});
Retrieves the latest builds
api.getBuilds(function(error, builds) {}, offset, limit);
Retrieves the tests for a single build
api.getTestsForBuild(buildId, function(error, tests) {});
Deletes a single build
api.deleteBuild(buildId, function(error, success) {});
Uploads a local file to TestingBot Storage
api.uploadFile(localFilePath, function(error, appUrl) {});
Uploads a remote file to TestingBot Storage
api.uploadFile(remoteFileUrl, function(error, appUrl) {});
Retrieve data from a previously uploaded file
api.getStorageFile(remoteFileUrl, function(error, fileDetails) {});
Retrieve list of previously uploaded files
api.getStorageFiles(function(error, fileDetails) {}, offset, limit);
Delete a previously uploaded file
api.deleteStorageFile(appId, function(error, success) {});
Calculates the authentication hash for sharing, pass the WebDriver's SessionID. This is used to share a test's detail page on TestingBot
api.getAuthenticationHashForSharing(sessionId);
Takes screenshots for the specific browsers
api.takeScreenshot(function(error, screenshots) {}, url, browsers, waitTime, resolution, fullPage, callbackURL);
Retrieves screenshots for a specific takeScreenshot
call
api.retrieveScreenshots(screenshotId, function(error, screenshots) {});
Retrieves all screenshots previously generate with your account
api.getScreenshotList(function(error, screenshots) {}, offset, limit);
Retrieves team information
api.getTeam(function(error, data) {});
Get all users in your team
api.getUsersInTeam(function(error, users) {});
Retrieves information about a specific user in your team
api.getUserFromTeam(userId, function(error, user) {});
Add a user to your team. You need ADMIN rights for this.
api.createUserInTeam(user, function(error, result) {});
Update a user in your team. You need ADMIN rights for this.
api.updateUserInTeam(userId, userData, function(error, result) {});
Resets credentials for a specific user in your team. You need ADMIN rights for this.
api.resetCredentials(userId, function(error, result) {});
npm test
Check out the TestingBot REST API for more information.