Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
Lev-v opened this issue Feb 4, 2022 · 1 comment · Fixed by #216

Comments

@Lev-v
Copy link

Lev-v commented Feb 4, 2022

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 Lev-v changed the title How to use two separate browser contexts using provided fixture and not to loose the CLI arguments? [QUESTION]How to use two separate browser contexts using provided fixture and not to loose the CLI arguments? Feb 4, 2022
@Lev-v Lev-v changed the title [QUESTION]How to use two separate browser contexts using provided fixture and not to loose the CLI arguments? [QUESTION] How to use two separate browser contexts using provided fixture and not to loose the CLI arguments? Feb 4, 2022
@mxschmitt
Copy link
Member

This should be fixed in v0.5.0: https://pypi.org/project/pytest-playwright/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants