For the Hermes QA Technical Test, you'll be working with a fake application. The application is a simple RESTful service, for use by a Question and Answer website, like Stack Overflow.
The application is written in NodeJS, and it has a basic suite of tests written in cucumber.js, that you can use as your starting point.
There's no web interface (it's a RESTful service), but you can query it with your favourite REST client if that suits your way of working.
Your goal is to test it. Find as many issues as you can, and raise them in GitHub. Expand the automated test coverage as far as you can.
You should spend about 2 hours on the problem (we won't penalise you if you go a little over). Once you're done, make sure you've committed your work to your GitHub repository, and send us a pull request.
You should have been advised by your recruiter to:
- Ensure you have NodeJS 5.0 or above on your computer
- Ensure you have an up-to-date version of Git on your computer
- Ensure you hava a GitHub account
- Familiarise yourself with cucumber.js
- Read up on RESTful Web Services. You may also want to familiarise yourself with a REST Client, such as Advanced REST Client or Postman
- Fork this repository, and clone it to your local machine
- From the command line, run
npm install
to install dependencies
Your objective is to add as much value as you can to this project. We'd recommend you look at doing some of the following things:
- Find any issues you can and raise them as issues on GitHub. Raise anything that you think is broken, problematic, or counterintuitive. Issues don't have to be in code. They can also be bad specifications or inaccurate documentation (including this document). If in doubt, raise it as an issue, even if it feels more like a question.
- Create more automated test cases. Try and think about positive, negative, and corner cases. Some of the features, like answer vote counts, will probably need you to write your own step definitions.
- Add some new features, like the ability to to edit or delete questions, or find questions and answers from specific users, and test them
We don't expect you to complete all these objectives in the time. We're more interested in how you approach the problem.
From the command line, run tests with:
npm test
or alternatively:
node .\node_modules\cucumber\bin\cucumber.js
It's not necessary to run the application in order to execute the cucumber tests, but if you would like to interrogate it with your favourite REST client, you can start an instance of the application with:
npm start
The application should support the following operations:
GET /user/:userName
: Retrieve a user of the system. The response will be JSON like{"userName": "john", "email": "[email protected]", "password": "password1"}
POST /user/:userName
: Create a new user, nameduserName
. Your request should be JSON like{"email": "[email protected]", "password": "password1"}
, and you will receive201 Created
on success.GET /question/:questionId
: Retrieve information about a question. The response will be JSON like{"user":"john","title":"A Question","content":"A question","upvotes":0,"downvotes":0,"answers":[],"questionId":0}
POST /question
: Create a new question. Your request should be JSON like{"user": "john", "title": "Question Title", "content": "A question"}
, and your response will be the same data, enriched with the id of the new question, asquestionId
.POST /question/:questionId/upvote?user=:userName
: Create an upvote for a user on a question. You will receive201 Created
on successPOST /question/:questionId/downvote?user=:userName
: Create a downvote for a user on a question. You will receive201 Created
on successPOST /question/:questionId/answer
: Create an answer for a question. Your request should be JSON like{"user": "john", "content": "An answer"}
, and your response will be the same data, enriched with the id of the new answer, asanswerId
.GET /question/:questionId/answer/:answerId
: Retrieve a specific answer. The response will be JSON like{"user":"john","content":"An answer","upvotes":1,"downvotes":0,"answerId":0}
POST /question/:questionId/answer/:answerId/upvote?user=:userName
: Create an upvote for a user on a question. You will receive201 Created
on successPOST /question/:questionId/answer/:answerId/downvote?user=:userName
: Create a downvote for a user on a question. You will receive201 Created
on success
All GET operations should return HTTP 404 if there is no corresponding resource found.