Skip to content

YakovlevaMary/rest-api-reqres

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

61 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

"Testing leads to failure, and failure leads to understanding" - Burt Rutan

πŸ‘©β€πŸ’»Test automation project for REQRES.IN service

WB_logo.jpg

  • The process of automatically testing and verifying the functionality of an application programming interface (API) is known as API automation.
  • It helps ensure that the API functions as intended and reduces the time and effort spent on manual testing.
  • API automation is implemented using software tools that send requests to the API, parse the responses, and compare them to the expected results.
  • The goal of API automation is to increase the reliability and consistency of the testing process, which saves time and resources.
  • REST API stands for Representational State Transfer API, which is a web standards-based architecture for building web services.
  • REST API is a common way of communication between clients and servers over the Internet. REST APIs use HTTP requests to manipulate data, such as POST, PUT, GET, and DELETE.

πŸŽ€ Table of contents

πŸ› οΈ Tools and technologies

IntelliJ IDEA Java Rest Assured Allure Report Allure TestOps Gradle JUnit5 GitHub Jenkins Telegram Jira
  • To create autotests in this project the Java language was used.
  • Gradle was used as an automatic build system.
  • Framework JUnit5 for automated unit testing has been applied.
  • The models of the received data are described using the Lombok library.
  • API testing is done using the Rest Assured library. This library helps identify and fix bugs and issues early in the development process.
  • To run tests remotely a job was implemented in Jenkins with the creation of an Allure-report and sending the results to Telegram using special Telegram bot.
  • Integrations with с Allure TestOps and Jira were implemented.

🚩 List of HTTP response status codes used

βœ“ List of successful responses

CODE STATUS MEANING
200 OK The request succeeded
201 Created The request succeeded, and a new resource was created as a result
204 No Content There is no content to send for this request, but the headers may be useful

βœ“ List of client error responses

CODE STATUS MEANING
400 Bad Request The server can't process the request due to a client error
404 Not Found The server can't find the requested resource (resource itself doesn't exist)

πŸ“‘ List of implemented API tests

API POST
βœ… Successful user authorization (code 200)
βœ… Unsuccessful user authorization as login and password are invalid (code 400)
βœ… Unsuccessful user authorization as password is missed (code 400)
βœ… Successful user registration (code 200)
βœ… Unsuccessful user registration as password is missed (code 400)
βœ… Creation a new user (code 201)
API DELETE
βœ… Deleting a user (code 204)
API PATCH
βœ… Updating user data (code 200)
API PUT
βœ… User data update (code 200)
API GET
βœ… Get users list page β„–2 and check its scheme (code 200)
βœ… Get users list page β„–2 and check users by IDs and names (code 200)
βœ… Attempt to get data about a non-existent single user (code 404)
βœ… Get single user data and check it by ID and name (code 200)
βœ… Get colors data and check it by IDs and names (code 200)

πŸ–₯️ Running autotests from the terminal

Lauching tests can be done using the following command from the terminal:

gradle clean test

Running the following command in the IDE terminal will run the tests locally.

Build in Jenkins

Link to job in Jenkins

Using the link below you can go to the build of the project:

🌐 Link to the job in Jenkins

Job in Jenkins: algorithm and autotests results

  1. Open the project from the link above. The screenshot shows the appearance of the project window in Jenkins.

  1. Select the item "Collect now" on the left panel

3. The results of running a build can be viewed in Allure report and Allure TestOps

Allure report

Link to Allure report

Using the link below you can go to the Allure report:

🌐 Link to the Allure report

Allure report: overview

The screenshot below shows the main page of the report.

Allure report: test cases

On the Suites tab a standard structural representation of executed tests can be found.

The test result on the right panel contains: request with attachment of request method, url, body, headers, curl and response with attachment of status code, headers, body.

Allure report: graphs

Graphs allow you to see different statistics collected from the test data: statuses breakdown or severity and duration diagrams.

Allure TestOps

Link to Allure TestOps

Using the link below you can go to the Allure TestOps:

🌐 Link to the Allure TestOps

Allure TestOps: dashboard

Standard dashboard (see the picture below) provides instant insight on status of tests you're having in your project and resides in the Dashboards section of a project.

The default dashboard contains:
  1. Number of test cases and distribution per state (active, in review, outdated etc.)
  2. Number of test cases and distribution between the manual tests and automated tests
  3. Automation trend with the insight regarding the number of test during last 14 days
  4. Information about launches and thier results status (failed, passed)
  5. Mutes trend, i.e. the number of tests excluded from statistics due to permanent failed state or flaky state.

Allure TestOps: test cases

Allure TestOps supports working with both – manual and automated test cases. Steps of a test case are described in the scenario.

Allure TestOps: launches

The test result on the right panel contains: request with attachment of request method, url, body, headers, curl and response with attachment of status code, headers, body.

Automated test cases are generated based on test results received from automated tests.

Integration with Jira

Link to Jira

Using the link below you can go to the Jira:

🌐 Link to the Jira

The task displays the test cases attached to it, as well as the results of running/passed tests.

Telegram notifications using a bot

After the project build is completed, the bot created in Telegram automatically processes and sends a message with the results.

Back to content

About

Test automation project for REQRES.IN service

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors