Skip to content

Commit 77e90f0

Browse files
committed
add missing API calls
1 parent b512897 commit 77e90f0

File tree

2 files changed

+74
-5
lines changed

2 files changed

+74
-5
lines changed

README.md

Lines changed: 44 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
[![Build Status](https://travis-ci.org/testingbot/testingbotclient.svg?branch=master)](https://travis-ci.org/testingbot/testingbotclient)
21
[![PyPI version](https://badge.fury.io/py/testingbotclient.svg)](https://badge.fury.io/py/testingbotclient)
32

43
# testingbotclient
@@ -13,7 +12,7 @@ pip install testingbotclient
1312

1413
## TestingBot
1514
[TestingBot](https://testingbot.com/) allows you to run Selenium tests in the cloud.
16-
With access to over +1500 different browser/device combinations, you can run your browser and mobile tests in parallel on the TestingBot Selenium grid.
15+
With access to over +2600 different browser/device combinations, you can run your browser and mobile tests in parallel on the TestingBot Grid.
1716

1817
## Getting Started
1918

@@ -41,6 +40,30 @@ Retrieves collection of available browsers
4140
testingbotclient.information.get_browsers()
4241
```
4342

43+
### getDevices
44+
Retrieves collection of devices
45+
<https://testingbot.com/support/api#devices>
46+
47+
```python
48+
testingbotclient.information.get_devices()
49+
```
50+
51+
### getAvailableDevices
52+
Retrieves collection of devices currently available
53+
<https://testingbot.com/support/api#available-devices>
54+
55+
```python
56+
testingbotclient.information.get_available_devices()
57+
```
58+
59+
### getDevice
60+
Retrieves information for a specific device
61+
<https://testingbot.com/support/api#devicedetails>
62+
63+
```python
64+
testingbotclient.information.get_device(deviceId)
65+
```
66+
4467
### updateTest
4568
Update meta-data for a test
4669
<https://testingbot.com/support/api#updatetest>
@@ -109,6 +132,15 @@ Retrieves a collection of tests for a specific build
109132
testingbotclient.build.get_tests_for_build(buildId)
110133
```
111134

135+
### deleteBuild
136+
Deletes a specific build
137+
<https://testingbot.com/support/api#deletebuild>
138+
139+
140+
```python
141+
testingbotclient.build.delete_build(buildId)
142+
```
143+
112144
### getUserConfig
113145
Retrieves information about the current user
114146
<https://testingbot.com/support/api#user>
@@ -118,6 +150,15 @@ Retrieves information about the current user
118150
testingbotclient.user.get_user_information()
119151
```
120152

153+
### updateUser
154+
Updates information about the current user
155+
<https://testingbot.com/support/api#useredit>
156+
157+
158+
```python
159+
testingbotclient.user.update_user_information(userInformation)
160+
```
161+
121162
### getTunnels
122163
Retrieves tunnels for the current user
123164
<https://testingbot.com/support/api#apitunnellist>
@@ -193,7 +234,7 @@ testingbotclient.get_share_link(sessionId)
193234
## Test
194235

195236
```python
196-
python test_travis.py
237+
python tests/test_client.py
197238
```
198239

199240
## More documentation

testingbotclient.py

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
from requests.auth import HTTPBasicAuth
99
import hashlib
1010

11-
__version__ = '0.0.7'
11+
__version__ = '0.0.8'
1212

1313
class TestingBotException(Exception):
1414
def __init__(self, *args, **kwargs):
@@ -157,6 +157,24 @@ def get_browsers(self):
157157
browsers = self.client.get(url)
158158
return browsers
159159

160+
def get_devices(self):
161+
"""Get details of all devices currently on TestingBot"""
162+
url = '/devices'
163+
devices = self.client.get(url)
164+
return devices
165+
166+
def get_available_devices(self):
167+
"""Get details of all devices currently available on TestingBot"""
168+
url = '/devices/available'
169+
devices = self.client.get(url)
170+
return devices
171+
172+
def get_device(self, deviceId):
173+
"""Get details of a specific device on TestingBot"""
174+
url = '/devices/' + deviceId
175+
device = self.client.get(url)
176+
return device
177+
160178
class Tunnel(object):
161179
def __init__(self, client):
162180
self.client = client
@@ -166,7 +184,7 @@ def get_tunnels(self):
166184
return self.client.get('/tunnel/list')
167185

168186
def delete_tunnel(self, tunnelId):
169-
"""Get TestingBot Tunnels currently running"""
187+
"""Delete a specific TestingBot Tunnel"""
170188
return self.client.delete('/tunnel/' + tunnelId)
171189

172190
class Build(object):
@@ -179,6 +197,10 @@ def get_builds(self, offset = 0, limit = 30):
179197

180198
def get_tests_for_build(self, buildId):
181199
"""Get tests for a specific build"""
200+
return self.client.get('/builds/' + buildId)
201+
202+
def delete_build(self, buildId):
203+
"""Delete a specific build"""
182204
return self.client.delete('/builds/' + buildId)
183205

184206

@@ -190,4 +212,10 @@ def get_user_information(self):
190212
"""Access current user information"""
191213
url = '/user'
192214
info = self.client.get(url)
215+
return info
216+
217+
def update_user_information(self, newUser):
218+
"""Update current user information"""
219+
url = '/user'
220+
info = self.client.put(url)
193221
return info

0 commit comments

Comments
 (0)