@schwabyio/gta 0.12.0 → 0.13.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.
- package/README.md +4 -0
- package/dist/FUNCTIONS.md +560 -0
- package/dist/SPEC.md +221 -49
- package/dist/chunks/{chunk-3NSHWS24.js → chunk-ABBBM5UZ.js} +627 -91
- package/dist/gta.js +18 -5
- package/dist/worker.js +1 -1
- package/package.json +1 -1
package/dist/SPEC.md
CHANGED
|
@@ -388,27 +388,31 @@ key**, in capitals, whose value is the URL as a string.
|
|
|
388
388
|
|
|
389
389
|
Methods: `GET`, `POST`, `PUT`, `PATCH`, `DELETE`, `HEAD`, `OPTIONS`.
|
|
390
390
|
|
|
391
|
-
| Key
|
|
392
|
-
|
|
|
393
|
-
| `<METHOD>`
|
|
394
|
-
| `name`
|
|
395
|
-
| `headers`
|
|
396
|
-
| `body`
|
|
397
|
-
| `settings`
|
|
398
|
-
| `before`
|
|
399
|
-
| `tests`
|
|
400
|
-
| `tags`
|
|
401
|
-
| `flags`
|
|
402
|
-
| `forEach`
|
|
403
|
-
| `useTests`
|
|
404
|
-
| `
|
|
405
|
-
| `
|
|
406
|
-
|
|
407
|
-
|
|
391
|
+
| Key | Type | Required | Meaning |
|
|
392
|
+
| ------------ | ------------ | -------- | ------------------------------------------------------------------------- |
|
|
393
|
+
| `<METHOD>` | string | **yes** | The URL, query string included. |
|
|
394
|
+
| `name` | string | no | Display name. Defaults to the method and URL. |
|
|
395
|
+
| `headers` | map | no | Over the collection's headers (§2.3). |
|
|
396
|
+
| `body` | map | no | Exactly one kind of body (§2.2). |
|
|
397
|
+
| `settings` | map | no | Over the collection's settings (§2.3). |
|
|
398
|
+
| `before` | map | no | `script:` run before the request (§5). |
|
|
399
|
+
| `tests` | string | no | The checks, as JavaScript: calls on `gta` (§3) and any other code (§5). |
|
|
400
|
+
| `tags` | list of tags | no | The step's own tags. Only with `stepTags: true` on the collection (§2.4). |
|
|
401
|
+
| `flags` | map | no | Feature flags the step needs (§2.9). |
|
|
402
|
+
| `forEach` | string | no | Send the request once for each item of a list (below). |
|
|
403
|
+
| `useTests` | `true` | no | In a request set: the use step's `tests` check this response (§2.5). |
|
|
404
|
+
| `connection` | string | no | Keep the event stream this request opens as a connection (§2.11). |
|
|
405
|
+
| `base` | `false` | no | `false` leaves the step's endpoint base out (§2.6). |
|
|
406
|
+
| `docs` | string | no | Markdown. |
|
|
407
|
+
|
|
408
|
+
- A step with two method keys is an error, and so is a step with none, unless it is a
|
|
409
|
+
use step or reads a connection.
|
|
408
410
|
- **The URL is authoritative, query string included.** There is no separate block of
|
|
409
411
|
query parameters. Editors show a parameter table as a view over the URL.
|
|
410
412
|
- A step may instead run a request set with `use:` (§2.5). A use step has no method
|
|
411
413
|
key.
|
|
414
|
+
- A step may also read a connection, an event stream an earlier step keeps open, with
|
|
415
|
+
`connection:` and no method key (§2.11).
|
|
412
416
|
- **Any other key is an error**, so a misspelled key such as `heders:` fails at once
|
|
413
417
|
rather than being ignored. A method key in lower case (`get:`) is reported as such.
|
|
414
418
|
|
|
@@ -532,12 +536,65 @@ body:
|
|
|
532
536
|
**`settings`** on a collection apply to every step; a step's own settings merge over
|
|
533
537
|
them. Any other key is an error.
|
|
534
538
|
|
|
535
|
-
| Key | Type | Default | Meaning
|
|
536
|
-
| ----------------- | ----------- | ------- |
|
|
537
|
-
| `timeout` | number ≥ 0 | `0` | Milliseconds for the whole request; `0` means no limit.
|
|
538
|
-
| `followRedirects` | boolean | `true` | Follow 3xx responses.
|
|
539
|
-
| `maxRedirects` | integer ≥ 0 | `5` | The most redirects followed.
|
|
540
|
-
| `encodeUrl` | boolean | `true` | Percent-encode what a hand-typed URL left raw, before sending.
|
|
539
|
+
| Key | Type | Default | Meaning |
|
|
540
|
+
| ----------------- | ----------- | ------- | ------------------------------------------------------------------------------------------------------ |
|
|
541
|
+
| `timeout` | number ≥ 0 | `0` | Milliseconds for the whole request; `0` means no limit. For an event stream, until its headers arrive. |
|
|
542
|
+
| `followRedirects` | boolean | `true` | Follow 3xx responses. |
|
|
543
|
+
| `maxRedirects` | integer ≥ 0 | `5` | The most redirects followed. |
|
|
544
|
+
| `encodeUrl` | boolean | `true` | Percent-encode what a hand-typed URL left raw, before sending. |
|
|
545
|
+
| `maxEvents` | integer ≥ 0 | `0` | Stop reading an event stream after this many events; `0` means no limit. |
|
|
546
|
+
| `streamTimeout` | number ≥ 0 | `0` | Stop reading an event stream this many milliseconds after its headers; `0` means no limit. |
|
|
547
|
+
| `untilEvent` | string | none | Stop reading an event stream after the first event of this name, its `event:` line. |
|
|
548
|
+
|
|
549
|
+
**Event streams.** A response whose `Content-Type` is `text/event-stream` (Server-Sent
|
|
550
|
+
Events) is read as it arrives, whatever the method, and checked as a list of events
|
|
551
|
+
(§3). Nothing in the step marks it as a stream. Reading stops at whichever comes first:
|
|
552
|
+
|
|
553
|
+
- the server closes the stream
|
|
554
|
+
- `maxEvents` events have arrived
|
|
555
|
+
- `streamTimeout` milliseconds have passed since its headers arrived
|
|
556
|
+
- the first event named `untilEvent` has arrived
|
|
557
|
+
- 1,000 events or 10 MB, a limit no setting lifts
|
|
558
|
+
|
|
559
|
+
```yaml
|
|
560
|
+
- name: price stream
|
|
561
|
+
GET: '{{baseUrl}}/prices/stream?symbol=ACME'
|
|
562
|
+
headers:
|
|
563
|
+
Accept: text/event-stream
|
|
564
|
+
settings:
|
|
565
|
+
maxEvents: 3
|
|
566
|
+
streamTimeout: 5000
|
|
567
|
+
tests: |
|
|
568
|
+
gta.expectResponseStatusCodeToBe(200)
|
|
569
|
+
gta.expectResponseBodyToHaveProperty('[0].event', 'subscribed')
|
|
570
|
+
gta.expectResponseBodyToHaveProperty('[1].data.price', 100)
|
|
571
|
+
```
|
|
572
|
+
|
|
573
|
+
- Each way of stopping is a normal end, not an error, and the checks run on the events
|
|
574
|
+
that arrived. A check that wanted more fails with the path it missed.
|
|
575
|
+
- Stopped at a number of events, the body ends with the last one.
|
|
576
|
+
- Cancel, or a connection that drops mid-stream, is an error, as for any request.
|
|
577
|
+
- `maxEvents`, `streamTimeout` and `untilEvent` do nothing to any other response.
|
|
578
|
+
- In the desktop app, the events show as they arrive, and Stop ends the reading as
|
|
579
|
+
these do, so the checks run on what came.
|
|
580
|
+
- A step that keeps its stream open for later steps is a connection (§2.11).
|
|
581
|
+
|
|
582
|
+
**Resuming.** A stream is never reconnected: the server closing it ends the step. To
|
|
583
|
+
test that a stream resumes, capture the last event's id and send it as `Last-Event-ID`
|
|
584
|
+
in a later step:
|
|
585
|
+
|
|
586
|
+
```yaml
|
|
587
|
+
- name: first part
|
|
588
|
+
GET: '{{baseUrl}}/feed'
|
|
589
|
+
tests: |
|
|
590
|
+
gta.set('lastId', res.body.at(-1).id)
|
|
591
|
+
- name: the rest
|
|
592
|
+
GET: '{{baseUrl}}/feed'
|
|
593
|
+
headers:
|
|
594
|
+
Last-Event-ID: '{{lastId}}'
|
|
595
|
+
tests: |
|
|
596
|
+
gta.expectResponseBodyToHaveProperty('[0].id', '4')
|
|
597
|
+
```
|
|
541
598
|
|
|
542
599
|
**`headers`** is a map from header name to one of:
|
|
543
600
|
|
|
@@ -934,12 +991,73 @@ steps: # once per row of approved-domains.csv, as before
|
|
|
934
991
|
- Reports name their results `setup › log in` and `teardown › remove the grant`. Running
|
|
935
992
|
a single step in the desktop app does not run them.
|
|
936
993
|
|
|
994
|
+
### 2.11 Connections: a stream across steps
|
|
995
|
+
|
|
996
|
+
A request whose response is an event stream (§2.3) can keep it open for later steps, as
|
|
997
|
+
a **connection** named by `connection:`. A later step with `connection:` and no method
|
|
998
|
+
key sends nothing: it reads the events the connection holds. The steps between can do
|
|
999
|
+
what those events are about:
|
|
1000
|
+
|
|
1001
|
+
```yaml
|
|
1002
|
+
steps:
|
|
1003
|
+
- name: watch orders
|
|
1004
|
+
GET: '{{baseUrl}}/orders/events'
|
|
1005
|
+
connection: orders # keep the stream open as "orders"
|
|
1006
|
+
settings:
|
|
1007
|
+
untilEvent: subscribed # read until the server confirms, then go on
|
|
1008
|
+
- name: place order
|
|
1009
|
+
POST: '{{baseUrl}}/orders'
|
|
1010
|
+
body:
|
|
1011
|
+
json: '{ "sku": "ACME-1" }'
|
|
1012
|
+
tests: |
|
|
1013
|
+
gta.expectResponseBodyToHaveProperty('id', 'orderId', 'setAsCollectionVariable')
|
|
1014
|
+
- name: order created
|
|
1015
|
+
connection: orders # no method key: reads the connection
|
|
1016
|
+
settings:
|
|
1017
|
+
untilEvent: order.created
|
|
1018
|
+
streamTimeout: 5000
|
|
1019
|
+
tests: |
|
|
1020
|
+
gta.expectResponseBodyToHaveProperty('[0].event', 'order.created')
|
|
1021
|
+
gta.test('the order placed', () => assert.equal(res.body[0].data.id, gta.get('orderId')))
|
|
1022
|
+
```
|
|
1023
|
+
|
|
1024
|
+
- **Opening.** The step sends its request and reads the stream as any step does, until
|
|
1025
|
+
its `maxEvents`, `streamTimeout` or `untilEvent`. Then, rather than closing it, it
|
|
1026
|
+
keeps reading in the background, holding the events that arrive for the next step
|
|
1027
|
+
that reads the connection. With none of the three set, it reads no events and goes
|
|
1028
|
+
straight on.
|
|
1029
|
+
- **Reading.** A reading step takes the events held since the last step read them,
|
|
1030
|
+
then waits for more, until its `maxEvents`, `streamTimeout` or `untilEvent`, or the
|
|
1031
|
+
server closes the stream. With none of the three set, it takes what is held and ends
|
|
1032
|
+
without waiting, as `held`.
|
|
1033
|
+
- **What a reading step sees.** Its body is the events it took (§3). Its status and
|
|
1034
|
+
headers are those of the response that opened the connection, `req` is that request,
|
|
1035
|
+
and `res.stream.at` counts from that response's headers.
|
|
1036
|
+
- A reading step may have `name`, `settings`, `before`, `tests`, `tags`, `flags`,
|
|
1037
|
+
`useTests` and `docs`, and nothing that would build a request: no `headers`, `body`,
|
|
1038
|
+
`base` or `forEach`. A step opening a connection has no `forEach`, and a use step has
|
|
1039
|
+
no `connection`.
|
|
1040
|
+
- **A connection lasts the run.** One opened in `setup` is read by every data row; one
|
|
1041
|
+
opened in a row, by that row's later steps. Every connection closes when the run ends,
|
|
1042
|
+
cancelled or not. A step opening a name already open closes the old connection first,
|
|
1043
|
+
whatever its own response is.
|
|
1044
|
+
- A connection the server closes keeps the events it held: the next step reads them,
|
|
1045
|
+
then ends with `close`. A connection holds at most 1,000 events or 10 MB; at that it
|
|
1046
|
+
stops reading, and the step that reads it ends with `limit`.
|
|
1047
|
+
- Reading a connection no step has opened is an error, and the step's scripts do not
|
|
1048
|
+
run.
|
|
1049
|
+
- **In the desktop app**, a connection opened by sending a step stays open for the steps
|
|
1050
|
+
sent after it, until that step is sent again, the connection is closed from above the
|
|
1051
|
+
step list, Run all starts, or the app quits. Run all, like `gta`, opens its own and
|
|
1052
|
+
closes them when it ends.
|
|
1053
|
+
|
|
937
1054
|
---
|
|
938
1055
|
|
|
939
1056
|
## 3. Checking a response
|
|
940
1057
|
|
|
941
|
-
A step's checks are calls to
|
|
942
|
-
|
|
1058
|
+
A step's checks are calls to functions on `gta`, in its `tests` (§5 lists them).
|
|
1059
|
+
[FUNCTIONS.md](./FUNCTIONS.md) documents each one, with examples. This section is the
|
|
1060
|
+
rules they share.
|
|
943
1061
|
|
|
944
1062
|
```yaml
|
|
945
1063
|
tests: |
|
|
@@ -962,14 +1080,14 @@ A key that holds a `.`, `[` or `]`, or is empty, goes in brackets as a JSON stri
|
|
|
962
1080
|
`jwt.payload["https://example.com/id"]`, `modules[""].edition`. Reports show such keys
|
|
963
1081
|
the same way.
|
|
964
1082
|
|
|
965
|
-
|
|
1083
|
+
A path can also be a list of keys: `['jwt', 'payload', 'https://example.com/id']`.
|
|
966
1084
|
Each item is one key, whatever it holds, and a number is its digits, so
|
|
967
1085
|
`['groups', 0, 'name']` reads an index. Every function that takes a path takes a list
|
|
968
1086
|
too, and so does `pathToProperty`.
|
|
969
1087
|
|
|
970
1088
|
A path that runs into a `null` before its end, such as `phoneNumber.number` when
|
|
971
|
-
`phoneNumber` is `null`, reads as that `null` for a check that the value is `null
|
|
972
|
-
|
|
1089
|
+
`phoneNumber` is `null`, reads as that `null` for a check that the value is `null`. For
|
|
1090
|
+
any other check the property is not present.
|
|
973
1091
|
|
|
974
1092
|
### Body conversion
|
|
975
1093
|
|
|
@@ -978,6 +1096,37 @@ top-level key, namespace prefixes and attributes are dropped, an element holding
|
|
|
978
1096
|
text becomes that string (an empty one `""`), and a repeated element becomes an array.
|
|
979
1097
|
A `text/plain` or HTML body is the single property `plaintext`.
|
|
980
1098
|
|
|
1099
|
+
An event stream (§2.3) is a list with one item per event:
|
|
1100
|
+
|
|
1101
|
+
- **`data`** is the event's `data:` lines joined with a line feed: their JSON value when
|
|
1102
|
+
they parse as JSON, so `[1].data.price` is a number, and otherwise the text, such as
|
|
1103
|
+
`[DONE]`.
|
|
1104
|
+
- **`event`** and **`id`** are there only when that event's own lines set them. Neither
|
|
1105
|
+
carries over to the next event.
|
|
1106
|
+
- Comments (`: heartbeat`) and a block with no `data:` are not events, `retry:` is not
|
|
1107
|
+
kept, and an event the stream ended in the middle of is dropped.
|
|
1108
|
+
|
|
1109
|
+
```text
|
|
1110
|
+
event: price
|
|
1111
|
+
id: 41
|
|
1112
|
+
data: {"symbol":"ACME","price":100}
|
|
1113
|
+
|
|
1114
|
+
: heartbeat
|
|
1115
|
+
|
|
1116
|
+
data: [DONE]
|
|
1117
|
+
|
|
1118
|
+
```
|
|
1119
|
+
|
|
1120
|
+
reads as
|
|
1121
|
+
|
|
1122
|
+
```json
|
|
1123
|
+
[{ "event": "price", "id": "41", "data": { "symbol": "ACME", "price": 100 } }, { "data": "[DONE]" }]
|
|
1124
|
+
```
|
|
1125
|
+
|
|
1126
|
+
The path `''` is the whole list, so `expectResponseBodyToHaveUnorderedArray('', …)` finds
|
|
1127
|
+
events whose order is not guaranteed. Under strict validation every event's properties
|
|
1128
|
+
need accounting for, so a small `maxEvents` keeps a busy stream practical.
|
|
1129
|
+
|
|
981
1130
|
### Values and patterns
|
|
982
1131
|
|
|
983
1132
|
- A value compares with its type: `'12345'` does not equal `12345`.
|
|
@@ -1008,7 +1157,9 @@ saying so, and the checks after it still run.
|
|
|
1008
1157
|
### Unordered arrays
|
|
1009
1158
|
|
|
1010
1159
|
`gta.expectResponseBodyToHaveUnorderedArray(path, list)` passes when the array holds
|
|
1011
|
-
every item of a simple `list`, in any order.
|
|
1160
|
+
every item of a simple `list`, in any order. A `RegExp` in the list is a pattern some item
|
|
1161
|
+
must match as text, and so is one held by an object in the list:
|
|
1162
|
+
`[/^admin/, { name: /^Grace/ }]`. A pattern never matches an object or array item.
|
|
1012
1163
|
|
|
1013
1164
|
A list of `{ pathToProperty, expectedValue, specialHandling? }` objects describes **one**
|
|
1014
1165
|
item, property by property; call it once per item. A property may appear twice, once to
|
|
@@ -1022,15 +1173,16 @@ gta.expectResponseBodyToHaveUnorderedArray('users', [
|
|
|
1022
1173
|
```
|
|
1023
1174
|
|
|
1024
1175
|
`gta.expectResponseBodyToHaveUnorderedArrayNotThisItem(path, list)` passes when no item
|
|
1025
|
-
matches. A `compareValue` may be a
|
|
1176
|
+
matches. A simple list may hold patterns here too, and a `compareValue` may be a
|
|
1177
|
+
`RegExp`.
|
|
1026
1178
|
|
|
1027
1179
|
- **Each call prefers items an earlier call did not match.** Two calls with the same
|
|
1028
1180
|
description find two items when there are two, so each capture and strict validation
|
|
1029
1181
|
see a different one. A sort starts this over, since its indexes name other items.
|
|
1030
|
-
- **A list of one `notThisExpectedValue` entry
|
|
1031
|
-
|
|
1032
|
-
means one item whose value is something else, as any list does. The step's last
|
|
1033
|
-
on strict validation decides.
|
|
1182
|
+
- **A list of one `notThisExpectedValue` entry depends on strict validation.** Without
|
|
1183
|
+
it, the entry means no item has that value, so an empty array passes. With it, the
|
|
1184
|
+
entry means one item whose value is something else, as any list does. The step's last
|
|
1185
|
+
word on strict validation decides.
|
|
1034
1186
|
|
|
1035
1187
|
### Strict validation
|
|
1036
1188
|
|
|
@@ -1159,8 +1311,8 @@ request, and `tests` checks the response:
|
|
|
1159
1311
|
|
|
1160
1312
|
### The `gta` object
|
|
1161
1313
|
|
|
1162
|
-
|
|
1163
|
-
|
|
1314
|
+
There is nothing to import or load. [FUNCTIONS.md](./FUNCTIONS.md) documents each
|
|
1315
|
+
function, with examples.
|
|
1164
1316
|
|
|
1165
1317
|
| Function | In `before.script` |
|
|
1166
1318
|
| ------------------------------------------------------------------------------------------------ | :----------------: |
|
|
@@ -1196,20 +1348,35 @@ row, and teardown, still run.
|
|
|
1196
1348
|
|
|
1197
1349
|
`gta.date` formats with strftime specifiers: `%Y %y %m %d %e %H %I %M %S %L %p %b %B %a
|
|
1198
1350
|
%A %j %Z %z %s %F %T %%`. An unrecognized specifier is left in the output, so a typo is
|
|
1199
|
-
visible. `timeZone` is `local`, `utc`, an IANA name such as `America/New_York`, or
|
|
1200
|
-
|
|
1351
|
+
visible. `timeZone` is `local`, `utc`, an IANA name such as `America/New_York`, or a
|
|
1352
|
+
military zone letter (`U` is -08:00, not UTC).
|
|
1201
1353
|
|
|
1202
1354
|
### Other globals
|
|
1203
1355
|
|
|
1204
|
-
| Global | What it is
|
|
1205
|
-
| ---------- |
|
|
1206
|
-
| `res` | `tests` only: `status`, `statusText`, `headers` (lower-cased names), `header(name)`, `body` (parsed JSON, converted XML, or text), `text`, `time` (ms), `size` (bytes). |
|
|
1207
|
-
| `req` | `method`, `url`, `headers`, `body`: as sent in `tests`, as written in `before.script`, where a script may change `headers` and `body` (below).
|
|
1208
|
-
| `assert` | Node's strict `assert`, for use inside `gta.test`.
|
|
1209
|
-
| `console` | Captured into the step's result.
|
|
1210
|
-
| `params` | A request set's params (§2.5), in its own scripts and in the tests of the use step running it.
|
|
1211
|
-
| `endpoint` | An endpoint base's `{name}` values (§2.6), in its scripts and in every script of a step under it.
|
|
1212
|
-
| `checks` | The project's check files (below).
|
|
1356
|
+
| Global | What it is |
|
|
1357
|
+
| ---------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
1358
|
+
| `res` | `tests` only: `status`, `statusText`, `headers` (lower-cased names), `header(name)`, `body` (parsed JSON, converted XML, an event stream's events, or text), `text`, `time` (ms), `size` (bytes), and for an event stream `stream` (below). |
|
|
1359
|
+
| `req` | `method`, `url`, `headers`, `body`: as sent in `tests`, as written in `before.script`, where a script may change `headers` and `body` (below). |
|
|
1360
|
+
| `assert` | Node's strict `assert`, for use inside `gta.test`. |
|
|
1361
|
+
| `console` | Captured into the step's result. |
|
|
1362
|
+
| `params` | A request set's params (§2.5), in its own scripts and in the tests of the use step running it. |
|
|
1363
|
+
| `endpoint` | An endpoint base's `{name}` values (§2.6), in its scripts and in every script of a step under it. |
|
|
1364
|
+
| `checks` | The project's check files (below). |
|
|
1365
|
+
|
|
1366
|
+
**`res` for an event stream** (§2.3): `res.body` is its list of events, as checks see it
|
|
1367
|
+
(§3), `res.text` the stream as received, and `res.time` runs until the reading stopped.
|
|
1368
|
+
`res.stream` has the rest, and is absent for any other response:
|
|
1369
|
+
|
|
1370
|
+
- `endedBy`: what stopped the reading: `close`, `maxEvents`, `streamTimeout`,
|
|
1371
|
+
`untilEvent`, `limit`, `stopped` (the desktop app's Stop button), or `held` (a step on
|
|
1372
|
+
a connection that waited for nothing, §2.11)
|
|
1373
|
+
- `at`: for each event, the milliseconds from the response headers to its arrival
|
|
1374
|
+
- `connection`: for a step that opens or reads a connection, `{ name, open }`: its name,
|
|
1375
|
+
and whether it was still open when the step ended
|
|
1376
|
+
|
|
1377
|
+
```js
|
|
1378
|
+
gta.test('first price within 2s', () => assert.ok(res.stream.at[0] < 2000))
|
|
1379
|
+
```
|
|
1213
1380
|
|
|
1214
1381
|
Also available are the language itself and the web-standard globals: timers, `URL`,
|
|
1215
1382
|
`URLSearchParams`, `TextEncoder`, `TextDecoder`, `atob`, `btoa`, `structuredClone` and
|
|
@@ -1360,7 +1527,8 @@ it. Rules checked at run time fail the step, or the run, before anything is sent
|
|
|
1360
1527
|
**Steps**
|
|
1361
1528
|
|
|
1362
1529
|
- A step has exactly one method key, out of `GET`, `POST`, `PUT`, `PATCH`, `DELETE`,
|
|
1363
|
-
`HEAD` and `OPTIONS`, in capitals, and its value is a string.
|
|
1530
|
+
`HEAD` and `OPTIONS`, in capitals, and its value is a string. A use step and a step
|
|
1531
|
+
reading a connection have none.
|
|
1364
1532
|
- A step has no key outside the table in §2.1.
|
|
1365
1533
|
- A use step has no method key, `headers`, `body`, `settings` or `before`. `with` is used
|
|
1366
1534
|
only with `use`.
|
|
@@ -1369,6 +1537,8 @@ it. Rules checked at run time fail the step, or the run, before anything is sent
|
|
|
1369
1537
|
- `base` is only ever `false`.
|
|
1370
1538
|
- `forEach` is a string, and a use step has none.
|
|
1371
1539
|
- `useTests` is only ever `true`, only on a request set's step, and on one step at most.
|
|
1540
|
+
- A step reading a connection has no `headers`, `body`, `base` or `forEach`. A step
|
|
1541
|
+
opening one has no `forEach`, and a use step has no `connection` (§2.11).
|
|
1372
1542
|
|
|
1373
1543
|
**Values**
|
|
1374
1544
|
|
|
@@ -1377,6 +1547,7 @@ it. Rules checked at run time fail the step, or the run, before anything is sent
|
|
|
1377
1547
|
- A tag matches `^[A-Za-z0-9._:-]+$`.
|
|
1378
1548
|
- A flag name matches `^[A-Za-z0-9_][A-Za-z0-9_.-]*$`, and a flag value is a string,
|
|
1379
1549
|
number or boolean.
|
|
1550
|
+
- A connection name matches `^[A-Za-z0-9_][A-Za-z0-9_.-]*$`.
|
|
1380
1551
|
- A `settings` value has its type in §2.3.
|
|
1381
1552
|
|
|
1382
1553
|
**Bodies**
|
|
@@ -1394,7 +1565,7 @@ it. Rules checked at run time fail the step, or the run, before anything is sent
|
|
|
1394
1565
|
- A base collection (`bases/`) has no `steps`, `setup`, `teardown` or `params`, and no
|
|
1395
1566
|
`extends`.
|
|
1396
1567
|
- An endpoint (`endpoints/`) has a URL that is a path starting with `/`, and no use
|
|
1397
|
-
steps. An endpoints file has no `setup` or `teardown`.
|
|
1568
|
+
steps or connections. An endpoints file has no `setup` or `teardown`.
|
|
1398
1569
|
- A check file's name is a JavaScript identifier; if it isn't, the file is not loaded.
|
|
1399
1570
|
- `collections/`, `requests/`, `endpoints/` and `bases/` hold files at most one directory
|
|
1400
1571
|
down.
|
|
@@ -1430,6 +1601,7 @@ it. Rules checked at run time fail the step, or the run, before anything is sent
|
|
|
1430
1601
|
`gta get` checks these, and the body files named without `{{variables}}`, without
|
|
1431
1602
|
running anything (§1.3).
|
|
1432
1603
|
- A step's `forEach` resolves to a JSON array.
|
|
1604
|
+
- A step reading a connection finds it open: a step before it in the run opened it.
|
|
1433
1605
|
- In `{{@name}}`, `name` holds text naming a variable that exists.
|
|
1434
1606
|
- A `before.script` sets `req.body` to text, and only for a `json`, `xml`, `text` or
|
|
1435
1607
|
`graphql` body; `req.headers` stays a map.
|