As assertions are at the heart of any testing strategy, we decided to encourage users to make the most of them. This is why we’ve been working on a new engine in Restlet Client that automatically suggests assertions for test requests. The suggestion engine is context aware, meaning it will only suggest assertions that are appropriate for what you are doing.
Let’s illustrate the concept with some use cases:
1) You’ve just created a request. No assertions are defined.
Now, in one click on a suggestion, you can define what you expect from the response before launching the request.
2) Another example is when you define a request header such as Accept. Then a new suggestion appears:
Hopefully, you’ll want to use more assertions to test the expected response, for example, checking the response content:
By the way, do you recognize the syntax for the name attribute? You guessed it, JSON Path! Don’t worry if you don’t know JSON Path, we’ve got you covered:
A dedicated page about JSON Path is one click away, here is a preview:
See the complete JSONPath and XPath reference on our use guide.
So, ready to rock some assertions?
Well, one more thing…
Writing an assertion for a response header has never been so easy thanks to the autocompletion feature that takes into account the last response received.
We hope these improvements will make asserting a lot easier and faster.
By the way, if you have any other ideas for suggested assertions, don’t hesitate to share them with us.
Live long and assert. 🖖