Search code examples
azure-devopstest-planplaywright-dotnet

Playwright Browser is not Installed shown in release pipeline azure devops


I am trying to run Playwright with specflow in Azure DevOps. I've successfully integrated with Azure pipelines and whenever I make a new change in the code base and push it to the GitHub, a build in the pipeline is triggered. It is working as expected.

But, I want to integrate test cases with automation scripts. For this, I've successfully integrated automated test cases with test cases in Azure DevOps. I've also created a release plan and added artifacts and tasks. enter image description here

The task runs successfully, It installs the playwright and browser in the published artifact. enter image description here

But the test still fails and throws an error. enter image description here

The error says:

    Error message
Microsoft.Playwright.PlaywrightException : Executable doesn't exist at C:\Users\VssAdministrator\AppData\Local\ms-playwright\chromium-1105\chrome-win\chrome.exe
╔════════════════════════════════════════════════════════════╗
║ Looks like Playwright was just installed or updated.       ║
║ Please run the following command to download new browsers: ║
║                                                            ║
║     pwsh bin/Debug/netX/playwright.ps1 install             ║
║                                                            ║
║ <3 Playwright Team                                         ║
╚═══════════════════════════════

I am running the same script in the YML file and it is successfully working in the build pipeline, but I am having this issue.

Any help will be appreciated.


Solution

  • I resolved it by updating script to pwsh playwright.ps1 install enter image description here

    And updating Working Directory to

    $(System.DefaultWorkingDirectory)/_TestPlayWright/TestBuildArtifact/bin/Release/net6.0