You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+5-4Lines changed: 5 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -52,6 +52,7 @@ And you don't need to create Java objects (or POJO-s) for any of the payloads th
52
52
* Syntax 'natively' supports JSON and XML - including [JsonPath](https://github.com/jayway/JsonPath) and [XPath](https://www.w3.org/TR/xpath/) expressions
53
53
* Express expected results as readable, well-formed JSON or XML, and assert (in a single step) that the entire response payload (no matter how complex or deeply nested) - is as expected
54
54
* Payload assertion failures clearly report which data element (and path) is not as expected, for easy troubleshooting of even large payloads
55
+
* Simpler and more powerful alternative to JSON-schema for validating payload structure and data-types that even supports cross-field / domain validation logic
55
56
* Scripts can call other scripts - which means that you can easily re-use and maintain authentication and 'set up' flows efficiently, across multiple tests
56
57
* Embedded JavaScript engine that allows you to build a library of re-usable functions that suit your specific environment or organization
57
58
* Re-use of payload-data and user-defined functions across tests is so easy - that it becomes a natural habit for the test-developer
@@ -90,13 +91,13 @@ So you need two `<dependencies>`:
90
91
<dependency>
91
92
<groupId>com.intuit.karate</groupId>
92
93
<artifactId>karate-apache</artifactId>
93
-
<version>0.4.1</version>
94
+
<version>0.4.2</version>
94
95
<scope>test</scope>
95
96
</dependency>
96
97
<dependency>
97
98
<groupId>com.intuit.karate</groupId>
98
99
<artifactId>karate-junit4</artifactId>
99
-
<version>0.4.1</version>
100
+
<version>0.4.2</version>
100
101
<scope>test</scope>
101
102
</dependency>
102
103
```
@@ -116,7 +117,7 @@ You can replace the values of 'com.mycompany' and 'myproject' as per your needs.
116
117
mvn archetype:generate \
117
118
-DarchetypeGroupId=com.intuit.karate \
118
119
-DarchetypeArtifactId=karate-archetype \
119
-
-DarchetypeVersion=0.4.1 \
120
+
-DarchetypeVersion=0.4.2 \
120
121
-DgroupId=com.mycompany \
121
122
-DartifactId=myproject
122
123
```
@@ -1468,7 +1469,7 @@ Then match each json.hotels contains { totalPrice: '#($.roomInformation[0].roomP
1468
1469
There is a shortcut for `each` and equality (`==`) `match`-ing explained in the next section that can be quite useful, especially for schema-like validations.
1469
1470
1470
1471
## Schema Validation
1471
-
Karate provides a far more simpler and more powerful way than [JSON-schema](http://json-schema.org) to validate the stucture of a given payload. You can even mix data and conditional validations and perform all assertions in a single step.
1472
+
Karate provides a far more simpler and more powerful way than [JSON-schema](http://json-schema.org) to validate the stucture of a given payload. You can even mix domain and conditional validations and perform all assertions in a single step.
1472
1473
1473
1474
But first, a special short-cut for array validation needs to be introduced:
0 commit comments