All the following challenges are focused on Web API automation.
Automation Week
These challenges are part of Automation Week. Complete them for your chance to talk at Test.bash(); about your approach and experience.
Application
The application for this challenge is Restful Booker Platform. More about the application is available here. You can also ask questions related to the application there.
The Challenges:
Complete these challenges using any tooling of your choice.
Beginner:
Perform a GET request on the branding API and assert the response.
Intermediate:
Create a new Room using the Rom API and assert it was successfully created. Tip, you’ll need to also need to prove you are authenticated by calling the Auth API and saving the token!
Advanced:
Create a solution/framework that allows you to test all the APIs. You’ll need to include tests for:
Branding: GET, PUT
Room: GET, PUT, POST, DELETE
Booking: GET, PUT, POST, DELETE
Auth: POST. Login, logout, validate
Report: GET
Messaging: GET, POST,
Bonus, test that you can mark a message as read.
Questions
If you have any questions at all about this challenge, please post them below.
Quick one - is the branding request definitely a POST and not a PUT? When I try to POST to https://automationintesting.online/branding/ endpoint its giving me a 405 method not allowed error? (I am a bit of a newbie at this though so I could well be doing something wrong!)
I can’t figure out how to do the intermediate challenge! I have my POST request and I seemingly get a 200 response but when I do a GET, the room I tried to create isn’t in the response. I managed to get a token from the auth endpoint but I think I don’t know what I need it for. I’m clearly missing something! Is anyone able to point me in a direction to investigate without giving too much away?!
Given I’m testing room endpoint
When I use method POST
Then in the response logs I see a couple of times status code 301
And then 200 with the response of “roomid”:1 (irrespective of the request)
I was expecting 201
My Request:
{
“rooms”: [
{
“roomid”: 99,
“roomNumber”: 299,
“type”: “single”,
“accessible”: true,
“image”: “https://www.mwtestconsultancy.co.uk/img/testim/room2.jpg”,
“description”: “Aenean porttitor mauris sit amet lacinia molestie. In posuere accumsan aliquet. Maecenas sit amet nisl massa. Interdum et malesuada fames ac ante.”,
“features”: [
“TV”,
“WiFi”,
“Safe”
],
“roomPrice”: 299
}
]
}
So I was having the same issue and I’ve just tried it with the / on the end and still only seem to get the first room id back. If I do room/2 for example, I get the room I created but I don’t seem to be able to bring ALL rooms back
Here’s the link to my repo which holds the Postman Collection and Environment JSON files. You can import these yourself into Postman so you can see some of the weird stuff I’m doing in there.