Menu
Microsoft’s Playwright simplifies tests for Python web apps

Microsoft’s Playwright simplifies tests for Python web apps

Front-end tests for web apps have traditionally been a chore. Playwright offers an easier way to integrate those tests for Python

Credit: Dreamstime

Microsoft has announced the release of the Python version of Playwright, a framework for end-to-end testing of web applications in Python. Playwright is the latest in a slew of Microsoft-created Python tools including the Pylance and Pyright language-support add-ons for Visual Studio Code.

Playwright integrates with the Pytest framework in Python, a widely used automated testing system for Python apps. It provides high-level primitives for accessing elements and behaviours on web pages, so that, for instance, the contents or attributes of elements on a page can be checked.

Playwright also integrates with the testing framework in Python’s Django web framework, so that existing Django tests can be extended with front-end tests.

Front-end testing web frameworks has typically been a chore. In Python’s case, one might use a framework like Selenium to automate the interaction of a browser with the web framework and check the results.

Playwright simplifies the process: In addition to providing high-level interaction primitives (page.goto(), or page.click()), Playwright intelligently waits for browser activities to complete before performing actions, so the developer doesn’t have to account for that.

Playwright supports interactions under all three major web browser systems (Chromium, Firefox, and WebKit), and device emulation as well. Copies of each web engine come packaged with Playwright, so there is no need to download or install the browsers on the system at large. It’s also possible to emulate web-specific technologies like geolocation, for instance by specifying a latitude and a longitude in a page test. Network traffic can be logged and modified.

Playwright is still in the early stages, but can be installed from the Python Package Index with pip install playwright.


Follow Us

Join the newsletter!

Or

Sign up to gain exclusive access to email subscriptions, event invitations, competitions, giveaways, and much more.

Membership is free, and your security and privacy remain protected. View our privacy policy before signing up.

Error: Please check your email address.

Tags Microsoftpython

Featured

Slideshows

Meet the Reseller News 30 Under 30 Tech Awards 2020 winners

Meet the Reseller News 30 Under 30 Tech Awards 2020 winners

This year’s Reseller News 30 Under 30 Tech Awards were held as an integral part of the first entirely virtual Emerging Leaders​ forum, an annual event dedicated to identifying, educating and showcasing the New Zealand technology market’s rising stars. The 30 Under 30 Tech Awards 2020 recognised the outstanding achievements and business excellence of 30 talented individuals​, across both young leaders and those just starting out. In this slideshow, Reseller News honours this year's winners and captures their thoughts about how their ideas of leadership have changed over time.​

Meet the Reseller News 30 Under 30 Tech Awards 2020 winners
Reseller News Exchange Auckland: Beyond the myths — how partners can master cloud security

Reseller News Exchange Auckland: Beyond the myths — how partners can master cloud security

This exclusive Reseller News Exchange event in Auckland explored the challenges facing the partner community on the cloud security frontier, as well as market trends, customer priorities and how the channel can capitalise on the opportunities available. In association with Arrow, Bitdefender, Exclusive Networks, Fortinet and Palo Alto Networks. Photos by Gino Demeer.

Reseller News Exchange Auckland: Beyond the myths — how partners can master cloud security
Reseller News welcomes industry figures at 2020 Hall of Fame lunch

Reseller News welcomes industry figures at 2020 Hall of Fame lunch

Reseller News welcomed 2019 inductees - Leanne Buer, Ross Jenkins and Terry Dunn - to the fourth running of the Reseller News Hall of Fame lunch, held at the French Cafe in Auckland. The inductees discussed the changing face of the IT channel ecosystem in New Zealand and what it means to be a Reseller News Hall of Fame inductee. Photos by Gino Demeer.

Reseller News welcomes industry figures at 2020 Hall of Fame lunch
Show Comments