Closed mxschmitt closed 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?
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.
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.
I think this is now obsolete
--headful
CLI parameter to start them headful. Currently the custom CLI args can only be a string.HEADLESS
environment variable as an alias for it. Currently it ends up in max callstack exceed error if you try to redefine them and use the values from the CLI argument. Related to #99?--browser
CLI parameter to define the used browser type. Should work.Action items/tbd: