I have been using Rest-Assured framework all the time for testing APIs with Java. But this time it was my project's demand to perform API testing in Javascript.
Being a newbie to JS, I googled for some tools and found SuperTest.
To introduce SuperTest, it is a high level abstraction of HTTP requests, making it perfect for testing APIs.
I decided to do a POC of this tool to understand it better, hence this project was created.
I thought of sharing this on github, so it helps others as well who want to learn more about this tool.
Checkout this link to learn more about SuperTest
You need to have the following installed on your machine:
- Node(Latest Version).
- npm(Latest Version).
mochaframework is used for writing tests andchaifor assertions, following command should help to install the required npm packages:npm i -D -g supertest mocha chai mochawesome- For running the tests, you need to type the command:
npm run test. (Check Package.json for more details) - For generating the mochawesome report, run the command
npm run html-report(Check Package.json for more details.) It will generate and export the report inmochawesome-reportfolder from which you can open theindex.htmlfile to view the report.
-
The
GET,POST,PUT,PATCHandDELETErequests API test automation examples are covered using the Restful E-Commerce demo web services and Httpbin.org demo APIs. -
End to End scenarios have been added using the restful-booker APIs.
-
Restful E-Commerce Demo APIs are used to write the
-
Mochawesome reporter is used to generate the reports and show summary of the tests.
- Discuss your queries by writing to me @
mohammadfaisalkhatri@gmail.comOR ping me on any of the social media sites using the below link:
- Contact me for Paid trainings related to Test Automation and Software Testing,
mail me @
mohammadfaisalkhatri@gmail.comor ping me on LinkedIn
