microsoft / playwright-test

Build a cross-browser end-to-end test suite with Playwright.
https://playwright.dev
Apache License 2.0
776 stars 34 forks source link

QUESTION : How to pass folio parameters programmatically while using playwright-test? #228

Closed fasatrix closed 3 years ago

fasatrix commented 3 years ago

is it 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;
mxschmitt commented 3 years ago

Closing as part of the triage since the new test-runner is fundamental different. Please create a new issue if you still face into that error.