Skip to content

zaelcovsky/restful_booker_API_project

 
 

Repository files navigation

RESTFUL BOOKER API TESTING PROJECT

This is hAPI cat. That's it!

Used stack

Content

Description

Tests are developed using Python programming language, Requests library and PyTest framework. Reports are generated by Allure Report. Test reports are also sent by Telegram Bot if you launch tests using Jenkins.
In this project we test Restful-booker GET, PUT, POST and DELETE REST API HTTP methods.

Tests launch

Local launch

Preparing the environment

Before launch, you need to install the following (installation guide links are provided):

Also, download the repository with this project on your PC/laptop:

  • Click on "<> Code" on the project page.
  • In the opened pop-up menu click on "Download ZIP".
  • Download it to preferred directory and unpack downloaded archive there.

Create .env file in the directory. Open it. Insert the following lines:

BASE_URL="https://restful-booker.herokuapp.com/"  
FIRSTNAME=""  
LASTNAME=""  
TOTALPRICE=""  
DEPOSITPAID=""  
CHECKIN=""  
CHECKOUT=""  
ADDITIONALNEEDS=""  
USER=""  
PASSWORD=""  

Fill FIRSTNAME, LASTNAME, TOTALPRICE, DEPOSITPAID, CHECKIN, LASTNAME, CHECKOUT, ADDITIONALNEEDS in quotes as described here in Request body title.
Fill USER with username and PASSWORD with password in quotes as described here in Request body title.

Launch

Open any downloaded project's file in PyCharm (right click on file -> Edit with PyCharm). There will be the following window:

Click on Open in Project. After that there will be a following window:

Click on Trust Project.
Open a terminal in the opened PyCharm window by clicking on terminal button. The button locates at the bottom of the left sidebar as shown in the following figure:

The terminal will open in the bottom of PyCharm as shown in the following figure:

Launch tests using the following command:

pytest

There will be tests result line in terminal when tests will finish. Its example:

Generating a test report

Tests report is generated by Allure Report. To check it, run the following command after tests:

allure serve allure-results

After that, your system's default browser will open and there will be a generated report.

Launch using Jenkins

Open this project on Jenkins. The project's page example is provided below.

Click on "Build Now".

There will be a new build below "Build History" title as shown in the following figure:

Build's status will change when tests will finish. And there will appear TestOps and Allure reports as shown in the following figure:

Tests results

TestOps report

Go to Jenkins project's page. Click on in one of successful builds. Tests report is provided below:

Allure report

If you generate report locally, follow the instruction. If you generate it on Jenkins, click on in one of successful builds. Tests report from Jenkins is provided below:

There will not be TREND in the report if you generate report locally. It will be in Jenkins only.

Telegram notification

After Jenkins' build will finish, Telegram Bot will send a notification with test results to Telegram chat. The chat is private. It is only for tests developer and responsible members. The notification is provided below:

About

The project is a part of graduation work of QA.GURU Python automation course

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%