microsoft / playwright

Playwright is a framework for Web Testing and Automation. It allows testing Chromium, Firefox and WebKit with a single API.
https://playwright.dev
Apache License 2.0
66.41k stars 3.63k forks source link

[BUG] GitHub fails to execute tests with chromium does not exist error #12150

Closed ladeak closed 2 years ago

ladeak commented 2 years ago

Context:

GitHub fails to execute tests with chromium does not exist error:

Code Snippet

Error Message:
   Microsoft.Playwright.PlaywrightException : Executable doesn't exist at C:\Users\runneradmin\AppData\Local\ms-playwright\chromium-9[56](https://github.com/[path]/runs/5214076314?check_suite_focus=true#step:9:56)323\chrome-win\chrome.exe
╔═════════════════════════════════════════════════════════════════════════╗
║ Looks like Playwright Test or Playwright was just installed or updated. ║
║ Please run the following command to download new browsers:              ║
║                                                                         ║
║     playwright install                                                  ║
║                                                                         ║
║ <3 Playwright Team                                                      ║
╚═════════════════════════════════════════════════════════════════════════╝
  Stack Trace:
     at Microsoft.Playwright.Transport.Connection.SendMessageToServerAsync[T](String guid, String method, Object args)
   at Microsoft.Playwright.Core.BrowserType.LaunchAsync(BrowserTypeLaunchOptions options)

Describe the bug

Using the following GitHub Action:

    - uses: actions/setup-node@v2
      with:
        node-version: '14.x'
    - name: Install Playwright
      run: npx playwright install --with-deps
    - name: Test
      run: dotnet test --configuration ${{ env.CONFIGURATION }} --no-build

After having playwright installed on GitHub, it still fails and shows me to install playwright. I don't see any errors during installation step:

Run npx playwright install --with-deps
  npx playwright install --with-deps
  shell: C:\Program Files\PowerShell\7\pwsh.EXE -command ". '{0}'"
  env:
    CONFIGURATION: Release
    DOTNET_VERSION: [6](https://github.com/[path]/runs/5214076314?check_suite_focus=true#step:7:6).0.x
    DOTNET_ROOT: C:\Users\runneradmin\AppData\Local\Microsoft\dotnet

Success Restart Needed Exit Code      Feature Result                               
------- -------------- ---------      --------------                               
True    No             Success        {Media Foundation}
ladeak commented 2 years ago

I seem to get the same error on an ubuntu runner as well:

Error Message:
   Microsoft.Playwright.PlaywrightException : Executable doesn't exist at /home/runner/.cache/ms-playwright/chromium-956323/chrome-linux/chrome
╔═════════════════════════════════════════════════════════════════════════╗
║ Looks like Playwright Test or Playwright was just installed or updated. ║
║ Please run the following command to download new browsers:              ║
║                                                                         ║
║     playwright install                                                  ║
║                                                                         ║
║ <3 Playwright Team                                                      ║
╚═════════════════════════════════════════════════════════════════════════╝
  Stack Trace:
     at Microsoft.Playwright.Transport.Connection.SendMessageToServerAsync[T](String guid, String method, Object args)
   at Microsoft.Playwright.Core.BrowserType.LaunchAsync(BrowserTypeLaunchOptions options)
mxschmitt commented 2 years ago

This error message is miss-leading, its getting fixed in 1.19.1 for .NET (https://github.com/microsoft/playwright/pull/12025).

You need to install the actual browser of your .NET Playwright installation, you can do it with: pwsh bin\Debug\netX\playwright.ps1 install

ladeak commented 2 years ago

Thank you for the workaround. It resolves the issue until we get 1.19.1 :)