| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
Domain-Specific Language for testing APIs, hypermedia-style
❗ Early version; work in progress 🚧
Hypertest DSL is a tool which lets API authors build end-to-end testing suites as a series of client-server interactions which resemble the implementation of a hypermedia-driven applications.
In other words, the tests are solely executing based on links and forms, all of which should be provided by the server in resoruce representations.
The DSL itself aims to be agnostic of the media type. A test runner could be implemented to run against any RESTful API such as SIREN, Hydra, NARWHL, HAL-FORMS, etc.
Tests are written down as .api files. Here's an all too-simple test document:
# tests/scenario.api
With Class "Person" {
Expect Property "name"
}
It will instruct the runner to check that any ocurrence of the Person class has a name property.
More examples are available on testing.hypermedia.app.
Runners will work with a JSON representation of the test documents. A compiler can be used to transform the .api files to JSON:
npm i -g @hydrofoil/hypertest
Run it by passing a directory. You may try it on the samples directory in this repository:
hypertest-compiler ./api-example
It will produce a .api.json for each test scenario document.
The DSL and compiler are implemented in Java using Xtext.
The projects should now be imported and the build finish without errors.
Follow the instructions from this blog post to set up a local Tomcat instance running the Language Server and simple web UI.
Easiest way to build a running compiler is to build with Maven from command line and have jDeploy wire up an executable in local bin path:
npm i -g jdeploy mvn package jdeploy install hypertest-compiler api-examples
@hydrofoil/hypertest is published using jDeploy which packages the executable JAR in an easy to use node package.
npm run release git push --follow-tags origin master
Travis does the rest.
| Back | FazBrowse Home | New Git URL |