Skip to content

[Bug]: chromium channel 'bleeds' into Firefox options #35875

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Ionaru opened this issue May 7, 2025 · 2 comments
Closed

[Bug]: chromium channel 'bleeds' into Firefox options #35875

Ionaru opened this issue May 7, 2025 · 2 comments

Comments

@Ionaru
Copy link

Ionaru commented May 7, 2025

Version

1.52.0

Steps to reproduce

  1. Set up playwright as normal: npm init playwright@latest
  2. Set up 2 projects in playwright.config.js:
projects: [
  {
    name: "chromium",
    use: { ...devices["Desktop Chrome"], channel: "chromium" },
  },
  {
    name: "firefox",
    use: { ...devices["Desktop Firefox"] },
  },
],
  1. Write a test for each browser:
import { test, expect, chromium, firefox } from "@playwright/test";

test("Run a test - chromium", async () => {
  const browser = await chromium.launch();
  const context = await browser.newContext();
  const page = await context.newPage();
  expect(await page.evaluate(() => 1 + 1)).toBe(2);
});

test("Run a test - firefox", async () => {
  const browser = await firefox.launch();
  const context = await browser.newContext();
  const page = await context.newPage();
  expect(await page.evaluate(() => 1 + 1)).toBe(2);
});
  1. Run the tests using npx playwright test

Expected behavior

Both tests pass.

Actual behavior

The test "Run a test - firefox" fails with this error:

Error: browserType.launch: Unsupported firefox channel "chromium"

Additional context

In the console output, the "Run a test - firefox" test has a [chromium] tag, meaning the chromium project is active, but that should not prevent me from launching a Firefox browser.

Image

Environment

System:
    OS: Windows 11 10.0.26100
    CPU: (32) x64 AMD Ryzen 9 3950X 16-Core Processor
    Memory: 10.75 GB / 31.93 GB
  Binaries:
    Node: 22.14.0 - ~\AppData\Local\nvs\default\node.EXE
    Yarn: 1.22.19 - ~\AppData\Local\nvs\default\yarn.CMD
    npm: 11.3.0 - ~\AppData\Local\nvs\default\npm.CMD
    pnpm: 8.15.1 - ~\AppData\Local\nvs\default\pnpm.CMD
    bun: 1.1.43 - ~\.bun\bin\bun.EXE
  IDEs:
    VSCode: 1.99.3 - C:\Users\NAME\scoop\apps\vscode\current\bin\code.CMD
  Languages:
    Bash: 5.0.17 - C:\Windows\system32\bash.EXE
  npmPackages:
    @playwright/test: ^1.52.0 => 1.52.0
    playwright: ^1.52.0 => 1.52.0
@mxschmitt
Copy link
Member

This sounds expected, you should never use launch() inside the test and let Playwright launch the browsers for you. We expose fixtures for browser, context, and page: https://playwright.dev/docs/test-fixtures

If you manually launch a specific browser inside your test it basically means you bypass our existing project infrastructure which is supposed to parameterise tests with different browsers.

Would that work for you?

@Ionaru
Copy link
Author

Ionaru commented May 7, 2025

That makes sense, thank you for the answer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants