Playwright For Python Released In Preview

Playwright for Python enables you to write reliable end-to-end tests in Python.

Recently, Microsoft announced Playwright for Python in preview, which enables developers and testers to write reliable end-to-end tests in Python.
Earlier this year, Microsoft had released Playwright in JavaScript that enabled thousands of developers and testers to be successful at end-to-end testing. Now, this release is bringing the same capabilities to Python.
Playwright API allows you to write end-to-end tests that run on all modern web browsers. According to the company, Playwright delivers automation that is faster, more reliable and more proficient than existing testing tools.
Source: Microsoft
Microsoft said that Playwright uses an event-driven architecture that can listen to precise browser events like DOM changes, network requests and page navigations. It automatically waits for the UI to be ready, which ensures tests are reliable to execute and simpler to author.
The solution is built to automate newer web features, including emulation of mobile viewports, geolocation and web permissions. Not only this Playwright scripts can even intercept and modify network activity and automate scenarios across multiple pages.
The pytest plugin for Playwright gets you started easily with end-to-end testing. To install Playwright, the plugin, and the browsers to test on, you will need to run:
pip install playwright pytest-playwright
python -m playwright install
The plugin configures pytest fixtures that give you building blocks needed for end-to-end browser testing.