DriversRecommendedOutdated drivers can make a good PC feel brokenScan driver issues before chasing fixes manually.Scan NowOctober DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsPC HealthRecommendedCrashes, freezes, slowdowns? Check your PC nowSpot repairable issues before they interrupt work.Check PC×
Skip to content
Azure Pipelines

How to Fix Playwright Tests Failing and Azure Pipelines Hanging

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

When Playwright works locally but fails or stalls in Azure Pipelines, first make the CI environment predictable: install the browsers and Linux dependencies, run with CI=true, start with one worker, and give Playwright a globalTimeout shorter than the Azure job limit. Then diagnose the stage that stopped—installation, browser launch, navigation, a test, or artifact publication—instead of treating every long run as the same timeout problem.

Start by identifying where the run stops

A pipeline that appears to hang may be waiting in test code, retrying or waiting on a page, unable to launch a browser, or spending time transferring reports and traces. A failed assertion, a browser launch error, a per-test timeout, and a job with no new log output need different fixes.

Use the last completed Azure task and the surrounding log lines to classify the failure before changing timeouts. Note whether the failure is consistent or intermittent, whether it happens locally or only in CI, and whether it occurs before or after the first test begins. This narrows the investigation to the relevant phase:

  • Install: dependencies or browser binaries are missing, or installation failed.
  • Launch: the browser cannot start in the agent environment.
  • Navigation: the browser starts, but the application or a dependency is unreachable or slow.
  • Test or teardown: an assertion, wait, or cleanup path stalls or fails.
  • Reporting: tests finish, but result or trace files take too long to publish.

Make the Azure job install browsers and dependencies

A browser installation that exists on a developer’s machine is not automatically present on a clean build agent. Install the project’s Node dependencies and Playwright browser dependencies as pipeline steps before running the suite. The baseline below follows Playwright’s documented Azure Pipelines pattern; adjust the Node version and test-result paths to match your project.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
#1 Best Overall
Sale
Philips 24 Inch Computer Monitor FHD 100Hz VA VESA Flicker-Free, 241V8LB
  • CRISP CLARITY: This 23.8″ Philips V line monitor delivers crisp Full HD 1920x1080 visuals. Enjoy movies, shows and videos with remarkable detail
  • INCREDIBLE CONTRAST: The VA panel produces brighter whites and deeper blacks. You get true-to-life images and more gradients with 16.7 million colors
  • THE PERFECT VIEW: The 178/178 degree extra wide viewing angle prevents the shifting of colors when viewed from an offset angle, so you always get consistent colors
  • WORK SEAMLESSLY: This sleek monitor is virtually bezel-free on three sides, so the screen looks even bigger for the viewer. This minimalistic design also allows for seamless multi-monitor setups that enhance your workflow and boost productivity
  • A BETTER READING EXPERIENCE: For busy office workers, EasyRead mode provides a more paper-like experience for when viewing lengthy documents
trigger:
- main

pool:
  vmImage: ubuntu-latest

steps:
- task: UseNode@1
  inputs:
    version: '22'
  displayName: Install Node.js

- script: npm ci
  displayName: Install dependencies

- script: npx playwright install --with-deps
  displayName: Install Playwright browsers

- script: npx playwright test
  displayName: Run Playwright tests
  env:
    CI: 'true'

- task: PublishTestResults@2
  displayName: Publish test results
  inputs:
    searchFolder: test-results
    testResultsFormat: JUnit
    testResultsFiles: e2e-junit-results.xml

npm ci installs from the lockfile, while npx playwright install --with-deps installs the browser binaries and, on supported Linux environments, required operating-system packages. Confirm that this step completes successfully in the actual job logs; a later test failure can otherwise be a misleading symptom of an earlier install problem.

For Linux agents, the supported alternatives include using the official Playwright Docker image or installing the needed dependencies through the Playwright CLI. Keep the chosen image or agent environment aligned with the project’s runtime, and do not assume that browser dependencies installed on one machine carry over to another agent.

Rank #2
Philips 22 Inch Computer Monitor FHD 100Hz VA VESA Flicker-Free, 221V8LB
  • CRISP CLARITY: This 22 inch class (21.5″ viewable) Philips V line monitor delivers crisp Full HD 1920x1080 visuals. Enjoy movies, shows and videos with remarkable detail
  • 100HZ FAST REFRESH RATE: 100Hz brings your favorite movies and video games to life. Stream, binge, and play effortlessly
  • SMOOTH ACTION WITH ADAPTIVE-SYNC: Adaptive-Sync technology ensures fluid action sequences and rapid response time. Every frame will be rendered smoothly with crystal clarity and without stutter
  • INCREDIBLE CONTRAST: The VA panel produces brighter whites and deeper blacks. You get true-to-life images and more gradients with 16.7 million colors
  • THE PERFECT VIEW: The 178/178 degree extra wide viewing angle prevents the shifting of colors when viewed from an offset angle, so you always get consistent colors

Stabilize concurrency and set a Playwright run limit

More workers can make a suite finish sooner on a capable machine, but can also compete for CPU, memory, disk, and browser resources on a constrained agent. Playwright recommends one worker in CI as a stability-first setting. Increase concurrency only after observing a stable run and confirming the agent has spare capacity; if the suite needs more throughput, consider distributing work across jobs rather than immediately increasing workers in one process.

Set a Playwright-wide time limit as well. A test run has no upper bound by default, so a stalled run can occupy an Azure job until the job itself is killed. A global limit lets Playwright stop and report first.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #3
Sale
Dell 24 Monitor - SE2426H - 23.8-inch FHD (1920x1080) 144Hz 1ms Display, in-Plane Switching (IPS) Technology, AMD FreeSync™, TÜV 3-Star 2X HDMI, Tilt
  • Clear visuals. Fluid motion: A 144Hz refresh rate and 1ms MPRT deliver smooth, tear‑free motion across work, gaming, and streaming for clearer, more fluid viewing.
  • Eye comfort: TÜV Rheinland 3‑star* certification reduces harmful blue light while preserving stunning color quality without compromise. *TÜV Rheinland 3-star eye comfort certification.
  • Wide viewing angle: Get consistent views across a wide 178° /178° viewing angle.
  • In-Plane Switching (IPS): See excellent color accuracy and consistency across wide viewing angles with In-plane Switching (IPS) technology.
  • Ultra-thin bezels: Maximize your viewing experience with thin bezels.
import { defineConfig } from '@playwright/test';

export default defineConfig({
  workers: process.env.CI ? 1 : undefined,
  globalTimeout: 60 * 60 * 1000,
  use: {
    trace: 'retain-on-failure',
  },
});

The example sets a one-hour Playwright global limit; it is a starting value, not a universal recommendation. Choose a value below the effective Azure job limit and leave time for reports and other cleanup steps. If the job limit expires first, Azure can terminate the process before Playwright has a chance to produce a useful timeout report.

Keep the different timeout controls separate

Playwright’s documented default per-test timeout is 30 seconds. That is separate from timeouts for individual actions or navigation, and separate again from the overall globalTimeout. Raising one timeout does not necessarily resolve a hang controlled by another one. When a test times out, use its error and trace to determine whether the test itself, a page action, navigation, or the entire run reached its limit before changing a setting.

Rank #4
Samsung 27" Essential S3 (S36GD) Series FHD 1800R Curved Computer Monitor
  • CURVED FOR ENHANCED ENGAGEMENT: An immersive viewing experience with a curved monitor that wraps more closely around your field of vision; It creates a wider view, enhancing depth perception and minimizing peripheral distraction
  • SMOOTH PERFORMANCE FOR SEAMLESS CONTENT: Stay in the action when playing games, watching videos, or working on creative projects; The 100Hz refresh rate reduces lag and motion blur so you don't miss a thing in fast-paced moments¹
  • MORE GAMING POWER: Gain the edge with optimizable game settings; Color and image contrast can be adjusted to see scenes more vividly and spot enemies hiding in the dark; Game Mode adjusts any game to fill the screen so you can view every detail²
  • KEEP IT EASY ON THE EYES: Care for your eyes and stay comfortable, even during long sessions; Advanced eye comfort technology certified by TÜV reduces eye strain by minimizing blue light and reducing irritating screen flicker²
  • INCREASED VERSATILITY: Connect to more; Plug devices straight into your monitor for increased flexibility, making your computing environment even more convenient

Azure also has a job-level timeout. Microsoft’s current troubleshooting documentation gives maximums of 60 minutes per job for free Microsoft-hosted agents on private repositories and 360 minutes on public repositories. These are maximum limits for those stated cases, not recommended durations or a guarantee that a job will use the full allowance. Set the effective Azure job timeout above Playwright’s global limit, subject to the maximum that applies to your agent and repository.

Work through a hanging run in a fixed order

  1. Check for deliberate pauses left in the code. Search the test suite for page.pause() and other debugging waits. A pause that was useful locally can stop unattended CI execution. Remove it from the CI path rather than trying to outwait it.
  2. Confirm installation and browser launch. Check that the browser-install command completed, then look for launch errors in the test task. If launch fails, verify the agent or Playwright image matches the project environment and includes the required browser dependencies.
  3. Run with one worker. Keep workers at 1 while diagnosing. If that makes an intermittent failure stable, measure the agent’s CPU, memory, disk use, and browser count before raising workers. A change in stability is evidence of resource pressure, not proof that concurrency is the only issue.
  4. Check the target from the agent’s point of view. Validate that the application URL resolves and can be reached from the pipeline environment. Check DNS, firewall or proxy rules, service connections, permissions, secrets, and whether the target environment is available to that agent. A URL reachable from a developer laptop may not be reachable from an Azure-hosted or self-hosted agent.
  5. Inspect a failing trace and task logs. Retain traces on failure, then use the Playwright report and the Azure task log to determine the last operation before the stall. Logs can distinguish a browser that never launched from a page that launched but did not finish navigating; a trace can show what the browser was doing at failure time.
  6. Isolate slow trace transfer if needed. In remote setups, trace files can add transfer overhead. If the test work appears complete but the pipeline is slow around artifact handling, temporarily disable tracing for one diagnostic run and compare the task timing. Restore useful failure evidence after isolating the cause.
  7. Make the timeout order explicit. Set a finite Playwright globalTimeout and ensure the Azure job timeout is longer, with headroom for report publication. If Azure ends the job first, lower the Playwright limit or increase the job limit within the applicable allowance.
  8. Publish evidence even after failure. Configure test-result and report publication to run on failure as well as success. Microsoft’s CI/CD troubleshooting guidance recommends an always-run condition for publication so failed tests still leave evidence. For example, set condition: always() on the relevant publication step and verify the configured search folder and filenames match the files your test run actually creates.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Make test results and reports usable after a failure

The sample pipeline expects a JUnit file named e2e-junit-results.xml under test-results. Ensure your Playwright reporter is configured to write that format and path; a publication step cannot publish a file the test command never created. If your project uses another output directory or filename, change the Azure task inputs to match it.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Best Value
Sale
Sceptre New 22-Inch Gaming Monitor, FHD 1080p, Up to 144Hz, HDMI, DisplayPort, Built-in Speakers, Machine Black (E225W-FW144 Series, 2026)
  • 【INTEGRATED SPEAKERS】Whether you're at work or in the midst of an intense gaming session, our built-in speakers provide rich and seamless audio, all while keeping your desk clutter-free.
  • 【EASY ON THE EYES】 Protect your eyes and enhance your comfort with Blue-Light Shift technology. This feature reduces harmful blue light emissions from your screen, helping to alleviate eye strain during long hours of use and promoting healthier viewing habits.
  • 【WIDEN YOUR PERSPECTIVE】Our sleek minimal bezel design ensures undivided attention. The nearly bezel-free display seamlessly connects in a dual monitor arrangement, delivering an unobstructed view that lets you focus on more at once, completely distraction-free.

Keep separate evidence for separate needs: JUnit results make test outcomes available to Azure, while Playwright’s trace and report help investigate browser behavior. When a failure occurs, first verify that the files exist on the agent, then confirm the publication task points at them and runs even after test failure. If a remote transfer is the slow part, isolate it as a separate phase rather than changing browser or assertion timeouts blindly.

Choose a fix based on the failure phase

What you observe First checks Useful next step
Install task fails or browser is missing npm ci and browser/dependency installation logs Complete the Playwright install step and validate the selected agent or image.
Browser fails before the first test Launch error, installed browser version, Linux dependencies Align the agent environment with the project and install dependencies in the job.
Navigation hangs or times out Target URL reachability, DNS, proxy, firewall, service connection, region Test access from the agent and use trace/log evidence to identify the blocked navigation.
Failures are intermittent under load Worker count, agent CPU/memory/disk, browser count Start with one worker; increase only after confirming capacity.
No useful report appears Generated filenames, report paths, publication condition Publish on failure and align Azure inputs with actual output files.
Azure kills a still-running test process Per-test, action/navigation, global, and job timeout values Bound the Playwright run below the Azure job limit and preserve publication headroom.

Or skip the browser setup

If your immediate need is a clean screenshot of a page for a report or visual reference—not to execute or replace your Playwright assertions—you can request one from ScreenshotNeo, a website screenshot API and MCP server. It accepts a URL and returns an image or PDF; this does not fix a failing test suite or prove that application behavior passes.

For example, request a WebP screenshot with one GET call (see the ScreenshotNeo API documentation):

curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp

Equivalent Python:

import requests

r = requests.get(
    "https://api.screenshotneo.com/v1/shot",
    params={"access_key": "YOUR_API_KEY", "url": "https://stripe.com"},
    timeout=90,
)
open("shot.webp", "wb").write(r.content)

Equivalent Node.js:

const q = new URLSearchParams({ access_key: 'YOUR_API_KEY', url: 'https://stripe.com' });
const res = await fetch(`https://api.screenshotneo.com/v1/shot?${q}`);

ScreenshotNeo accepts cookie or consent banners and removes more than 60 known consent platforms, newsletter popups, and chat widgets before capture; these steps can be turned off. Bot checks, blank pages, timeouts, failed loads, and cache hits are not billed, and responses identify the page verdict and billing status. Its MCP server provides take_screenshot, get_page_info, and capture_pdf tools for AI agents. The free plan includes 1,000 screenshots per month with no card; paid plans start at $5 for 3,000 screenshots.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Sign up for 1,000 free screenshots a month, with no card required.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Read next

Recommended PC Tool
Recommended PC Tool
PC Slower Than It Used to Be?Free scan - under a minute
Outdated Drivers Are Slowing You DownFree scan - exact matches

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.