-
Notifications
You must be signed in to change notification settings - Fork 70
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
feat: add more testing goodies (screenshot, video, tracing) #70
Conversation
33469de
to
68c8da8
Compare
68c8da8
to
aa6fff1
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's wait a bit with this to closer follow js version.
return os.path.join(output_dir, slugify(request.node.nodeid), folder_or_file_name) | ||
|
||
|
||
@pytest.fixture() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was a "session" fixture before - what's the difference?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Before: Context options were for the whole test execution
After: Context options are per test. Since we re-create a context for every test, this should be a better handling.
See here for reference: https://docs.pytest.org/en/6.2.x/fixture.html#fixture-scopes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am a bit worried whether this will affect some users. For example, their custom fixture depends on this one, and now it cannot because of wrong scope? I see changes in our own tests that kind of confirm this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, but since this is 0.x we are allowed to do that. Before it was more a wrong implementation from my side.
) -> Dict: | ||
context_args = {} | ||
if device: | ||
context_args.update(playwright.devices[device]) | ||
base_url = pytestconfig.getoption("--base-url") | ||
if base_url: | ||
context_args["base_url"] = base_url | ||
|
||
video_option = pytestconfig.getoption("--video") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So, there is a command line argument? I don't see any docs changed, could you please add some documentation?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We keep the documentation in the upstream repo. Will follow-up once its landed.
see here: https://playwright.dev/python/docs/next/test-runners
return os.path.join(output_dir, slugify(request.node.nodeid), folder_or_file_name) | ||
|
||
|
||
@pytest.fixture() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am a bit worried whether this will affect some users. For example, their custom fixture depends on this one, and now it cannot because of wrong scope? I see changes in our own tests that kind of confirm this?
515090c
to
604f63b
Compare
Fixes ##62