From 851edc857178a1132d9b08ea1fe088d3fd4e60d0 Mon Sep 17 00:00:00 2001 From: authorjapps Date: Sat, 27 Apr 2024 08:56:08 +0100 Subject: [PATCH] Update README.md(shortened) --- README.md | 124 +++++++++++++----------------------------------------- 1 file changed, 29 insertions(+), 95 deletions(-) diff --git a/README.md b/README.md index c401620e..2947ac2c 100644 --- a/README.md +++ b/README.md @@ -21,9 +21,9 @@ It has the best of best ideas and practices from the community to keep it super Documentation === -For a quick introduction to Zerocode and its features, visit the -+ [Zerocode TDD Documentation](https://zerocode-tdd-docs.pages.dev) -+ [Want to contribute/amend the docs](https://github.com/authorjapps/zerocode/wiki/Documentation-How-To-Fix-Steps)? Steps and guidelines are [here](https://github.com/authorjapps/zerocode/wiki/Documentation-How-To-Fix-Steps) +Visit here : ++ [Documentation](https://zerocode-tdd-docs.pages.dev) - Indexed & instantly find you the results ++ [Want to contribute or amend the docs](https://github.com/authorjapps/zerocode/wiki/Documentation-How-To-Fix-Steps)? Steps and guidelines are [here](https://github.com/authorjapps/zerocode/wiki/Documentation-How-To-Fix-Steps) IDE Support By === @@ -60,37 +60,7 @@ Response: then, we can easily validate the above API using `Zerocode` like below. -+ Using YAML described as below, - -> _The beauty here is, we can use the payload/headers structure for validation as it is without any manipulation or use a flat JSON path to skip the hassles of the entire object hierarchies._ - -## Validators - -Using YAML - -```yaml - ---- -url: api/v1/customers/123 -method: GET -request: - headers: - Content-Type: application/json -retry: - max: 3 - delay: 1000 -validators: -- field: "$.status" - value: 200 -- field: "$.body.type" - value: Premium Visa -- field: "$.body.addresses[0].line1" - value: 10 Random St -``` - -or - -Using JSON ++ Using JSON ```JSON { @@ -105,26 +75,27 @@ Using JSON "max": 3, "delay": 1000 }, - "validators": [ - { - "field": "$.status", - "value": 200 - }, - { - "field": "$.body.type", - "value": "Premium Visa" + "verify": { + "status": 200, + "headers": { + "Content-Type" : [ "application/json; charset=utf-8" ] }, - { - "field": "$.body.addresses[0].line1", - "value": "10 Random St" - } - ] + "body": { + "id": 123, + "type": "Premium Visa", + "addresses": [ + { + "type": "Billing", + "line1": "10 Random St" + } + ] + } + }, + "verifyMode": "LENIENT" } ``` -## Matchers - -Using YAML ++ or Using YAML ```yaml @@ -151,55 +122,18 @@ verify: verifyMode: LENIENT ``` -or -Using JSON +> _The beauty here is, we can use the payload/headers structure for validation as it is without any manipulation +> or +> use a flat JSON path to skip the hassles of the entire object hierarchies._ -```JSON -{ - "url": "api/v1/customers/123", - "method": "GET", - "request": { - "headers": { - "Content-Type": "application/json" - } - }, - "retry": { - "max": 3, - "delay": 1000 - }, - "verify": { - "status": 200, - "headers": { - "Content-Type" : [ "application/json; charset=utf-8" ] - }, - "body": { - "id": 123, - "type": "Premium Visa", - "addresses": [ - { - "type": "Billing", - "line1": "10 Random St" - } - ] - } - }, - "verifyMode": "STRICT" -} -``` - -and run it simply by pointing to the above JSON/YAML file from a JUnit `@Test` method. - -```java - @Test - @Scenario("test_customer_get_api.yml") - public void getCustomer_happyCase(){ - // No code goes here. This remains empty. - } -``` Looks simple n easy? Why not give it a try? Visit the [quick-start guide](https://github.com/authorjapps/zerocode/wiki/Getting-Started) or [user's guide](https://github.com/authorjapps/zerocode/wiki#developer-guide) for more insight. -Zerocode is used by many companies such as Vocalink, HSBC, HomeOffice(Gov) and [many others](https://github.com/authorjapps/zerocode/wiki#smart-projects-using-zerocode) to achieve accurate production drop of their microservices. Learn more about [Validators Vs Matchers](https://github.com/authorjapps/zerocode/wiki/Validators-and-Matchers) here. +Zerocode-TDD is used by many companies such as Vocalink, HSBC, HomeOffice(Gov) and [many others](https://github.com/authorjapps/zerocode/wiki#smart-projects-using-zerocode) to achieve accurate production drop of their micro-services, data-pipelines etc. + +Also, learn more about [Validators Vs Matchers](https://github.com/authorjapps/zerocode/wiki/Validators-and-Matchers) here. Happy Testing! 🐼 + +🔆 Visit [Documentation](https://zerocode-tdd-docs.pages.dev) - Indexed, searchable & instantly find you the results