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

playwright-runner missing feature overview #119

Closed mxschmitt closed 3 years ago

mxschmitt commented 3 years ago

Action items/tbd:

pavelfeldman commented 3 years ago

This all looks good. Not sure I understand the "CLI arguments as Fixture", they are not the same thing, so what exactly do you have in mind? You mean that we blend them in the params among other fixtures?

mxschmitt commented 3 years ago
fixtures.defineParameter('browserName', 'chromium, firefox, webkit', 'chromium');

fixtures.defineWorkerFixture('browserName', async ({browserName}, test) => {
  console.log(browserName) // this would be the CLI argument.
  const browserType = process.env.BROWSER || browserName;
  await test(browserType);
});

thats how we handle it currently which leads to max callstack exceeds. I thought about the following, that we have a fixture called config or parameters which holds the CLI arguments like Pytest is doing:

def launch_browser(pytestconfig):
    print(pytestconfig.getoption("--headful"))

Instead of a getter the commander option struct might make sense, so they do the flag(--) parsing for us.

pavelfeldman commented 3 years ago

The issue above is that we allow same name to be used both in declareWorkerFixture and declareParameter. I wonder if there is a compile-time check against it.

The idea behind parameters is that they are available in the test metaFunction. That way I can fail/fixme the test for headless when my matrix contains both headless and headful.

pavelfeldman commented 3 years ago

I think this is now obsolete