playwright-community / jest-playwright

Running tests using Jest & Playwright
MIT License
532 stars 75 forks source link

[Question/Help] Record video for firefox #813

Closed devjp1 closed 1 year ago

devjp1 commented 1 year ago

Hello,

Would like to get some help. I'm trying to get test video for firefox, it works for chromium but I'm not able to get anything for firefox. Is it supported?

//setup.js
beforeAll(async () => {
  try {
    await page.goto(url);
  } catch (error) {
    console.error(error);
  }
};

beforeEach(async () => {
  try {
    capture = await saveVideo(page, `test-results/videos/${testName}-${browserName}.mp4`);
  } catch (error) {
    console.error(error);
  }
}; 
 //config.json: 

{
  "projects": [
    {
      "preset": "jest-playwright-preset",
      "testEnvironmentOptions": {
        "jest-playwright": {
          "browsers": [
            "firefox"
          ],
          "launchOptions": {
            "headless": true,
            "args": [
              "--disable-dev-shm-usage"
            ]
          },
          "contextOptions":
          {
            "acceptDownloads": true,
            "viewport": {
              "width": 1920,
              "height": 1080
            }
          }
        }
      },