Here at QA we like to use different apps and technologies (such as bots) to integrate them in our tests. For this exercise, we will simulate the process of ordering a cab using a messaging client (i.e. Slack, Telegram ...)
We have developed a service to allow us knowing which taxis are in a given city, as well as the status and position of each one of them.
This service is deployed at http://130.211.103.134:4000/api/v1/, and exposes the following endpoints:
GET /taxis -> Returns all the taxis in the system
GET /taxis/<city>/ -> Returns all the free taxis in the city
GET /taxis/<city>/<taxi_id> -> Returns the information of a taxi
That last endpoint also allows you to reserve taxis for a while (random up to 10 seconds) using the following call:
POST /taxis/<city>/<taxi_id>
{state: hired}
If the requested taxi is available the service will respond 200 OK, and 403 FORBIDDEN if that's not the case.
Note: We know we have some issues related with the API. We would really appreciate if you find and report any of them to us!
You have to develop a bot for a messaging platform (Slack, Telegram ...) that allows a user to request THE NEAREST AVAILABLE TAXI TO A CONCRETE LOCATION.
- You can use Ruby, Python, Java, nodeJS, GO or Elixir.
- You must define which commands will be used to request the taxi, and to validate that is has been correctly ordered.
- It is important that the project includes a comprehensive test suite that validates any acceptance criteria you consider necessary. (NOTE: Our API is tested for us, we don't need you test it again but be sure you are testing YOUR code)
- This suite must also provide consistent results (keep in mind that the service is public, and anyone can be using the API in any moment).
- Keep it simple and clear when coding.
- We value the originality in a solution.
- Report all the issues you can find in our public API (as a folder/file into your solution)
If you have any doubt about the test code please contact recluitment and don't use the comments.
If you receives a 400, there are not any issue with the request. If you receive this kind of error maybe is because the request is not good.