-
Notifications
You must be signed in to change notification settings - Fork 289
Description
Version
1.52.0
Steps to reproduce
- Clone my repo at https://github.com/CurlyFire/playwrightbug
- Make sure you have all the requirements for running Dev containers (ex: Docker Desktop)
- Open Visual Studio Code with Dev Containers extension installed
- Select from the menu View/Command Palette... :"Dev Containers: Open Folder in Container..."
- Select the local folder where the repo was cloned and press Open
- Let the "Configuring Dev Container" step finish (It is installing the Playwright dependencies and Playwright browsers. See the postCreateCommand in .devcontainer/devcontainer.json for more details)
- Select from the menu Terminal/New Terminal
- From the newly opened Terminal, run the command :"dotnet test"
Expected behavior
I expected the test to pass
Actual behavior
bugplaywright test failed with 1 error(s) (5.8s)
/_/src/Playwright.TestAdapter/PlaywrightSettingsProvider.cs(99): error TESTERROR:
bugplaywright.UnitTest.PlaywrightShouldNotThrow (1ms): Error Message: System.ArgumentException : Invalid browser name from 'BROWSER' environment variable.
Supported browsers: 'chromium', 'firefox', and 'webkit'
Actual browser: '/vscode/vscode-server/bin/linux-x64/848b80aeb52026648a8ff9f7c45a9b0a80641e2e/bin/helpers/browser.sh'
Try to remove 'BROWSER' environment variable for using default browser
Additional context
The unit test is located in UnitTest.cs and is empty, it only inherits from Microsoft.Playwright.Xunit.PageTest, which initializes the Playwright Page and throws.
This was almost fixed in PR #3068
However the condition that was added to ignore the BROWSER env variable is too narrow, it only targets GitHub CodeSpaces, and not a standalone DevContainer.
Environment
- Operating System: [Linux DevContainer mcr.microsoft.com/devcontainers/dotnet:1-9.0-bookworm]
- CPU: [x64]
- Browser: [All, Chromium, Firefox, WebKit]
- .NET Version (TFM): [net9.0]