playwright-pytest icon indicating copy to clipboard operation
playwright-pytest copied to clipboard

[QUESTION] How to use two separate browser contexts using provided fixture and not to loose the CLI arguments?

Open Lev-v opened this issue 4 years ago • 0 comments

I have a common case of first authorised user creates 'issue', second authorised user should 'approve' it. I don't wont to logout with the first user because login procedure time is quite long.

I hoped to create separate browser.context for the second user but i'm not sure how to do that correctly using the fixtures provided, as according to the rules of pytest they are used only once and so I'm not able to use context or page fixtures because they already have context created, but if I go one level highter to Browser fixture I totally loose the provided ability to use CLI arguments, such as --tracing. And this is the main reason to use the plugin itself.

https://github.com/microsoft/playwright-pytest/issues/44 example doesn't help because wihile it does create several browsers, CLI arguments are not working as it is using higher level Browser fixture Tried to Google for several hours but couldn't find any examples, could anyone please provide me with some?

Lev-v avatar Feb 04 '22 03:02 Lev-v