From e0588b7d85597c7e412b28110d8ef40fd3a53939 Mon Sep 17 00:00:00 2001 From: Max Schmitt Date: Thu, 13 Jun 2024 18:50:22 +0200 Subject: [PATCH] docs: remove redudant duplicate headed paragraph --- docs/src/ci.md | 56 +++----------------------------------------------- 1 file changed, 3 insertions(+), 53 deletions(-) diff --git a/docs/src/ci.md b/docs/src/ci.md index 818e08242a..600ab784d5 100644 --- a/docs/src/ci.md +++ b/docs/src/ci.md @@ -628,65 +628,15 @@ DEBUG=pw:browser dotnet test ## Running headed -By default, Playwright launches browsers in headless mode. This can be changed by passing a flag when the browser is launched. - -```js -// Works across chromium, firefox and webkit -const { chromium } = require('playwright'); -const browser = await chromium.launch({ headless: false }); -``` - -```java -// Works across chromium, firefox and webkit -import com.microsoft.playwright.*; - -public class Example { - public static void main(String[] args) { - try (Playwright playwright = Playwright.create()) { - BrowserType chromium = playwright.chromium(); - Browser browser = chromium.launch(new BrowserType.LaunchOptions().setHeadless(false)); - } - } -} -``` - -```python async -import asyncio -from playwright.async_api import async_playwright - -async def main(): - async with async_playwright() as p: - # Works across chromium, firefox and webkit - browser = await p.chromium.launch(headless=False) - -asyncio.run(main()) -``` - -```python sync -from playwright.sync_api import sync_playwright - -with sync_playwright() as p: - # Works across chromium, firefox and webkit - browser = p.chromium.launch(headless=False) -``` - -```csharp -using Microsoft.Playwright; - -using var playwright = await Playwright.CreateAsync(); -await playwright.Chromium.LaunchAsync(new() -{ - Headless = false -}); -``` +By default, Playwright launches browsers in headless mode. See in our [Running tests](./running-tests.md) guide how to run tests in headed mode. On Linux agents, headed execution requires [Xvfb](https://en.wikipedia.org/wiki/Xvfb) to be installed. Our [Docker image](./docker.md) and GitHub Action have Xvfb pre-installed. To run browsers in headed mode with Xvfb, add `xvfb-run` before the actual command. ```bash js -xvfb-run node index.js +xvfb-run npx playwrght test ``` ```bash python -xvfb-run python test.py +xvfb-run pytest ``` ```bash java xvfb-run mvn test