Skip to content

Commit 3fcc330

Browse files
authored
Implement read access tests and remove redundant tests (#74)
* Implement read access tests and remove redundant tests * Config changes for CSS v3 and skipping publicagent tests
1 parent f8f5024 commit 3fcc330

23 files changed

Lines changed: 809 additions & 665 deletions

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Solid Specification Conformance Tests
22

3+
## Release 0.0.9
4+
* Remove unused converted tests.
5+
* Add data driven tests for reading protected resources.
6+
37
## Release 0.0.8
48
* Test CORS support.
59

README.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
- [HTTP related keywords](#http-related-keywords)
1010
- [Karate Object](#karate-object)
1111
- [Calling Functions](#calling-functions)
12+
- [Data driven tests](#data-driven-tests)
1213
- [Comments](#comments)
1314
- [Test Harness Capabilities](#test-harness-capabilities)
1415
- [Global Variables](#global-variables)
@@ -394,6 +395,28 @@ difference between *BeforeEach* and *BeforeAll* in other testing frameworks. You
394395
```
395396
Although the `Background` is run for every `Scenario`, the function will only be called once.
396397
398+
## Data driven tests
399+
When a group of tests are very similar it is good to use a `Scenario Outline` with `Examples` to set up tests on a data-
400+
driven basis. There is a good description of this here: https://github.com/karatelabs/karate#data-driven-tests and an
401+
example below.
402+
```gherkin
403+
Scenario Outline: Test status <status> with <method>
404+
Given url 'https://httpbin.org/status/<status>'
405+
When method <method>
406+
Then status <status>
407+
Examples:
408+
| method | status |
409+
| GET | 200 |
410+
| GET | 300 |
411+
| DELETE | 400 |
412+
```
413+
414+
This runs 3 tests, replacing placeholders in the scenario name and throughout the test. This is a simple example and the
415+
documentation linked above shows more possibilities, including generating tests in a function call.
416+
417+
*Note* If you are putting non-string data (e.g. a boolean or json) in a column then add `!` as a suffix to the column
418+
name to make Karate handle the values correctly.
419+
397420
## Comments
398421
Comments in Karate test files are handled according to their position in the file. When they are added to reports this
399422
is done with the `dcterms:description` predicate, applied as follows:

protocol/converted.ttl

Lines changed: 0 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -8,38 +8,6 @@ prefix sopr: <https://solidproject.org/TR/protocol#>
88

99
prefix manifest: <#>
1010

11-
manifest:converted-test1-1
12-
a td:TestCase ;
13-
# spec:requirementReference sopr:resource-representations ;
14-
td:reviewStatus td:unreviewed ;
15-
spec:testScript
16-
<https://github.com/solid/specification-tests/blob/main/protocol/converted/test_1-1.feature> ;
17-
dcterms:description "Create: PUT Turtle resources to container with varying LDP Interaction Models."@en .
18-
19-
manifest:converted-test1-3
20-
a td:TestCase ;
21-
# spec:requirementReference sopr:resource-representations ;
22-
td:reviewStatus td:unreviewed ;
23-
spec:testScript
24-
<https://github.com/solid/specification-tests/blob/main/protocol/converted/test_1-3.feature> ;
25-
dcterms:description "Update: PUT Turtle resources to container with varying LDP Interaction Models."@en .
26-
27-
manifest:converted-test1-4
28-
a td:TestCase ;
29-
# spec:requirementReference sopr:resource-representations ;
30-
td:reviewStatus td:unreviewed ;
31-
spec:testScript
32-
<https://github.com/solid/specification-tests/blob/main/protocol/converted/test_1-4.feature> ;
33-
dcterms:description "Create: PUT Turtle resources to into a deep hierarchy."@en .
34-
35-
manifest:converted-test1-5
36-
a td:TestCase ;
37-
# spec:requirementReference sopr:resource-representations ;
38-
td:reviewStatus td:unreviewed ;
39-
spec:testScript
40-
<https://github.com/solid/specification-tests/blob/main/protocol/converted/test_1-5.feature> ;
41-
dcterms:description "Update: PUT text resources to container with no Interaction Model."@en .
42-
4311
manifest:converted-test2-1
4412
a td:TestCase ;
4513
# spec:requirementReference sopr:resource-representations ;
@@ -48,14 +16,6 @@ manifest:converted-test2-1
4816
<https://github.com/solid/specification-tests/blob/main/protocol/converted/test_2-1.feature> ;
4917
dcterms:description "Create containers"@en .
5018

51-
manifest:converted-test3-1
52-
a td:TestCase ;
53-
# spec:requirementReference sopr:resource-representations ;
54-
td:reviewStatus td:unreviewed ;
55-
spec:testScript
56-
<https://github.com/solid/specification-tests/blob/main/protocol/converted/test_3-1.feature> ;
57-
dcterms:description "Check that Bob can only read Basic Container when he is authorized read only."@en .
58-
5919
manifest:converted-test3-3
6020
a td:TestCase ;
6121
# spec:requirementReference sopr:resource-representations ;
@@ -80,14 +40,6 @@ manifest:converted-test3-7
8040
<https://github.com/solid/specification-tests/blob/main/protocol/converted/test_3-7.feature> ;
8141
dcterms:description "Check that Bob can read and write to Basic Container when he is authorized read-write."@en .
8242

83-
manifest:converted-test4-1
84-
a td:TestCase ;
85-
# spec:requirementReference sopr:resource-representations ;
86-
td:reviewStatus td:unreviewed ;
87-
spec:testScript
88-
<https://github.com/solid/specification-tests/blob/main/protocol/converted/test_4-1.feature> ;
89-
dcterms:description "Check that Bob can only read RDF resource when he is authorized read only."@en .
90-
9143
manifest:converted-test4-3
9244
a td:TestCase ;
9345
# spec:requirementReference sopr:resource-representations ;
@@ -120,14 +72,6 @@ manifest:converted-test4-9
12072
<https://github.com/solid/specification-tests/blob/main/protocol/converted/test_4-9.feature> ;
12173
dcterms:description "Check that Bob can't delete RDF resource when he is only authorized read-write on the container."@en .
12274

123-
manifest:converted-test5-1
124-
a td:TestCase ;
125-
# spec:requirementReference sopr:resource-representations ;
126-
td:reviewStatus td:unreviewed ;
127-
spec:testScript
128-
<https://github.com/solid/specification-tests/blob/main/protocol/converted/test_5-1.feature> ;
129-
dcterms:description "Check that Bob can only read Non-RDF resource when he is authorized read only."@en .
130-
13175
manifest:converted-test5-3
13276
a td:TestCase ;
13377
# spec:requirementReference sopr:resource-representations ;

protocol/converted/test_1-1.feature

Lines changed: 0 additions & 55 deletions
This file was deleted.

protocol/converted/test_1-3.feature

Lines changed: 0 additions & 65 deletions
This file was deleted.

protocol/converted/test_1-4.feature

Lines changed: 0 additions & 75 deletions
This file was deleted.

protocol/converted/test_1-5.feature

Lines changed: 0 additions & 36 deletions
This file was deleted.

0 commit comments

Comments
 (0)