testingbot 0.2.2 → 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 +27 -13
- data/CHANGELOG.md +61 -0
- data/README.md +261 -42
- data/Rakefile +15 -14
- data/bin/testingbot +32 -11
- data/lib/testingbot/api.rb +107 -182
- 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 +36 -14
- data/.travis.yml +0 -9
- 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,26 +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: [
|
|
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@
|
|
14
|
-
- uses:
|
|
16
|
+
- uses: actions/checkout@v4
|
|
17
|
+
- uses: ruby/setup-ruby@v1
|
|
15
18
|
with:
|
|
16
19
|
ruby-version: ${{ matrix.ruby }}
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
20
|
+
bundler-cache: true
|
|
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
|
|
23
38
|
env:
|
|
24
39
|
TB_KEY: ${{ secrets.TB_KEY }}
|
|
25
40
|
TB_SECRET: ${{ secrets.TB_SECRET }}
|
|
26
|
-
|
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
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
[](https://badge.fury.io/rb/testingbot)
|
|
2
|
+
[](https://github.com/testingbot/testingbot_ruby/actions/workflows/test.yml)
|
|
2
3
|
|
|
3
4
|
# Testingbot-Ruby
|
|
4
5
|
|
|
5
|
-
This is the TestingBot Ruby client which makes it easy to
|
|
6
|
+
This is the TestingBot Ruby client which makes it easy to
|
|
6
7
|
interact with the [TestingBot API](https://testingbot.com/support/api)
|
|
7
8
|
|
|
8
9
|
## Installation
|
|
@@ -22,118 +23,280 @@ Or install it yourself as:
|
|
|
22
23
|
|
|
23
24
|
## Configuration
|
|
24
25
|
|
|
25
|
-
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).
|
|
26
29
|
|
|
27
|
-
|
|
30
|
+
```ruby
|
|
31
|
+
@api = TestingBot::Api.new(key, secret)
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
### Credential resolution
|
|
35
|
+
|
|
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):
|
|
38
|
+
|
|
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
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
You can generate the `~/.testingbot` file interactively with the bundled CLI:
|
|
51
|
+
|
|
52
|
+
```bash
|
|
53
|
+
$ testingbot
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
The file is created with `0600` permissions; the client warns if it finds the file
|
|
57
|
+
readable by other users.
|
|
58
|
+
|
|
59
|
+
### Options
|
|
28
60
|
|
|
29
|
-
|
|
61
|
+
`TestingBot::Api.new` accepts an options hash as a third argument:
|
|
62
|
+
|
|
63
|
+
```ruby
|
|
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
|
+
)
|
|
70
|
+
```
|
|
71
|
+
|
|
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 |
|
|
91
|
+
|
|
92
|
+
```ruby
|
|
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
|
|
100
|
+
```
|
|
101
|
+
|
|
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.
|
|
30
105
|
|
|
31
106
|
## Usage
|
|
32
107
|
|
|
108
|
+
### get_user_info
|
|
109
|
+
Gets your user information.
|
|
110
|
+
|
|
33
111
|
```ruby
|
|
34
|
-
@api
|
|
112
|
+
@api.get_user_info
|
|
35
113
|
```
|
|
36
114
|
|
|
37
|
-
|
|
38
|
-
|
|
115
|
+
### update_user_info
|
|
116
|
+
Updates your user information. Returns `true`/`false`.
|
|
39
117
|
|
|
40
|
-
```
|
|
41
|
-
|
|
42
|
-
|
|
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
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
### get_team
|
|
130
|
+
Gets info about the current team you belong to.
|
|
131
|
+
|
|
132
|
+
```ruby
|
|
133
|
+
@api.get_team
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
### get_users_in_team
|
|
137
|
+
Gets all users in your team.
|
|
138
|
+
|
|
139
|
+
```ruby
|
|
140
|
+
@api.get_users_in_team(offset = 0, count = 10)
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
### get_user_in_team
|
|
144
|
+
Get info about a specific user in your team.
|
|
145
|
+
|
|
146
|
+
```ruby
|
|
147
|
+
@api.get_user_in_team(user_id)
|
|
148
|
+
```
|
|
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
|
+
|
|
157
|
+
### create_user_in_team
|
|
158
|
+
Add a user to your current team. You need to have ADMIN rights to do this.
|
|
159
|
+
|
|
160
|
+
```ruby
|
|
161
|
+
@api.create_user_in_team(user = {})
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
### update_user_in_team
|
|
165
|
+
Updates a specific user in your team.
|
|
166
|
+
|
|
167
|
+
```ruby
|
|
168
|
+
@api.update_user_in_team(user_id, user = {})
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
### reset_credentials
|
|
172
|
+
Resets the credentials for a specific user.
|
|
173
|
+
|
|
174
|
+
```ruby
|
|
175
|
+
@api.reset_credentials(user_id)
|
|
43
176
|
```
|
|
44
177
|
|
|
45
178
|
### get_browsers
|
|
46
|
-
Gets a list of browsers you can test on
|
|
179
|
+
Gets a list of browsers you can test on.
|
|
47
180
|
|
|
48
181
|
```ruby
|
|
49
182
|
@api.get_browsers
|
|
50
183
|
```
|
|
51
184
|
|
|
52
185
|
### get_devices
|
|
53
|
-
Gets a list of (physical) devices you can test on
|
|
186
|
+
Gets a list of (physical) devices you can test on. Optionally filter by platform and/or web capability.
|
|
54
187
|
|
|
55
188
|
```ruby
|
|
56
189
|
@api.get_devices
|
|
190
|
+
@api.get_devices("android", true)
|
|
57
191
|
```
|
|
58
192
|
|
|
59
193
|
### get_available_devices
|
|
60
|
-
Gets a list of available (physical) devices you can test on
|
|
194
|
+
Gets a list of available (physical) devices you can test on.
|
|
61
195
|
|
|
62
196
|
```ruby
|
|
63
197
|
@api.get_available_devices
|
|
64
198
|
```
|
|
65
199
|
|
|
66
|
-
###
|
|
67
|
-
Gets
|
|
200
|
+
### get_device
|
|
201
|
+
Gets a single physical device by its numeric ID.
|
|
68
202
|
|
|
69
203
|
```ruby
|
|
70
|
-
@api.
|
|
204
|
+
@api.get_device(device_id)
|
|
71
205
|
```
|
|
72
206
|
|
|
73
|
-
###
|
|
74
|
-
|
|
207
|
+
### get_ip_ranges
|
|
208
|
+
Gets the IP ranges TestingBot tests originate from (useful for firewall allow-listing).
|
|
75
209
|
|
|
76
210
|
```ruby
|
|
77
|
-
@api.
|
|
211
|
+
@api.get_ip_ranges
|
|
78
212
|
```
|
|
79
213
|
|
|
80
|
-
###
|
|
81
|
-
|
|
82
|
-
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.
|
|
83
216
|
|
|
84
217
|
```ruby
|
|
85
|
-
@api.
|
|
218
|
+
@api.take_screenshots(configuration)
|
|
86
219
|
```
|
|
87
220
|
|
|
88
|
-
###
|
|
89
|
-
|
|
221
|
+
### get_screenshots_history
|
|
222
|
+
Retrieve screenshots that were previously generated.
|
|
90
223
|
|
|
91
224
|
```ruby
|
|
92
|
-
@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)
|
|
93
233
|
```
|
|
94
234
|
|
|
95
235
|
### get_tests
|
|
96
|
-
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.
|
|
97
238
|
|
|
98
239
|
```ruby
|
|
99
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 })
|
|
100
256
|
```
|
|
101
257
|
|
|
102
258
|
### delete_test
|
|
103
|
-
Deletes a test from TestingBot
|
|
259
|
+
Deletes a test from TestingBot. Returns `true`/`false`.
|
|
104
260
|
|
|
105
261
|
```ruby
|
|
106
262
|
@api.delete_test(webdriver_session_id)
|
|
107
263
|
```
|
|
108
264
|
|
|
109
265
|
### stop_test
|
|
110
|
-
Stops a running test on TestingBot
|
|
266
|
+
Stops a running test on TestingBot. Returns `true`/`false`.
|
|
111
267
|
|
|
112
268
|
```ruby
|
|
113
269
|
@api.stop_test(webdriver_session_id)
|
|
114
270
|
```
|
|
115
271
|
|
|
116
272
|
### get_builds
|
|
117
|
-
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.
|
|
118
274
|
|
|
119
275
|
```ruby
|
|
120
276
|
@api.get_builds(0, 10)
|
|
121
277
|
```
|
|
122
278
|
|
|
123
279
|
### get_build
|
|
124
|
-
Gets a build from TestingBot
|
|
280
|
+
Gets a build from TestingBot.
|
|
125
281
|
|
|
126
282
|
```ruby
|
|
127
283
|
@api.get_build(build_identifier)
|
|
128
284
|
```
|
|
129
285
|
|
|
130
286
|
### delete_build
|
|
131
|
-
Deletes a build from TestingBot
|
|
287
|
+
Deletes a build from TestingBot.
|
|
132
288
|
|
|
133
289
|
```ruby
|
|
134
290
|
@api.delete_build(build_identifier)
|
|
135
291
|
```
|
|
136
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
|
+
|
|
137
300
|
### get_tunnels
|
|
138
301
|
Gets a list of active tunnels for your account.
|
|
139
302
|
|
|
@@ -141,15 +304,25 @@ Gets a list of active tunnels for your account.
|
|
|
141
304
|
@api.get_tunnels
|
|
142
305
|
```
|
|
143
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
|
+
|
|
144
315
|
### delete_tunnel
|
|
145
|
-
Deletes
|
|
316
|
+
Deletes a tunnel by ID, or the active tunnel when called without an argument.
|
|
146
317
|
|
|
147
318
|
```ruby
|
|
148
319
|
@api.delete_tunnel(tunnel_identifier)
|
|
320
|
+
@api.delete_tunnel
|
|
149
321
|
```
|
|
150
322
|
|
|
151
323
|
### upload_local_file
|
|
152
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.
|
|
153
326
|
|
|
154
327
|
```ruby
|
|
155
328
|
@api.upload_local_file(localFilePath)
|
|
@@ -162,11 +335,19 @@ Uploads a remote file (APK or IPA URL) to TestingBot Storage for Mobile App Test
|
|
|
162
335
|
@api.upload_remote_file(remoteFileUrl)
|
|
163
336
|
```
|
|
164
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
|
+
|
|
165
346
|
### get_uploaded_files
|
|
166
|
-
Retrieves files previously uploaded TestingBot Storage for Mobile App Testing.
|
|
347
|
+
Retrieves files previously uploaded to TestingBot Storage for Mobile App Testing.
|
|
167
348
|
|
|
168
349
|
```ruby
|
|
169
|
-
@api.get_uploaded_files(offset = 0, count =
|
|
350
|
+
@api.get_uploaded_files(offset = 0, count = 10)
|
|
170
351
|
```
|
|
171
352
|
|
|
172
353
|
### get_uploaded_file
|
|
@@ -177,26 +358,65 @@ Retrieves meta-data for a file previously uploaded to TestingBot Storage.
|
|
|
177
358
|
```
|
|
178
359
|
|
|
179
360
|
### delete_uploaded_file
|
|
180
|
-
Deletes a previously uploaded file
|
|
361
|
+
Deletes a previously uploaded file. Returns `true`/`false`.
|
|
181
362
|
|
|
182
363
|
```ruby
|
|
183
|
-
@api.delete_uploaded_file(
|
|
364
|
+
@api.delete_uploaded_file(app_url)
|
|
184
365
|
```
|
|
185
366
|
|
|
186
|
-
###
|
|
187
|
-
Uploads a remote file (APK or IPA URL) to TestingBot Storage for Mobile App Testing.
|
|
367
|
+
### Codeless Lab tests
|
|
188
368
|
|
|
189
369
|
```ruby
|
|
190
|
-
@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 = {})
|
|
191
402
|
```
|
|
192
403
|
|
|
193
404
|
### get_authentication_hash
|
|
194
|
-
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}")`.
|
|
195
407
|
|
|
196
408
|
```ruby
|
|
197
409
|
@api.get_authentication_hash(identifier)
|
|
198
410
|
```
|
|
199
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
|
+
|
|
200
420
|
## Contributing
|
|
201
421
|
|
|
202
422
|
1. Fork this repository
|
|
@@ -204,4 +424,3 @@ Calculates the hash necessary to share tests with other people
|
|
|
204
424
|
3. Commit your changes (`git commit -am 'Add some feature'`)
|
|
205
425
|
4. Push to the branch (`git push origin my-new-feature`)
|
|
206
426
|
5. Create new Pull Request
|
|
207
|
-
|
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
|