Skip to content
This repository has been archived by the owner on May 14, 2020. It is now read-only.

Add Hypertest scenarios #104

Merged
merged 21 commits into from
Dec 19, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions .github/hypertest.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/bash
set -e

function finish() {
make logs stop
}

trap finish EXIT

make start wait-healthy

docker run --rm --init --network host --mount "type=bind,source=$(pwd)/test/hypertest/,destination=/tests" hydrofoil/hypertest:_0.4.0 --baseUri http://localhost:8080/
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ jobs:
- TARGET=dev .github/smoke-test.sh
- TARGET=prod .github/smoke-test.sh
- .github/analyse.sh
- .github/hypertest.sh
include:
- target: prod
test: TARGET=prod .github/smoke-test.sh
Expand Down
40 changes: 40 additions & 0 deletions test/hypertest/article.hydra
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
PREFIX hydra: <http://www.w3.org/ns/hydra/core#>
PREFIX schema: <http://schema.org/>

With Class schema:EntryPoint {
Expect Property schema:name
Expect Link hydra:collection
}

With Class hydra:Collection {
Expect Property hydra:title
Expect Property hydra:manages {
Expect Property hydra:property
Expect Property hydra:object
}
Expect Property hydra:totalItems
With Property hydra:member {
Expect Type schema:Article
Expect Property schema:name
}

Expect Operation schema:AddAction {
Invoke {
Content-Type "application/ld+json"
```
{
"@context": {
"schema": "http://schema.org/"
},
"@type": "schema:Article",
"schema:name": "My new article"
}
```
} => {
Expect Status 201
Expect Header Location [article]

Follow [article]
}
}
}