Skip to content

Commit c9ff44c

Browse files
update README.md
1 parent eddab73 commit c9ff44c

1 file changed

Lines changed: 166 additions & 0 deletions

File tree

README.md

Lines changed: 166 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -220,9 +220,175 @@ Calculates the authenticationHash necessary to share tests
220220
String hash = restApi.getAuthenticationHash(String identifier);
221221
```
222222

223+
### Closing the client
224+
`TestingbotREST` holds a pooled HTTP client and implements `Closeable`. Call `close()` when you are done (or use try-with-resources) to release connections.
225+
226+
```java
227+
try (TestingbotREST restApi = new TestingbotREST("key", "secret")) {
228+
restApi.getUserInfo();
229+
}
230+
```
231+
232+
Tests
233+
-----
234+
235+
### getTests with filters
236+
Retrieves a collection of tests with optional server-side filters (`since`, `browser_id`, `group`, `build`, `skip_fields`).
237+
238+
```java
239+
Map<String, String> filters = new HashMap<>();
240+
filters.put("group", "smoke");
241+
TestingbotTestCollection tests = restApi.getTests(int offset, int count, filters);
242+
```
243+
244+
### createTest
245+
Creates a new test.
246+
247+
```java
248+
boolean success = restApi.createTest(Map<String, Object> testFields);
249+
```
250+
251+
Devices
252+
-------
253+
254+
### getDevices with filters
255+
Retrieves devices filtered by platform (Android, iOS, REAL_ANDROID, REAL_IOS) and web capability.
256+
257+
```java
258+
List<TestingbotDevice> devices = restApi.getDevices(String platform, Boolean web);
259+
```
260+
261+
### getAvailableDevices
262+
Retrieves the currently available real devices.
263+
264+
```java
265+
List<TestingbotDevice> devices = restApi.getAvailableDevices();
266+
```
267+
268+
Tunnels
269+
-------
270+
271+
### getTunnel
272+
Gets the currently active tunnel, or a specific tunnel by id.
273+
274+
```java
275+
TestingbotTunnel tunnel = restApi.getTunnel();
276+
TestingbotTunnel tunnel = restApi.getTunnel(int tunnelId);
277+
```
278+
279+
### createTunnel
280+
Boots a new tunnel.
281+
282+
```java
283+
TestingbotTunnel tunnel = restApi.createTunnel();
284+
```
285+
286+
### deleteTunnel / isTunnelAlive
287+
Stops the active tunnel, or checks whether the tunnel is alive.
288+
289+
```java
290+
boolean success = restApi.deleteTunnel();
291+
boolean alive = restApi.isTunnelAlive();
292+
```
293+
294+
Account & configuration
295+
-----------------------
296+
297+
### getJob
298+
Gets the status of a job (e.g. a Codeless test run).
299+
300+
```java
301+
TestingbotJob job = restApi.getJob(String jobId);
302+
```
303+
304+
### getUserKeys / getIpRanges
305+
Retrieves your API keys, or the TestingBot IP ranges (raw JSON).
306+
307+
```java
308+
com.google.gson.JsonElement keys = restApi.getUserKeys();
309+
com.google.gson.JsonElement ranges = restApi.getIpRanges();
310+
```
311+
312+
Team management
313+
---------------
314+
315+
```java
316+
TestingbotTeam team = restApi.getTeam();
317+
TestingbotTeamMemberCollection members = restApi.getTeamMembers();
318+
TestingbotTeamMember member = restApi.createTeamMember(Map<String, Object> params);
319+
TestingbotTeamMember member = restApi.getTeamMember(int userId);
320+
TestingbotTeamMember member = restApi.updateTeamMember(int userId, Map<String, Object> params);
321+
com.google.gson.JsonElement clientKey = restApi.getTeamMemberClientKey(int userId);
322+
TestingbotTeamCredentialReset reset = restApi.resetTeamMemberKeys(int userId);
323+
```
324+
325+
Screenshots
326+
-----------
327+
328+
```java
329+
TestingbotScreenshotCollection screenshots = restApi.getScreenshots();
330+
TestingbotScreenshot batch = restApi.createScreenshots(Map<String, Object> params); // url, resolution, browsers (List)
331+
TestingbotScreenshot batch = restApi.getScreenshot(int screenshotId);
332+
```
333+
334+
Manual sessions
335+
---------------
336+
337+
```java
338+
boolean success = restApi.updateManualSession(int sessionId, Map<String, Object> fields);
339+
boolean success = restApi.pingManualSession(List<Integer> sessionIds);
340+
```
341+
342+
Codeless Lab
343+
------------
344+
345+
```java
346+
TestingbotLabTestCollection labTests = restApi.getLabTests();
347+
TestingbotLabCreateAck created = restApi.createLabTest(Map<String, Object> testFields);
348+
TestingbotLabTest labTest = restApi.getLabTest(int labTestId);
349+
boolean success = restApi.updateLabTest(int labTestId, Map<String, Object> testFields);
350+
boolean success = restApi.deleteLabTest(int labTestId);
351+
TestingbotLabTestStepCollection steps = restApi.getLabTestSteps(int labTestId);
352+
boolean success = restApi.setLabTestSteps(int labTestId, List<String> steps);
353+
List<TestingbotBrowser> browsers = restApi.getLabTestBrowsers(int labTestId);
354+
boolean success = restApi.setLabTestBrowsers(int labTestId, String browserIds);
355+
TestingbotLabRunAck run = restApi.triggerLabTest(int labTestId);
356+
boolean success = restApi.stopLabTest(int labTestId);
357+
boolean success = restApi.addLabTestAlert(int labTestId, Map<String, Object> params); // kind, level, content
358+
boolean success = restApi.updateLabTestAlert(int labTestId, Map<String, Object> params);
359+
boolean success = restApi.createLabTestReport(int labTestId, Map<String, Object> params);
360+
boolean success = restApi.updateLabTestReport(int labTestId, Map<String, Object> params);
361+
boolean success = restApi.scheduleLabTest(int labTestId, Map<String, Object> params); // type, day, hour, cronFormat
362+
TestingbotLabRunAck run = restApi.triggerAllLabTests();
363+
```
364+
365+
Codeless Lab suites
366+
-------------------
367+
368+
```java
369+
TestingbotLabSuiteCollection suites = restApi.getLabSuites();
370+
TestingbotLabSuiteCreateAck created = restApi.createLabSuite(Map<String, Object> suiteFields);
371+
TestingbotLabSuite suite = restApi.getLabSuite(int suiteId);
372+
boolean success = restApi.deleteLabSuite(int suiteId);
373+
TestingbotLabTestCollection tests = restApi.getLabSuiteTests(int suiteId);
374+
boolean success = restApi.addLabSuiteTests(int suiteId, String testIds);
375+
boolean success = restApi.removeLabSuiteTest(int suiteId, int testId);
376+
List<TestingbotBrowser> browsers = restApi.getLabSuiteBrowsers(int suiteId);
377+
boolean success = restApi.setLabSuiteBrowsers(int suiteId, String browserIds);
378+
TestingbotLabRunAck run = restApi.triggerLabSuite(int suiteId);
379+
```
380+
223381
Test
224382
-----
225383

384+
`TestingbotRestOfflineTest` (auth-hash + Gson mapping) and `TestingbotRestMockTest` (every endpoint, against a local `HttpServer`) run with no credentials:
385+
386+
```java
387+
mvn -Dtest='TestingbotRestOfflineTest,TestingbotRestMockTest' test
388+
```
389+
390+
`TestingBotRestTest` runs against the live API and needs your key and secret:
391+
226392
```java
227393
mvn -DTB_KEY=... -DTB_SECRET=... test
228394
```

0 commit comments

Comments
 (0)