testingbot 0.2.3 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.github/workflows/release.yml +49 -0
- data/.github/workflows/test.yml +25 -10
- data/CHANGELOG.md +61 -0
- data/README.md +217 -62
- data/Rakefile +15 -14
- data/bin/testingbot +32 -11
- data/lib/testingbot/api.rb +107 -205
- data/lib/testingbot/connection.rb +193 -0
- data/lib/testingbot/errors.rb +52 -0
- data/lib/testingbot/resources/builds.rb +21 -0
- data/lib/testingbot/resources/jobs.rb +11 -0
- data/lib/testingbot/resources/lab.rb +74 -0
- data/lib/testingbot/resources/lab_suites.rb +46 -0
- data/lib/testingbot/resources/platform.rb +29 -0
- data/lib/testingbot/resources/screenshots.rb +19 -0
- data/lib/testingbot/resources/sharing.rb +13 -0
- data/lib/testingbot/resources/storage.rb +44 -0
- data/lib/testingbot/resources/team.rb +35 -0
- data/lib/testingbot/resources/tests.rb +28 -0
- data/lib/testingbot/resources/tunnels.rb +20 -0
- data/lib/testingbot/resources/user.rb +19 -0
- data/lib/testingbot/version.rb +2 -2
- data/lib/testingbot.rb +4 -1
- metadata +37 -13
- data/spec/integration/api_spec.rb +0 -108
- data/spec/resources/test.apk +0 -1
- data/spec/spec_helper.rb +0 -7
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 6582442d3ad5452bd9740e41449fd19553b7ac5fc6599b88ef4b5cd99a91f499
|
|
4
|
+
data.tar.gz: b7c0cff6163ce11322cfa5cb0d9f79c088f8136041a39bdd5e0ecddaa886e46b
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: e2b457288bc301b01cc682c32a320301e3032f120034cca1d3dbcd267b22aa97cd872f199f4cc2c730996de0ee23d6bd524325bde1d3e1983f087369f6ae4fd7
|
|
7
|
+
data.tar.gz: 38813eb285af2892fafbf043e27c52055ed961ee8b135a8bb810ee7a3de722aafcec1c02323a403e9c4a81a900649d9e83fd52c4390fe526f5f55405da905502
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
name: Release
|
|
2
|
+
|
|
3
|
+
# Publishes the gem to RubyGems when a GitHub Release is published.
|
|
4
|
+
# Uses RubyGems Trusted Publishing (OIDC) — no API key is stored in the repo.
|
|
5
|
+
#
|
|
6
|
+
# This builds and pushes the gem directly (no `rake release` / git tagging),
|
|
7
|
+
# because the GitHub Release already created the tag.
|
|
8
|
+
#
|
|
9
|
+
# One-time setup on rubygems.org (Gem → Ownership/Trusted Publishers, or a
|
|
10
|
+
# "pending" trusted publisher before the first push):
|
|
11
|
+
# - Repository: testingbot/testingbot_ruby
|
|
12
|
+
# - Workflow filename: release.yml
|
|
13
|
+
# - Environment: leave blank
|
|
14
|
+
on:
|
|
15
|
+
release:
|
|
16
|
+
types: [published]
|
|
17
|
+
|
|
18
|
+
permissions:
|
|
19
|
+
contents: read
|
|
20
|
+
|
|
21
|
+
jobs:
|
|
22
|
+
release:
|
|
23
|
+
name: Build and publish gem
|
|
24
|
+
runs-on: ubuntu-latest
|
|
25
|
+
permissions:
|
|
26
|
+
contents: read
|
|
27
|
+
id-token: write # request the OIDC token for Trusted Publishing
|
|
28
|
+
steps:
|
|
29
|
+
- uses: actions/checkout@v4
|
|
30
|
+
with:
|
|
31
|
+
persist-credentials: false
|
|
32
|
+
|
|
33
|
+
- name: Set up Ruby
|
|
34
|
+
uses: ruby/setup-ruby@v1
|
|
35
|
+
with:
|
|
36
|
+
ruby-version: '3.3'
|
|
37
|
+
bundler-cache: true
|
|
38
|
+
|
|
39
|
+
- name: Unit tests (gate)
|
|
40
|
+
run: bundle exec rake unit
|
|
41
|
+
|
|
42
|
+
- name: Configure RubyGems trusted publishing (OIDC)
|
|
43
|
+
uses: rubygems/configure-rubygems-credentials@v2.0.0
|
|
44
|
+
|
|
45
|
+
- name: Build gem
|
|
46
|
+
run: gem build testingbot.gemspec
|
|
47
|
+
|
|
48
|
+
- name: Push to RubyGems
|
|
49
|
+
run: gem push testingbot-*.gem
|
data/.github/workflows/test.yml
CHANGED
|
@@ -1,25 +1,40 @@
|
|
|
1
1
|
name: Test Changes
|
|
2
2
|
|
|
3
|
-
on: [push, pull_request]
|
|
3
|
+
on: [push, pull_request, workflow_dispatch]
|
|
4
4
|
|
|
5
5
|
jobs:
|
|
6
|
-
|
|
6
|
+
# Offline, mocked unit suite. Runs on every push/PR (incl. forks) with no
|
|
7
|
+
# credentials and gates the build.
|
|
8
|
+
unit:
|
|
7
9
|
runs-on: ubuntu-latest
|
|
8
10
|
strategy:
|
|
11
|
+
fail-fast: false
|
|
9
12
|
matrix:
|
|
10
|
-
ruby: ['2.
|
|
11
|
-
name: Ruby ${{ matrix.ruby }}
|
|
13
|
+
ruby: ['2.7', '3.0', '3.1', '3.2', '3.3', head, jruby, truffleruby]
|
|
14
|
+
name: Ruby ${{ matrix.ruby }} unit
|
|
12
15
|
steps:
|
|
13
|
-
- uses: actions/checkout@
|
|
16
|
+
- uses: actions/checkout@v4
|
|
14
17
|
- uses: ruby/setup-ruby@v1
|
|
15
18
|
with:
|
|
16
19
|
ruby-version: ${{ matrix.ruby }}
|
|
17
20
|
bundler-cache: true
|
|
18
|
-
- name:
|
|
19
|
-
run:
|
|
20
|
-
|
|
21
|
-
|
|
21
|
+
- name: Unit tests (mocked, offline)
|
|
22
|
+
run: bundle exec rake unit
|
|
23
|
+
|
|
24
|
+
# Live integration suite. Runs only on demand or on a schedule, where the
|
|
25
|
+
# TB_KEY / TB_SECRET secrets are available (not exposed to fork PRs).
|
|
26
|
+
integration:
|
|
27
|
+
if: ${{ github.event_name == 'workflow_dispatch' || github.event_name == 'schedule' }}
|
|
28
|
+
runs-on: ubuntu-latest
|
|
29
|
+
name: Live integration
|
|
30
|
+
steps:
|
|
31
|
+
- uses: actions/checkout@v4
|
|
32
|
+
- uses: ruby/setup-ruby@v1
|
|
33
|
+
with:
|
|
34
|
+
ruby-version: '3.3'
|
|
35
|
+
bundler-cache: true
|
|
36
|
+
- name: Integration tests (live API)
|
|
37
|
+
run: bundle exec rake integration
|
|
22
38
|
env:
|
|
23
39
|
TB_KEY: ${{ secrets.TB_KEY }}
|
|
24
40
|
TB_SECRET: ${{ secrets.TB_SECRET }}
|
|
25
|
-
|
data/CHANGELOG.md
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## 1.0.0
|
|
4
|
+
|
|
5
|
+
### Breaking changes
|
|
6
|
+
|
|
7
|
+
- **Errors are now wrapped in a `TestingBot::Error` hierarchy.** Methods previously
|
|
8
|
+
leaked raw `RestClient` exceptions (`RestClient::Unauthorized`, `RestClient::NotFound`,
|
|
9
|
+
…) and raised a bare `String` for in-body API errors. They now raise
|
|
10
|
+
`TestingBot::AuthenticationError`, `TestingBot::NotFoundError`,
|
|
11
|
+
`TestingBot::RateLimitError`, `TestingBot::ClientError`, `TestingBot::ServerError`,
|
|
12
|
+
`TestingBot::ApiError`, `TestingBot::ParseError` or `TestingBot::ConnectionError`
|
|
13
|
+
(all subclasses of `TestingBot::Error`, carrying `#http_status` and `#body`).
|
|
14
|
+
Update any `rescue RestClient::...` clauses accordingly.
|
|
15
|
+
- The gem module is now consistently `TestingBot` (was split between `TestingBot` and
|
|
16
|
+
`Testingbot`). `TestingBot::VERSION` holds the gem version.
|
|
17
|
+
|
|
18
|
+
### Fixed
|
|
19
|
+
|
|
20
|
+
- `get_authentication_hash` no longer raises `NameError` — `digest` is now required.
|
|
21
|
+
- `~/.testingbot` credentials are split on the first `:` only, so secrets containing a
|
|
22
|
+
colon are no longer truncated.
|
|
23
|
+
- Path segments (IDs, session IDs, …) are URL-encoded; `upload_remote_file` and
|
|
24
|
+
`create_user_in_team` no longer post to trailing-slash paths.
|
|
25
|
+
- `upload_local_file` no longer leaks a file descriptor and shares the versioned URL and
|
|
26
|
+
error handling with the other requests.
|
|
27
|
+
- `update_*` / `delete_*` / `stop_test` return a real boolean instead of `nil` when the
|
|
28
|
+
response omits a `success` key.
|
|
29
|
+
|
|
30
|
+
### Added — reliability
|
|
31
|
+
|
|
32
|
+
- Configurable open/read timeouts on every request (defaults 10s / 30s).
|
|
33
|
+
- Automatic retries with exponential backoff + jitter for idempotent requests on
|
|
34
|
+
transient failures (timeouts, 5xx) and 429 (honoring `Retry-After`). POSTs are not
|
|
35
|
+
auto-retried.
|
|
36
|
+
- Non-JSON and empty response bodies are handled gracefully.
|
|
37
|
+
- Debug output redacts secret-bearing fields.
|
|
38
|
+
|
|
39
|
+
### Added — API coverage (parity with the Java SDK)
|
|
40
|
+
|
|
41
|
+
- `get_job`
|
|
42
|
+
- `get_tunnel`, and a no-argument `delete_tunnel`
|
|
43
|
+
- `get_device`, server-side filtering on `get_devices`, `get_ip_ranges`
|
|
44
|
+
- `get_user_keys`, `get_user_client_key`
|
|
45
|
+
- optional filters on `get_tests`
|
|
46
|
+
- Full Codeless **Lab tests** surface (`get_lab_tests`, `create_lab_test`, `get_lab_test`,
|
|
47
|
+
`update_lab_test`, `delete_lab_test`, steps, browsers, alert, report, schedule, trigger,
|
|
48
|
+
stop, `trigger_all_lab_tests`)
|
|
49
|
+
- Full Codeless **Lab suites** surface (`get_lab_suites`, `create_lab_suite`,
|
|
50
|
+
`get_lab_suite`, `delete_lab_suite`, tests, browsers, trigger)
|
|
51
|
+
- `update_local_file` / `update_remote_file` (replace a stored app binary)
|
|
52
|
+
|
|
53
|
+
### Changed — internals & tooling
|
|
54
|
+
|
|
55
|
+
- Transport extracted into `TestingBot::Connection` (a single `request` method,
|
|
56
|
+
dependency-injectable for testing) behind the unchanged `TestingBot::Api` surface.
|
|
57
|
+
- New offline, mocked unit suite (WebMock) under `spec/unit`; the live suite under
|
|
58
|
+
`spec/integration` is tagged `:integration` and runs only with credentials.
|
|
59
|
+
`rake unit` is the default and CI gate; `rake integration` runs the live suite.
|
|
60
|
+
- `bin/testingbot` validates input, reads the secret without echoing it, and writes the
|
|
61
|
+
credentials file with `0600` permissions.
|
data/README.md
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
# Testingbot-Ruby
|
|
5
5
|
|
|
6
|
-
This is the TestingBot Ruby client which makes it easy to
|
|
6
|
+
This is the TestingBot Ruby client which makes it easy to
|
|
7
7
|
interact with the [TestingBot API](https://testingbot.com/support/api)
|
|
8
8
|
|
|
9
9
|
## Installation
|
|
@@ -23,68 +23,137 @@ Or install it yourself as:
|
|
|
23
23
|
|
|
24
24
|
## Configuration
|
|
25
25
|
|
|
26
|
-
You'll need a [TestingBot account](https://testingbot.com).
|
|
26
|
+
You'll need a [TestingBot account](https://testingbot.com). TestingBot offers free trials.
|
|
27
|
+
Once you have an account, retrieve your unique TestingBot Key and Secret from the
|
|
28
|
+
[TestingBot dashboard](https://testingbot.com/members).
|
|
27
29
|
|
|
28
|
-
|
|
30
|
+
```ruby
|
|
31
|
+
@api = TestingBot::Api.new(key, secret)
|
|
32
|
+
```
|
|
29
33
|
|
|
30
|
-
|
|
34
|
+
### Credential resolution
|
|
31
35
|
|
|
32
|
-
|
|
36
|
+
If you do not pass a key/secret explicitly, the client resolves them in this order
|
|
37
|
+
(the first source that provides both wins):
|
|
33
38
|
|
|
34
|
-
|
|
35
|
-
|
|
39
|
+
1. Arguments passed to `TestingBot::Api.new(key, secret)`
|
|
40
|
+
2. The `~/.testingbot` file — a single line in the form `key:secret`
|
|
41
|
+
3. The `TESTINGBOT_KEY` / `TESTINGBOT_SECRET` environment variables
|
|
42
|
+
4. The `TB_KEY` / `TB_SECRET` environment variables
|
|
43
|
+
|
|
44
|
+
```bash
|
|
45
|
+
# environment variable style
|
|
46
|
+
export TB_KEY=your-testingbot-key
|
|
47
|
+
export TB_SECRET=your-testingbot-secret
|
|
36
48
|
```
|
|
37
49
|
|
|
38
|
-
|
|
39
|
-
You can set these environment variables to authenticate with our API:
|
|
50
|
+
You can generate the `~/.testingbot` file interactively with the bundled CLI:
|
|
40
51
|
|
|
41
52
|
```bash
|
|
42
|
-
|
|
43
|
-
TB_SECRET=Your TestingBot Secret
|
|
53
|
+
$ testingbot
|
|
44
54
|
```
|
|
45
55
|
|
|
46
|
-
|
|
47
|
-
|
|
56
|
+
The file is created with `0600` permissions; the client warns if it finds the file
|
|
57
|
+
readable by other users.
|
|
58
|
+
|
|
59
|
+
### Options
|
|
60
|
+
|
|
61
|
+
`TestingBot::Api.new` accepts an options hash as a third argument:
|
|
48
62
|
|
|
49
63
|
```ruby
|
|
50
|
-
@api.
|
|
64
|
+
@api = TestingBot::Api.new(key, secret,
|
|
65
|
+
debug: true, # log (redacted) responses to STDERR
|
|
66
|
+
open_timeout: 10, # seconds to wait for the connection (default 10)
|
|
67
|
+
read_timeout: 30, # seconds to wait for the response (default 30)
|
|
68
|
+
max_retries: 3 # retry budget for idempotent requests (default 3)
|
|
69
|
+
)
|
|
51
70
|
```
|
|
52
71
|
|
|
53
|
-
|
|
54
|
-
|
|
72
|
+
Idempotent requests (GET/PUT/DELETE) are retried with exponential backoff on transient
|
|
73
|
+
failures (timeouts, 5xx, and 429 — honoring `Retry-After`). POST requests are never
|
|
74
|
+
retried automatically, to avoid duplicating side effects.
|
|
75
|
+
|
|
76
|
+
### Error handling
|
|
77
|
+
|
|
78
|
+
All failures raise a subclass of `TestingBot::Error`, which carries `#http_status` and
|
|
79
|
+
`#body`:
|
|
80
|
+
|
|
81
|
+
| Exception | Raised when |
|
|
82
|
+
|-----------|-------------|
|
|
83
|
+
| `TestingBot::AuthenticationError` | 401 / 403 (bad credentials or insufficient permissions) |
|
|
84
|
+
| `TestingBot::NotFoundError` | 404 |
|
|
85
|
+
| `TestingBot::RateLimitError` | 429 (exposes `#retry_after`) |
|
|
86
|
+
| `TestingBot::ClientError` | other 4xx |
|
|
87
|
+
| `TestingBot::ServerError` | 5xx |
|
|
88
|
+
| `TestingBot::ApiError` | a 200 response whose body contains an `error` field |
|
|
89
|
+
| `TestingBot::ParseError` | a non-JSON / unparseable response body |
|
|
90
|
+
| `TestingBot::ConnectionError` | network failure or timeout |
|
|
55
91
|
|
|
56
92
|
```ruby
|
|
57
|
-
|
|
93
|
+
begin
|
|
94
|
+
@api.get_test(session_id)
|
|
95
|
+
rescue TestingBot::NotFoundError
|
|
96
|
+
# ...
|
|
97
|
+
rescue TestingBot::Error => e
|
|
98
|
+
warn "TestingBot API error (#{e.http_status}): #{e.message}"
|
|
99
|
+
end
|
|
58
100
|
```
|
|
59
101
|
|
|
60
|
-
|
|
61
|
-
|
|
102
|
+
Most methods return the parsed JSON response (a `Hash` or `Array`). The mutating helpers
|
|
103
|
+
`update_user_info`, `update_test`, `delete_test`, `stop_test` and `delete_uploaded_file`
|
|
104
|
+
return a `Boolean` indicating success.
|
|
105
|
+
|
|
106
|
+
## Usage
|
|
107
|
+
|
|
108
|
+
### get_user_info
|
|
109
|
+
Gets your user information.
|
|
62
110
|
|
|
63
111
|
```ruby
|
|
64
|
-
@api.
|
|
112
|
+
@api.get_user_info
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
### update_user_info
|
|
116
|
+
Updates your user information. Returns `true`/`false`.
|
|
117
|
+
|
|
118
|
+
```ruby
|
|
119
|
+
@api.update_user_info({ "first_name" => 'my name' })
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
### get_user_keys
|
|
123
|
+
Retrieves the API key/secret pair for the current account.
|
|
124
|
+
|
|
125
|
+
```ruby
|
|
126
|
+
@api.get_user_keys
|
|
65
127
|
```
|
|
66
128
|
|
|
67
129
|
### get_team
|
|
68
|
-
Gets info about the current team you belong to
|
|
130
|
+
Gets info about the current team you belong to.
|
|
69
131
|
|
|
70
132
|
```ruby
|
|
71
133
|
@api.get_team
|
|
72
134
|
```
|
|
73
135
|
|
|
74
136
|
### get_users_in_team
|
|
75
|
-
Gets all users in your team
|
|
137
|
+
Gets all users in your team.
|
|
76
138
|
|
|
77
139
|
```ruby
|
|
78
140
|
@api.get_users_in_team(offset = 0, count = 10)
|
|
79
141
|
```
|
|
80
142
|
|
|
81
143
|
### get_user_in_team
|
|
82
|
-
Get info about a specific user in your team
|
|
144
|
+
Get info about a specific user in your team.
|
|
83
145
|
|
|
84
146
|
```ruby
|
|
85
147
|
@api.get_user_in_team(user_id)
|
|
86
148
|
```
|
|
87
149
|
|
|
150
|
+
### get_user_client_key
|
|
151
|
+
Gets a specific team member's API client key. Requires ADMIN rights.
|
|
152
|
+
|
|
153
|
+
```ruby
|
|
154
|
+
@api.get_user_client_key(user_id)
|
|
155
|
+
```
|
|
156
|
+
|
|
88
157
|
### create_user_in_team
|
|
89
158
|
Add a user to your current team. You need to have ADMIN rights to do this.
|
|
90
159
|
|
|
@@ -100,104 +169,134 @@ Updates a specific user in your team.
|
|
|
100
169
|
```
|
|
101
170
|
|
|
102
171
|
### reset_credentials
|
|
103
|
-
Resets the credentials for a specific user
|
|
172
|
+
Resets the credentials for a specific user.
|
|
104
173
|
|
|
105
174
|
```ruby
|
|
106
175
|
@api.reset_credentials(user_id)
|
|
107
176
|
```
|
|
108
177
|
|
|
109
|
-
###
|
|
110
|
-
|
|
178
|
+
### get_browsers
|
|
179
|
+
Gets a list of browsers you can test on.
|
|
111
180
|
|
|
112
181
|
```ruby
|
|
113
|
-
@api.
|
|
182
|
+
@api.get_browsers
|
|
114
183
|
```
|
|
115
184
|
|
|
116
|
-
###
|
|
117
|
-
|
|
185
|
+
### get_devices
|
|
186
|
+
Gets a list of (physical) devices you can test on. Optionally filter by platform and/or web capability.
|
|
118
187
|
|
|
119
188
|
```ruby
|
|
120
|
-
@api.
|
|
189
|
+
@api.get_devices
|
|
190
|
+
@api.get_devices("android", true)
|
|
121
191
|
```
|
|
122
192
|
|
|
123
|
-
###
|
|
124
|
-
|
|
193
|
+
### get_available_devices
|
|
194
|
+
Gets a list of available (physical) devices you can test on.
|
|
125
195
|
|
|
126
196
|
```ruby
|
|
127
|
-
@api.
|
|
197
|
+
@api.get_available_devices
|
|
128
198
|
```
|
|
129
199
|
|
|
130
|
-
###
|
|
131
|
-
Gets
|
|
200
|
+
### get_device
|
|
201
|
+
Gets a single physical device by its numeric ID.
|
|
132
202
|
|
|
133
203
|
```ruby
|
|
134
|
-
@api.
|
|
204
|
+
@api.get_device(device_id)
|
|
135
205
|
```
|
|
136
206
|
|
|
137
|
-
###
|
|
138
|
-
|
|
207
|
+
### get_ip_ranges
|
|
208
|
+
Gets the IP ranges TestingBot tests originate from (useful for firewall allow-listing).
|
|
139
209
|
|
|
140
210
|
```ruby
|
|
141
|
-
@api.
|
|
211
|
+
@api.get_ip_ranges
|
|
142
212
|
```
|
|
143
213
|
|
|
144
|
-
###
|
|
145
|
-
|
|
146
|
-
For example, you can specify the test name and whether the test succeeded or failed:
|
|
214
|
+
### take_screenshots
|
|
215
|
+
Take screenshots for a specific URL on specific browsers.
|
|
147
216
|
|
|
148
217
|
```ruby
|
|
149
|
-
@api.
|
|
218
|
+
@api.take_screenshots(configuration)
|
|
150
219
|
```
|
|
151
220
|
|
|
152
|
-
###
|
|
153
|
-
|
|
221
|
+
### get_screenshots_history
|
|
222
|
+
Retrieve screenshots that were previously generated.
|
|
154
223
|
|
|
155
224
|
```ruby
|
|
156
|
-
@api.
|
|
225
|
+
@api.get_screenshots_history(offset = 0, count = 10)
|
|
226
|
+
```
|
|
227
|
+
|
|
228
|
+
### get_screenshots
|
|
229
|
+
Get screenshots from a specific id.
|
|
230
|
+
|
|
231
|
+
```ruby
|
|
232
|
+
@api.get_screenshots(screenshots_id)
|
|
157
233
|
```
|
|
158
234
|
|
|
159
235
|
### get_tests
|
|
160
|
-
Gets a list of previous jobs/tests that you ran on TestingBot,
|
|
236
|
+
Gets a list of previous jobs/tests that you ran on TestingBot, ordered by last run.
|
|
237
|
+
The optional `filters` hash accepts the API's `since`, `browser_id`, `group`, `build` and `skip_fields` params.
|
|
161
238
|
|
|
162
239
|
```ruby
|
|
163
240
|
@api.get_tests(0, 10)
|
|
241
|
+
@api.get_tests(0, 10, build: "my-build")
|
|
242
|
+
```
|
|
243
|
+
|
|
244
|
+
### get_test
|
|
245
|
+
Gets meta information for a test/job by passing in the WebDriver sessionID of the test you ran on TestingBot.
|
|
246
|
+
|
|
247
|
+
```ruby
|
|
248
|
+
@api.get_test(webdriver_session_id)
|
|
249
|
+
```
|
|
250
|
+
|
|
251
|
+
### update_test
|
|
252
|
+
Updates a Test with meta-data to display on TestingBot (e.g. name and pass/fail). Returns `true`/`false`.
|
|
253
|
+
|
|
254
|
+
```ruby
|
|
255
|
+
@api.update_test(webdriver_session_id, { :name => new_name, :success => true })
|
|
164
256
|
```
|
|
165
257
|
|
|
166
258
|
### delete_test
|
|
167
|
-
Deletes a test from TestingBot
|
|
259
|
+
Deletes a test from TestingBot. Returns `true`/`false`.
|
|
168
260
|
|
|
169
261
|
```ruby
|
|
170
262
|
@api.delete_test(webdriver_session_id)
|
|
171
263
|
```
|
|
172
264
|
|
|
173
265
|
### stop_test
|
|
174
|
-
Stops a running test on TestingBot
|
|
266
|
+
Stops a running test on TestingBot. Returns `true`/`false`.
|
|
175
267
|
|
|
176
268
|
```ruby
|
|
177
269
|
@api.stop_test(webdriver_session_id)
|
|
178
270
|
```
|
|
179
271
|
|
|
180
272
|
### get_builds
|
|
181
|
-
Gets a list of builds that you ran on TestingBot,
|
|
273
|
+
Gets a list of builds that you ran on TestingBot, ordered by last run.
|
|
182
274
|
|
|
183
275
|
```ruby
|
|
184
276
|
@api.get_builds(0, 10)
|
|
185
277
|
```
|
|
186
278
|
|
|
187
279
|
### get_build
|
|
188
|
-
Gets a build from TestingBot
|
|
280
|
+
Gets a build from TestingBot.
|
|
189
281
|
|
|
190
282
|
```ruby
|
|
191
283
|
@api.get_build(build_identifier)
|
|
192
284
|
```
|
|
193
285
|
|
|
194
286
|
### delete_build
|
|
195
|
-
Deletes a build from TestingBot
|
|
287
|
+
Deletes a build from TestingBot.
|
|
196
288
|
|
|
197
289
|
```ruby
|
|
198
290
|
@api.delete_build(build_identifier)
|
|
199
291
|
```
|
|
200
292
|
|
|
293
|
+
### get_job
|
|
294
|
+
Polls the status/result of an asynchronous job (e.g. a Codeless Lab run started by a trigger endpoint).
|
|
295
|
+
|
|
296
|
+
```ruby
|
|
297
|
+
@api.get_job(job_id)
|
|
298
|
+
```
|
|
299
|
+
|
|
201
300
|
### get_tunnels
|
|
202
301
|
Gets a list of active tunnels for your account.
|
|
203
302
|
|
|
@@ -205,15 +304,25 @@ Gets a list of active tunnels for your account.
|
|
|
205
304
|
@api.get_tunnels
|
|
206
305
|
```
|
|
207
306
|
|
|
307
|
+
### get_tunnel
|
|
308
|
+
Gets the active tunnel, or a specific tunnel by ID.
|
|
309
|
+
|
|
310
|
+
```ruby
|
|
311
|
+
@api.get_tunnel
|
|
312
|
+
@api.get_tunnel(tunnel_id)
|
|
313
|
+
```
|
|
314
|
+
|
|
208
315
|
### delete_tunnel
|
|
209
|
-
Deletes
|
|
316
|
+
Deletes a tunnel by ID, or the active tunnel when called without an argument.
|
|
210
317
|
|
|
211
318
|
```ruby
|
|
212
319
|
@api.delete_tunnel(tunnel_identifier)
|
|
320
|
+
@api.delete_tunnel
|
|
213
321
|
```
|
|
214
322
|
|
|
215
323
|
### upload_local_file
|
|
216
324
|
Uploads a local file (APK or IPA file) to TestingBot Storage for Mobile App Testing.
|
|
325
|
+
This request uses a 600-second timeout to accommodate large uploads.
|
|
217
326
|
|
|
218
327
|
```ruby
|
|
219
328
|
@api.upload_local_file(localFilePath)
|
|
@@ -226,11 +335,19 @@ Uploads a remote file (APK or IPA URL) to TestingBot Storage for Mobile App Test
|
|
|
226
335
|
@api.upload_remote_file(remoteFileUrl)
|
|
227
336
|
```
|
|
228
337
|
|
|
338
|
+
### update_local_file / update_remote_file
|
|
339
|
+
Replaces the binary stored under an existing app key.
|
|
340
|
+
|
|
341
|
+
```ruby
|
|
342
|
+
@api.update_local_file(app_url, localFilePath)
|
|
343
|
+
@api.update_remote_file(app_url, remoteFileUrl)
|
|
344
|
+
```
|
|
345
|
+
|
|
229
346
|
### get_uploaded_files
|
|
230
|
-
Retrieves files previously uploaded TestingBot Storage for Mobile App Testing.
|
|
347
|
+
Retrieves files previously uploaded to TestingBot Storage for Mobile App Testing.
|
|
231
348
|
|
|
232
349
|
```ruby
|
|
233
|
-
@api.get_uploaded_files(offset = 0, count =
|
|
350
|
+
@api.get_uploaded_files(offset = 0, count = 10)
|
|
234
351
|
```
|
|
235
352
|
|
|
236
353
|
### get_uploaded_file
|
|
@@ -241,26 +358,65 @@ Retrieves meta-data for a file previously uploaded to TestingBot Storage.
|
|
|
241
358
|
```
|
|
242
359
|
|
|
243
360
|
### delete_uploaded_file
|
|
244
|
-
Deletes a previously uploaded file
|
|
361
|
+
Deletes a previously uploaded file. Returns `true`/`false`.
|
|
245
362
|
|
|
246
363
|
```ruby
|
|
247
|
-
@api.delete_uploaded_file(
|
|
364
|
+
@api.delete_uploaded_file(app_url)
|
|
248
365
|
```
|
|
249
366
|
|
|
250
|
-
###
|
|
251
|
-
Uploads a remote file (APK or IPA URL) to TestingBot Storage for Mobile App Testing.
|
|
367
|
+
### Codeless Lab tests
|
|
252
368
|
|
|
253
369
|
```ruby
|
|
254
|
-
@api.
|
|
370
|
+
@api.get_lab_tests(offset = 0, count = 10)
|
|
371
|
+
@api.create_lab_test(params = {})
|
|
372
|
+
@api.get_lab_test(lab_test_id)
|
|
373
|
+
@api.update_lab_test(lab_test_id, params = {})
|
|
374
|
+
@api.delete_lab_test(lab_test_id)
|
|
375
|
+
@api.get_lab_test_steps(lab_test_id)
|
|
376
|
+
@api.set_lab_test_steps(lab_test_id, params = {})
|
|
377
|
+
@api.get_lab_test_browsers(lab_test_id)
|
|
378
|
+
@api.set_lab_test_browsers(lab_test_id, params = {})
|
|
379
|
+
@api.add_lab_test_alert(lab_test_id, params = {})
|
|
380
|
+
@api.update_lab_test_alert(lab_test_id, params = {})
|
|
381
|
+
@api.create_lab_test_report(lab_test_id, params = {})
|
|
382
|
+
@api.update_lab_test_report(lab_test_id, params = {})
|
|
383
|
+
@api.schedule_lab_test(lab_test_id, params = {})
|
|
384
|
+
@api.trigger_lab_test(lab_test_id, params = {})
|
|
385
|
+
@api.stop_lab_test(lab_test_id)
|
|
386
|
+
@api.trigger_all_lab_tests(params = {})
|
|
387
|
+
```
|
|
388
|
+
|
|
389
|
+
### Codeless Lab suites
|
|
390
|
+
|
|
391
|
+
```ruby
|
|
392
|
+
@api.get_lab_suites(offset = 0, count = 10)
|
|
393
|
+
@api.create_lab_suite(params = {})
|
|
394
|
+
@api.get_lab_suite(suite_id)
|
|
395
|
+
@api.delete_lab_suite(suite_id)
|
|
396
|
+
@api.get_lab_suite_tests(suite_id)
|
|
397
|
+
@api.add_lab_suite_tests(suite_id, params = {})
|
|
398
|
+
@api.remove_lab_suite_test(suite_id, test_id)
|
|
399
|
+
@api.get_lab_suite_browsers(suite_id)
|
|
400
|
+
@api.set_lab_suite_browsers(suite_id, params = {})
|
|
401
|
+
@api.trigger_lab_suite(suite_id, params = {})
|
|
255
402
|
```
|
|
256
403
|
|
|
257
404
|
### get_authentication_hash
|
|
258
|
-
Calculates the hash necessary to share tests with other people
|
|
405
|
+
Calculates the hash necessary to share private tests/builds with other people.
|
|
406
|
+
Returns `MD5("#{key}:#{secret}:#{identifier}")`.
|
|
259
407
|
|
|
260
408
|
```ruby
|
|
261
409
|
@api.get_authentication_hash(identifier)
|
|
262
410
|
```
|
|
263
411
|
|
|
412
|
+
## Development
|
|
413
|
+
|
|
414
|
+
```bash
|
|
415
|
+
bundle install
|
|
416
|
+
bundle exec rake unit # offline, mocked unit suite (no credentials required)
|
|
417
|
+
bundle exec rake integration # live suite, requires TB_KEY / TB_SECRET
|
|
418
|
+
```
|
|
419
|
+
|
|
264
420
|
## Contributing
|
|
265
421
|
|
|
266
422
|
1. Fork this repository
|
|
@@ -268,4 +424,3 @@ Calculates the hash necessary to share tests with other people
|
|
|
268
424
|
3. Commit your changes (`git commit -am 'Add some feature'`)
|
|
269
425
|
4. Push to the branch (`git push origin my-new-feature`)
|
|
270
426
|
5. Create new Pull Request
|
|
271
|
-
|
data/Rakefile
CHANGED
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
require "bundler/gem_tasks"
|
|
2
|
-
require
|
|
3
|
-
require 'rake/testtask'
|
|
2
|
+
require "rspec/core/rake_task"
|
|
4
3
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
4
|
+
# Offline, mocked unit suite — the default and CI gate. Needs no credentials.
|
|
5
|
+
RSpec::Core::RakeTask.new(:unit) do |t|
|
|
6
|
+
t.pattern = "spec/unit/**/*_spec.rb"
|
|
7
|
+
end
|
|
8
|
+
|
|
9
|
+
# Live integration suite — hits the real API; requires TB_KEY / TB_SECRET.
|
|
10
|
+
RSpec::Core::RakeTask.new(:integration) do |t|
|
|
11
|
+
t.pattern = "spec/integration/**/*_spec.rb"
|
|
12
|
+
t.rspec_opts = "--tag integration"
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
# `rake spec` and the default task run only the offline unit suite.
|
|
16
|
+
task :spec => :unit
|
|
17
|
+
task :default => :unit
|