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?"
try to investigate this doc https://playwright.dev/dotnet/docs/ci#azure-pipelines
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/... 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
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 firstname.lastname@example.org.