Wrap Up | Bondar Academy
Course: Playwright API Testing with TypeScript
Module: API Testing Basics
Instructor: Artem Bondar
Lesson Summary
Summary of API Testing with Playwright In this lesson, we covered the fundamentals of making API requests using Playwright and Postman. Key topics included: Types of API requests: GET , POST , PUT , and DELETE . Reading values from APIs for future calls. Running tests and making assertions. However, a challenge arises when writing tests with Playwright for API testing. Despite being a robust framework for UI testing, Playwright is not optimized for API testing, leading to: Complexity: Tests can become lengthy and difficult to read, with nearly 120 lines of code for just four tests. Redundancy: Repeated calls to extract JSON data and validate status codes make the code cumbersome. Maintenance Issues: The busy appearance of the code can complicate debugging and future modifications. Examples of inefficiencies include: Requiring multiple calls to extract JSON data from responses. Complex syntax for validating status codes, such as expect(newArticleResponse.status).toEqual(201) . To address these issues, the next section will focus on developing a custom framework based on Playwright. This framework will enhance readability, simplify scripting, and introduce features like schema validation and custom assertions, leveraging the flexibility of Node.js and TypeScript . Stay tuned for the upcoming module, where we will implement these improvements!