-
Notifications
You must be signed in to change notification settings - Fork 933
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
tests: added keyboard tests #146
Conversation
Pull Request Test Coverage Report for Build 196497422
💛 - Coveralls |
ccd8184
to
040166d
Compare
@@ -34,6 +34,7 @@ async def test_headless_should_be_able_to_read_cookies_written_by_headful( | |||
): | |||
if is_chromium and is_win: | |||
pytest.skip("see https://github.com/microsoft/playwright/issues/717") | |||
return |
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 need to add the return in the two cookie tests from yesterday. Good catch!
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.
Actually I'm not sure if we need it! It was flaky so I added it. But seems like its not needed: https://www.programcreek.com/python/example/25423/pytest.skip
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.
✨ Magic!
def pytest_collection_modifyitems(items): | ||
for item in items: | ||
item.add_marker(pytest.mark.asyncio) | ||
|
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.
Can you explain to me why this is needed? (I'm new to async in Python.)
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 it was in the global conftest.py
. A conftest.py
will be executed through the directory three and by that they can overwrite each other (which is nearest to the actual test).
This specific piece added asyncio support to the tests which was before available in all the tests. But since we split async and sync I limited the scope of it.
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.
Thanks! So async tests need to be explicitly (or programmatically) marked as async for pytest to run them?
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.
exactly with: https://github.com/pytest-dev/pytest-asyncio
You can do it manually with the decorator per test or in our case just for all the tests in that directory.
@@ -151,7 +151,7 @@ async def type( | |||
timeout: int = None, | |||
noWaitAfter: bool = None, | |||
) -> None: | |||
await self._channel.send("text", locals_to_params(locals())) | |||
await self._channel.send("type", locals_to_params(locals())) |
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'm so happy porting tests reveal this.
No description provided.