What is Playwright?
=> It is an open-source automation framework developed by Microsoft
=> It is a tool used to automate web browsers for test websites and web applications.
How to Work?
Developers build the website, and testers check if all its features are working correctly. They verify things like:
Does the website open when the URL is entered?
Does the username and password work?
Is the Login button clickable?
After clicking Login, does the dashboard or next page open?
Are all other features working as expected?
Types of Testing
1. Functional Testing
It is the automated verification that every feature of a web application behaves as expected when users interact with it.
Example
Features to test:
Login
Search for products
Add items to cart
Remove items from cart
Checkout
Logout
Playwright can automate all these functional tests instead of a tester performing them manually every time.
2.End-to-End (E2E) Testing
It means testing your application the same way a real user would interact with itβfrom opening the website to completing a full workflow.
π€ opens browser
β
Visits website
β
Clicks Login
β
Types username
β
Types password
β
Clicks Sign In
β
Checks "Welcome, Siyamala"
3. Regression Testing
Regression Testing means checking that old features still work after you make changes to your application.
4. Cross-Browser Testing
Cross-Browser Testing means checking that your website works correctly in different web browsers.
β
Google Chrome
β
Microsoft Edge
β
Mozilla Firefox
β
Safari
5. UI Testing
UI (User Interface) Testing means checking that the visible parts of a website work and appear correctly.
+---------------------+
| Username [________] |
| Password [________] |
| |
| [ Login Button ] |
+---------------------+
β
Buttons
β
Text boxes
β
Colors
β
Images
β
Menus
β
Forms
β
Labels
β
Links
6. Smoke Testing
Smoke Testing means running a small set of important tests to quickly check whether the application is basically working.
7. API Testing
API Testing in Playwright is the process of sending HTTP requests to an API and verifying that the responses are correct, without interacting with the application's user interface.
Playwright verifies that:
The response status code is 200 OK.
The response contains the expected data.
A valid authentication token is returned.
*Common API Requests *
GET β Retrieve data
POST β Create new data
PUT β Update existing data
DELETE β Remove data
Top comments (1)
How does Playwright handle browser context, I've had issues with this in similar frameworks. Would love to hear more about your experience with it.