Skill

Run Playwright Tests at Scale on Azure

TypeScript skill for running Playwright tests at scale on Azure's cloud-hosted browser service with portal reporting.


91
Spark score
out of 100
Updated 29 days ago
Version 14.1.0

Add to Favorites

Why it matters

Execute Playwright tests efficiently across cloud-hosted browsers, leveraging Azure's infrastructure for scalable and integrated reporting. This asset streamlines the process of running tests in parallel and provides enhanced visibility through Azure portal integration.

Outcomes

What it gets done

01

Configure and run Playwright tests using cloud-hosted browsers.

02

Integrate test execution with Azure for centralized reporting and artifact management.

03

Automate test runs within CI/CD pipelines like GitHub Actions and Azure Pipelines.

04

Manage authentication and service configurations for secure and reliable test execution.

Install

Add it to your toolbox

Run in your project directory:

curl -fsSL https://spark.entire.vc/get/ag-azure-microsoft-playwright-testing-ts | bash

Overview

Azure Playwright Workspaces SDK for TypeScript

TypeScript skill for running Playwright tests at scale on Azure's cloud-hosted browser service (@azure/playwright), covering Entra ID authentication, service config setup, Azure portal reporting, CI/CD integration, and migration from the retired @azure/microsoft-playwright-testing package. Use when running Playwright test suites at scale in CI/CD, needing cloud-hosted parallel browser execution and centralized Azure portal reporting.

What it does

This skill runs Playwright tests at scale using Microsoft's cloud-hosted browser service via @azure/playwright, with integrated Azure portal reporting. It explicitly documents a package migration: the older @azure/microsoft-playwright-testing package's retirement on March 8, 2026, with @azure/playwright as its replacement - a distinction worth knowing since some codebases may still reference the retired package name. Recommended setup uses npm init @azure/playwright@latest to auto-generate config, or manual install of @azure/playwright, @playwright/test (1.47+ for basic usage, 1.57+ for Azure reporter features), and @azure/identity, with a PLAYWRIGHT_SERVICE_URL websocket endpoint pointing at a specific Azure region and Playwright workspace ID. Authentication defaults to Microsoft Entra ID (via az login locally, or an explicit DefaultAzureCredential/ManagedIdentityCredential passed to createAzurePlaywrightConfig), which wraps a local playwright.config into a service-aware config (playwright.service.config.ts) specifying OS (ServiceOS.LINUX or WINDOWS), a connection timeout, and network exposure. Tests then run against cloud browsers via the standard Playwright CLI (npx playwright test --config=playwright.service.config.ts --workers=20), optionally with the @azure/playwright/reporter added after the HTML reporter for Azure portal visibility, or by manually connecting a browser instance via getConnectOptions() for custom orchestration. Configuration options (PlaywrightServiceAdditionalOptions) cover serviceAuthType (ENTRA_ID default or ACCESS_TOKEN), OS, a custom runName for the portal, connect timeout, network exposure, and a required credential for Entra ID auth. CI/CD integration is shown for both GitHub Actions (using azure/login@v2 with OIDC federated credentials via id-token: write permission) and Azure Pipelines (AzureCLI@2 task with addSpnToEnvironment: true). A migration table maps the old package's API to the new one (getServiceConfig()createAzurePlaywrightConfig(), timeoutconnectTimeout, runIdrunName, removed useCloudHostedBrowsers flag since cloud browsers are now always enabled, and an explicit rather than implicit credential parameter), illustrated with a full before/after config example. Best practices: use Entra ID auth over access tokens, always pass an explicit credential, enable trace/video artifacts for debugging failures, scale worker count for parallelism, pick the closest region to test targets, and list the HTML reporter before the Azure reporter.

When to use - and when NOT to

Use this skill when running Playwright end-to-end tests at scale without managing your own browser infrastructure - parallel cross-browser runs, CI/CD pipelines needing many workers, or teams wanting centralized Azure portal test reporting. It is not for local, low-scale test runs where a plain local Playwright config suffices, and any code still referencing the retired @azure/microsoft-playwright-testing package must be migrated to @azure/playwright using the documented mapping. Teams behind restrictive corporate networks should also check the networkExposure setting, which controls whether the service connection is reachable from the test runner's network.

Inputs and outputs

Input is an existing Playwright config, test files, and Azure Playwright workspace credentials/region. Output is test results executed on cloud-hosted browsers, reported to the Azure portal via the Azure reporter, with scaled parallelism via the --workers flag.

Integrations

Built on @azure/playwright wrapping @playwright/test, authenticated via Azure Identity's DefaultAzureCredential/ManagedIdentityCredential, with CI/CD integration via GitHub Actions (azure/login@v2) and Azure Pipelines (AzureCLI@2).

npm init @azure/playwright@latest

Who it's for

TypeScript developers and QA teams running Playwright test suites at scale in CI/CD who want cloud-hosted parallel browser execution and centralized Azure portal reporting instead of managing their own browser infrastructure.

FAQ

Common questions

Discussion

Questions & comments · 0

Sign In Sign in to leave a comment.