Rayrun

What is the reason behind Firefox not using storage state when running tests alongside Chromium in Playwright?

Answer

The reason Firefox doesn't use the storage state when running tests alongside Chromium in @playwright/test is due to compatibility issues. Playwright's Firefox version matches the recent Firefox Stable build, but it doesn't work with the branded version of Firefox since it relies on patches.

To overcome this limitation, you can test against the recent Firefox Stable build or opt into stable channels like "chrome" or "msedge". Using the default Playwright configuration with the latest Chromium is usually a good choice, as it ensures that upcoming Google Chrome or Microsoft Edge releases won't break your site.

import { test, expect } from '@playwright/test';

test('example test', async ({ page }) => {
  await page.goto('https://ray.run/');
  const title = await page.title();
  expect(title).toBe('Ray.run');
});

If your site relies on media codecs, which are not available in Chromium due to licensing considerations, you should use official binaries for testing. Also, consider using bundled Chromium for local testing if your organization enforces enterprise policies that limit capabilities, network proxy, or mandatory extensions.

In summary, while Firefox cannot use storage state when running tests alongside Chromium, opting into stable channels, using official binaries for media codec functionality related tests, and respecting enterprise policies can help ensure a smooth browser automation experience with minimal disruptions.

Thank you!
Was this helpful?
Still have questions?

If you still have questions, please ask a question and I will try to answer it.

TwitterGitHubLinkedIn
AboutQuestionsDiscord ForumBrowser ExtensionTagsQA Jobs

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 luc@ray.run.