Microsoft recently announced the public preview of Microsoft Playwright Testing, a new service for running Playwright tests at scale through Azure.
Playwright is a fast-growing open source framework that enables reliable end-to-end testing and automation of modern web apps. Control Chromium, Firefox, WebKit, and Opera browsers using a single API. Microsoft plans to offer the framework through a managed service, which it claims will allow users to “run Playwright tests simultaneously on a variety of operating system and browser combinations with greater parallelism.”
When you use the @playwright/test runner, your tests run in separate, parallel worker processes, with each process launching its own browser. Additionally, increasing the number of parallel workers can reduce the time it takes to complete a complete test suite. However, if you run your tests locally or in a continuous integration (CI) pipeline, there is a limit to the number of central processing unit (CPU) cores on your local machine or on his CI agent machine.
Mandy WhaleyMicrosoft’s Partner Director of Azure Dev Tools Products writes:
With the Microsoft Playwright Testing service, you can scale your workforce even further at cloud scale. Worker processes orchestrated by @playwright/test continue to run locally, but resource-intensive browser instances now run in the cloud.
Microsoft Playwright Testing allows developers to use the scalable parallelism provided by the service to create the latest applications such as Chromium, WebKit, Firefox on Windows and Linux, and mobile emulations of Google Chrome for Android and Mobile Safari. You can test your web app on all of the rendering engines simultaneously. Additionally, the service managed browser ensures consistent and reliable results for functional and visual regression tests, whether the tests are run from his CI pipeline or from your development machine. .
Overview Microsoft Playwright Testing Services from CI Pipelines and Code Editors (Source: Developer Tools Blog Post)
To effectively use Microsoft Playwright Testing, developers must create a workspace in Azure and then generate an access token and region-specific service endpoint. Tokens and endpoints allow developers to enter them into environment variables and make these settings available to their projects. That is, playwright.service.config.ts, which must be created along with the playwright.config.ts file. Finally, you can run your tests using the Playwright CLI or Visual Studio Code.
When you run a Playwright test in a remote browser in your workspace, the CLI command looks like this:
npx playwright test --config=playwright.service.config.ts --workers=20
Alternatives to Playwright Testing are available, including the popular Selenium, Cypress.io, and Puppeteer. These can be leveraged and expanded in the cloud. For example, Cypress.io offers the opportunity to use Cypress Cloud, and Puppeteer can run on Cloud Functions.
Playwright Testing is available as a managed service on Azure. David OsorkowskiSoftware Engineer at Vyne Dental; tweeted About X:
Is this a sign that Playwright will disappear in its current form and become available/maintained only as a service? I’m tired of more powerful software tools, but it’s time to get back on the treadmill and find an alternative. Maybe the time has come…
amanda silverMicrosoft’s CVP of Development responded: Tweet:
No, Playwright remains an OSS FX in its own right.
Finally, you can learn more about Microsoft Playwright Testing on our documentation landing page and GitHub repository. Prices can be found on the pricing page.