Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mfaisalkhatri/api-testing-playwright-java-testng
This repository has example codes related to API Testing using Playwright with Java and TestNG.
https://github.com/mfaisalkhatri/api-testing-playwright-java-testng
api-testing hacktoberfest java playwright rest-api testautomation tutorial
Last synced: 3 months ago
JSON representation
This repository has example codes related to API Testing using Playwright with Java and TestNG.
- Host: GitHub
- URL: https://github.com/mfaisalkhatri/api-testing-playwright-java-testng
- Owner: mfaisalkhatri
- Created: 2023-02-28T12:29:00.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-10-09T09:11:56.000Z (4 months ago)
- Last Synced: 2024-10-12T03:26:02.162Z (3 months ago)
- Topics: api-testing, hacktoberfest, java, playwright, rest-api, testautomation, tutorial
- Language: Java
- Homepage:
- Size: 55.7 KB
- Stars: 24
- Watchers: 6
- Forks: 16
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
![Open Source Love](https://badges.frapsoft.com/os/v1/open-source.svg?v=103)
[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
[![Java CI with Maven](https://github.com/mfaisalkhatri/api-testing-playwright-java-testng/actions/workflows/maven.yml/badge.svg)](https://github.com/mfaisalkhatri/api-testing-playwright-java-testng/actions/workflows/maven.yml)## Don't forget to give a :star: to make the project popular.
## :question: What is this Repository about?
This project is the outcome of my self-learning about the API Testing Automation framework - [Playwright with Java](https://playwright.dev/java/docs/api-testing#writing-api-test)
## :briefcase: What does this repo contain?
- This repo contains example codes of API Tests using Playwright with Java.
- [TestNG](https://testng.org) is used as Test Runner and for performing assertions in the test.
- `Log4j` is used to capture logs.
- [Lombok](https://projectlombok.org/) has been used to generate Getter and Setters automatically for post body requests.
- FAKE Rest APIs on [Reqres.in](https://reqres.in/) has been used for testing.
- End to End scenarios have been added for the [restful booker APIs](https://restful-booker.herokuapp.com/apidoc/index.html).
- Happy and Sad Path Scenarios have been added for the [restful-ecommerce APIs](https://github.com/mfaisalkhatri/restful-ecommerce)## :hammer_and_wrench: Talking more about the Scenarios Covered in this project:
You will get the answers to the following questions and its respective working code example with [Playwright Java](https://playwright.dev/java/docs/api-testing#writing-api-test) framework in this repository:
- How to write tests for `GET` requests?
- How to write tests for `POST` requests?
- How to write tests for `PUT` requests?
- How to write tests for `PATCH` requests?
- How to write tests for `DELETE` requests?
- How to handle the `authentication` requests?
- How to verify the Response Body?
- How to verify the Response Status Code?
- How to extract value from Response Body?
- How to create `POJO` for passing values to request body?
- How to use `Lombok` to generate `Getters` and `Setters`?
- How to use `Lombok` for writing the builder pattern code?
- How to use Builder Pattern for test data generation using [Data Faker](https://github.com/datafaker-net/datafaker)?
- How to write end-to-end api tests?
- How to write Happy Path scenarios for the APIs?
- How to write Sad Path scenarios for the APIs?
- How to log the Response ?## :writing_hand: Blog Links
- [What is API Testing?](https://mfaisalkhatri.github.io/2020/08/08/apitesting/)
- [How to perform End to End API Testing using Playwright with Java and TestNG](https://medium.com/@iamfaisalkhatri/how-to-perform-end-to-end-api-testing-using-playwright-with-java-and-testng-26b318927115)
- [Playwright Java API Testing | How to test POST requests?](https://medium.com/@iamfaisalkhatri/playwright-java-api-testing-how-to-test-post-requests-4c9102d3ab03)
- [Playwright Java API Testing | How to test GET requests?](https://medium.com/@iamfaisalkhatri/playwright-java-api-testing-how-to-test-get-requests-c036b984cc6d)
- [Playwright Java API Testing | How to test PUT requests?](https://medium.com/@iamfaisalkhatri/playwright-java-api-testing-how-to-test-put-requests-d6b1d054d64b)
- [Playwright Java API Testing | How to test PATCH requests?](https://medium.com/@iamfaisalkhatri/playwright-java-api-testing-how-to-test-patch-requests-f6b0867d91e7)
- [Playwright Java API Testing | How to test DELETE requests?](https://medium.com/@iamfaisalkhatri/playwright-java-api-testing-how-to-test-delete-requests-2ff77feb0383)## :question: Need Assistance?
- Discuss your queries by writing to me @ `[email protected]`
OR ping me on any of the social media sites using the below link:
- [Linktree](https://linktr.ee/faisalkhatri)## :computer: Paid Trainings
Contact me for Paid trainings related to Test Automation and Software Testing,
mail me @ `[email protected]` or ping me on [LinkedIn](https://www.linkedin.com/in/faisalkhatri/)## :thought_balloon: Checkout the blogs related to Testing on [my website](https://mfaisalkhatri.github.io) and [medium](https://medium.com/@iamfaisalkhatri)