3 ms·
Why use a DSL and not your favorite scripting language or test-framework of choice for this? All the examples on the front page can be written in same number of
by Too 4y ago
Why use a DSL and not your favorite scripting language or test-framework of choice for this? All the examples on the front page can be written in same number of LOC in many such popular languages.
- chaining - It's just code so put multiple get calls after one another
- captures - Just variables. With sessions you can also get automatic cookie-capture.
- Payload - Yes
- Parsing responses - stdlib has json and xpath libraries that also can be written as oneliners. Html not always being pure xml is a problem, but can be solved with other libraries, like beautifulsoup.
- Retries - a bit more hassle to set up but also doable with relatively small effort.
- Comments - yes
What's missing would be benefits given by the declarative nature, such as more human friendly output on jsonpath assertions. But that's often easily extended with functions in the test framework and outweighed by the flexibility given by allowing you to extend the capabilities with more functions or put computations between chained calls or other external inputs/outputs needed in the tests. How often do you really need to test only the http call and nothing else?