How to pass folio parameters programmatically while using playwright-test?

Viewed 155

Does anyone know if it is possible and if yes how to pass folio CLI --param programmatically while using playwright-test? I was expecting the following to open chrome headful but it doesn't. I looked at the documentation but doesn't have many examples.

import {folio} from '@playwright/test'
import {chromium,LaunchOptions } from 'playwright';

const fixtures  = folio.extend()

fixtures.browserOptions.override(async({browserOptions},runTest) => {
  const modifiedOptions: LaunchOptions = {
    ...browserOptions,
    ...chromium.launch({
      headless: false
    })
  }
  await runTest(modifiedOptions);  
});

const extendedfolio = fixtures.build();
export const it = extendedfolio.it;
export const describe = extendedfolio.describe;
0 Answers
Related