Rayrun
← Back to Discord Forum

Azure pipeline

Hi, how can I run playwright tests in azure pipelines? It keeps telling me that the browsers are not installed. I got this

- task: DotNetCoreCLI@2
      displayName: New Manifest for tool
      inputs:
        command: custom
        custom: 'new '
        arguments: tool-manifest

    - task: DotNetCoreCLI@2
      displayName: Install Playwright CLI
      inputs:
        command: custom
        custom: 'tool '
        arguments: install Microsoft.Playwright.CLI     

# task to build the projects
   - task: DotNetCoreCLI@2
      displayName: Run Playwright Install
      inputs:
        command: custom
        custom: 'tool '
        arguments: run playwright install

# then I use "dotnet test" to test my projects

the error message is this

Host system is missing dependencies to run browsers.     ║
║ Please install them with the following command:          ║
║                                                          ║
║     sudo pwsh bin/Debug/netX/playwright.ps1 install-deps ║
║                                                          ║
║ Alternatively, use apt:                                  ║
║     sudo apt-get install libgbm1                         ║
║                                                          ║
║ <3 Playwright Team

However, I'm missing a full example here as the path is not correct.

This thread is trying to answer question "How can I run Playwright tests in Azure Pipelines and resolve issues with missing browsers and incorrect paths?"

8 replies

I think this documentation is wrong

- script: dotnet build --configuration Release
  displayName: 'Build'
- script: pwsh bin/Debug/net6.0/playwright.ps1 install --with-deps

When we build with the Release configuration, the second path should be bin/Release and not bin/Debug. Also, bin/... is not the root path. So it would be awesome to have a working example in the documentation as I'm struggling with the paths.

Fixed the paths, another error popping up

Installing dependencies...
Switching to root user to install dependencies...
sudo: unable to resolve host cloudcl-debian-agents: Temporary failure in name resolution
sudo: a terminal is required to read the password; either use the -S option to read from standard input or configure an askpass helper
sudo: a password is required
Failed to install browsers
Error: Installation process exited with code: 1
##[error]Bash exited with code '1'.

Well yea. I cannot install the browsers on the agent because we need a project for getting the playwright.ps1 and the browser files. Kind of unlucky architecture here 🥹

Is it maybe possible to install playwright through ssh and without any project? I mean it's just the CLI and the browsers, right?

How can I run "sudo" when using the provided docker image by playwright? It says "command not found"

Although it's mentioned that playwright is backed by microsft, it lacks a lot of support here. Maybe we did the wrong decision on the framework... 🙂

zarrensaerden
zarrensaerden

Here's an excerpt from an ADO pipeline we use to run Playwright tests. It's been working great for us for over a year. I've masked out some identifying info, but you should get the idea and some of the tasks are specific to our setup.

zarrensaerden
zarrensaerden
TwitterGitHubLinkedIn
AboutQuestionsDiscord ForumBrowser ExtensionTagsQA Jobs

Rayrun is a community for QA engineers. I am constantly looking for new ways to add value to people learning Playwright and other browser automation frameworks. If you have feedback, email [email protected].