109 lines
3.3 KiB
YAML
109 lines
3.3 KiB
YAML
# Test success paths for document create, read, update and delete using
|
|
# multiple buckets.
|
|
#
|
|
# 1. Purges existing data to ensure test isolation
|
|
# 2. Adds documents to bucket a (partial layering sample from the design doc)
|
|
# 3. Verifies:
|
|
# - The documents have the expected revisions
|
|
# - The documents have the specified bucket
|
|
# 4. Adds documents to bucket b (remaining layering sample from design doc)
|
|
# 5. Verifies:
|
|
# - The documents have the expected revisions
|
|
# - The documents have the expected buckets
|
|
# 6. Verifies the previous revision is unchanged.
|
|
|
|
|
|
defaults:
|
|
request_headers:
|
|
content-type: application/x-yaml
|
|
# response_headers:
|
|
# content-type: application/x-yaml
|
|
verbose: true
|
|
|
|
tests:
|
|
- name: purge
|
|
desc: Begin testing from known state.
|
|
DELETE: /api/v1.0/revisions
|
|
status: 204
|
|
response_headers: {}
|
|
|
|
- name: create_a
|
|
desc: Create documents in one bucket (a)
|
|
PUT: /api/v1.0/buckets/a/documents
|
|
status: 200
|
|
response_headers:
|
|
content-type: application/x-yaml
|
|
data: <@resources/layering-needs-substitution-source.yaml
|
|
|
|
- name: verify_first_bucket
|
|
desc: Verify document count and revisions
|
|
GET: /api/v1.0/revisions/$RESPONSE['$.[0].status.revision']/documents
|
|
status: 200
|
|
response_headers:
|
|
content-type: application/x-yaml
|
|
response_multidoc_jsonpaths:
|
|
$.`len`: 3
|
|
$.[*].metadata.name:
|
|
- layering-policy
|
|
- abstract-1234
|
|
- concrete-1234
|
|
$.[*].status.revision:
|
|
- "$RESPONSE['$.[0].status.revision']"
|
|
- "$RESPONSE['$.[0].status.revision']"
|
|
- "$RESPONSE['$.[0].status.revision']"
|
|
$.[*].status.bucket:
|
|
- a
|
|
- a
|
|
- a
|
|
|
|
- name: create_b
|
|
desc: Create documents in a second bucket (b)
|
|
PUT: /api/v1.0/buckets/b/documents
|
|
status: 200
|
|
response_headers:
|
|
content-type: application/x-yaml
|
|
data: <@resources/passphrase.yaml
|
|
|
|
- name: verify_second_bucket
|
|
desc: Verify document count and revisions
|
|
GET: /api/v1.0/revisions/$RESPONSE['$.[0].status.revision']/documents
|
|
status: 200
|
|
response_multidoc_jsonpaths:
|
|
$.`len`: 4
|
|
$.[*].metadata.name:
|
|
- layering-policy
|
|
- abstract-1234
|
|
- concrete-1234
|
|
- my-passphrase
|
|
$.[*].status.revision:
|
|
- "$HISTORY['create_a'].$RESPONSE['$.[0].status.revision']"
|
|
- "$HISTORY['create_a'].$RESPONSE['$.[0].status.revision']"
|
|
- "$HISTORY['create_a'].$RESPONSE['$.[0].status.revision']"
|
|
- "$RESPONSE['$.[0].status.revision']"
|
|
$.[*].status.bucket:
|
|
- a
|
|
- a
|
|
- a
|
|
- b
|
|
|
|
- name: verify_first_revision_unchanged
|
|
desc: Verify initial revision is unchanged
|
|
GET: /api/v1.0/revisions/$HISTORY['create_a'].$RESPONSE['$.[0].status.revision']/documents
|
|
status: 200
|
|
response_headers:
|
|
content-type: application/x-yaml
|
|
response_multidoc_jsonpaths:
|
|
$.`len`: 3
|
|
$.[*].metadata.name:
|
|
- layering-policy
|
|
- abstract-1234
|
|
- concrete-1234
|
|
$.[*].status.revision:
|
|
- "$HISTORY['create_a'].$RESPONSE['$.[0].status.revision']"
|
|
- "$HISTORY['create_a'].$RESPONSE['$.[0].status.revision']"
|
|
- "$HISTORY['create_a'].$RESPONSE['$.[0].status.revision']"
|
|
$.[*].status.bucket:
|
|
- a
|
|
- a
|
|
- a
|