summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/annotation-model/examples
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 09:22:09 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 09:22:09 +0000
commit43a97878ce14b72f0981164f87f2e35e14151312 (patch)
tree620249daf56c0258faa40cbdcf9cfba06de2a846 /testing/web-platform/tests/annotation-model/examples
parentInitial commit. (diff)
downloadfirefox-43a97878ce14b72f0981164f87f2e35e14151312.tar.xz
firefox-43a97878ce14b72f0981164f87f2e35e14151312.zip
Adding upstream version 110.0.1.upstream/110.0.1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'testing/web-platform/tests/annotation-model/examples')
-rw-r--r--testing/web-platform/tests/annotation-model/examples/README.md9
-rw-r--r--testing/web-platform/tests/annotation-model/examples/example1.test10
-rw-r--r--testing/web-platform/tests/annotation-model/examples/example2.test42
-rw-r--r--testing/web-platform/tests/annotation-model/examples/example3.test8
-rw-r--r--testing/web-platform/tests/annotation-model/examples/exampleContext.json31
-rw-r--r--testing/web-platform/tests/annotation-model/examples/exampleTarget.json13
6 files changed, 113 insertions, 0 deletions
diff --git a/testing/web-platform/tests/annotation-model/examples/README.md b/testing/web-platform/tests/annotation-model/examples/README.md
new file mode 100644
index 0000000000..2b9dbd5c5a
--- /dev/null
+++ b/testing/web-platform/tests/annotation-model/examples/README.md
@@ -0,0 +1,9 @@
+Example Tests
+=============
+
+The tests in this folder are examples to show how the framework
+should be used. They are NOT intended for conformance testing use, and
+tools/make_tests.py will not generate the tests in this folder without the
+`--examples` option.
+
+
diff --git a/testing/web-platform/tests/annotation-model/examples/example1.test b/testing/web-platform/tests/annotation-model/examples/example1.test
new file mode 100644
index 0000000000..bd844f2320
--- /dev/null
+++ b/testing/web-platform/tests/annotation-model/examples/example1.test
@@ -0,0 +1,10 @@
+{
+ "@context": "https://www.w3.org/ns/JSONtest-v1.jsonld",
+ "name": "Verify annotation conforms to the model",
+ "description": "Supply an example annotation that conforms to the basic structure.",
+ "ref": "https://www.w3.org/TR/annotation-model/#model",
+ "assertions": [
+ "exampleContext.json",
+ "exampleTarget.json"
+ ]
+}
diff --git a/testing/web-platform/tests/annotation-model/examples/example2.test b/testing/web-platform/tests/annotation-model/examples/example2.test
new file mode 100644
index 0000000000..03b7589b8c
--- /dev/null
+++ b/testing/web-platform/tests/annotation-model/examples/example2.test
@@ -0,0 +1,42 @@
+{
+ "@context": "https://www.w3.org/ns/JSONtest-v1.jsonld",
+ "name": "A test that has an 'or' clause",
+ "description": "This is a complex test that uses or-ing among a list of assertions.",
+ "ref": "https://www.w3.org/TR/annotation-model/#model",
+ "testType": "manual",
+ "assertions":
+ { "title": "Condition Object",
+ "description": "A pseudo-test that will get a result from the aggregate of its children",
+ "assertionType": "must",
+ "expectedResult": "valid",
+ "errorMessage": "Error: None of the various options were present",
+ "compareWith": "or",
+ "assertions": [
+ {
+ "$schema": "http://json-schema.org/draft-04/schema#",
+ "title": "'The Annotation must have 1 or more @context values' (Section 3.1)",
+ "assertionType": "must",
+ "expectedResult": "valid",
+ "errorMessage": "Error: Annotation does not have an @context property.",
+ "type": "object",
+ "properties": {
+ "@context": {}
+ },
+ "required": ["@context"]
+ },
+ {
+ "$schema": "http://json-schema.org/draft-04/schema#",
+ "title": "'An Annotation should have exactly 1 id' (Section 3.1)",
+ "assertionType": "should",
+ "expectedResult": "valid",
+ "errorMessage": "Warning: The Annotation is not identified using the id key (Section 3.1).",
+ "type": "object",
+ "properties": {
+ "id": {}
+ },
+ "required": ["id"]
+ }
+ ]
+ }
+
+}
diff --git a/testing/web-platform/tests/annotation-model/examples/example3.test b/testing/web-platform/tests/annotation-model/examples/example3.test
new file mode 100644
index 0000000000..38263cd185
--- /dev/null
+++ b/testing/web-platform/tests/annotation-model/examples/example3.test
@@ -0,0 +1,8 @@
+{
+ "@context": "https://www.w3.org/ns/JSONtest-v1.jsonld",
+ "name": "Automated example test",
+ "description": "A test that runs with no user intervention",
+ "testType": "automated",
+ "assertions": [ "common/requiredProperties.json" ],
+ "content": "common/sampleContent2.jsonld"
+}
diff --git a/testing/web-platform/tests/annotation-model/examples/exampleContext.json b/testing/web-platform/tests/annotation-model/examples/exampleContext.json
new file mode 100644
index 0000000000..5b499296b9
--- /dev/null
+++ b/testing/web-platform/tests/annotation-model/examples/exampleContext.json
@@ -0,0 +1,31 @@
+{
+ "$schema": "http://json-schema.org/draft-04/schema#",
+ "title": "Check @context value",
+ "description": "'http://www.w3.org/ns/anno.jsonld must be' an @context value (Section 3.1)",
+ "assertionType": "must",
+ "expectedResult": "valid",
+ "errorMessage": "Error: 'http://www.w3.org/ns/anno.jsonld' is not an @context value.",
+ "type": "object",
+ "properties": {
+ "@context": {
+ "oneOf": [
+ { "type": "string",
+ "$ref": "#/definitions/contextValue" },
+ { "type": "array",
+ "$ref": "#/definitions/contextArray" }
+ ]
+ }
+ },
+ "definitions": {
+ "contextValue":
+ { "enum": [ "http://www.w3.org/ns/anno.jsonld" ] },
+ "contextArray":
+ { "not":
+ { "items":
+ { "not":
+ { "type": "string",
+ "$ref": "#/definitions/contextValue" } }
+ }
+ }
+ }
+}
diff --git a/testing/web-platform/tests/annotation-model/examples/exampleTarget.json b/testing/web-platform/tests/annotation-model/examples/exampleTarget.json
new file mode 100644
index 0000000000..e8e6a78da0
--- /dev/null
+++ b/testing/web-platform/tests/annotation-model/examples/exampleTarget.json
@@ -0,0 +1,13 @@
+{
+ "$schema": "http://json-schema.org/draft-04/schema#",
+ "title": "Check if target feature implemented",
+ "description": "'There must be 1 or more target relationships associated with an Annotation.' (Section 3.1)",
+ "assertionType": "must",
+ "expectedResult": "valid",
+ "errorMessage": "Error: Annotation has no target relationships - at least 1 is required. (Section 3.1)",
+ "type": "object",
+ "properties": {
+ "target": { "type": ["string", "array", "object"] }
+ },
+ "required": ["target"]
+}