Skip to content

test: stabilize test_set_viewport_for_default_user_context #3469

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

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion src/bidiServer/BrowserInstance.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,6 @@ export class BrowserInstance {
'--allow-browser-signin=false',
'--disable-component-update',
'--disable-default-apps',
'--disable-infobars',
'--disable-notifications',
'--disable-popup-blocking',
'--disable-search-engine-choice-screen',
Expand Down
27 changes: 20 additions & 7 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,22 +116,35 @@ async def capabilities(request):
async def websocket(_websocket_connection, test_headless_mode, capabilities,
request):
"""Return a websocket with an active BiDi session."""
default_capabilities = {"webSocketUrl": True, "goog:chromeOptions": {}}
default_capabilities = {
"webSocketUrl": True,
"goog:chromeOptions": {
"args": ["--disable-infobars"]
}
}

if os.getenv(
"VERBOSE"
) == "true" and request and request.node and request.node.name:
default_capabilities["goog:pytest_name"] = request.node.name

maybe_browser_bin = os.getenv("BROWSER_BIN")
if maybe_browser_bin:
default_capabilities["goog:chromeOptions"][
"binary"] = maybe_browser_bin

if test_headless_mode != "false":
if test_headless_mode == "old":
default_capabilities["goog:chromeOptions"]["args"] = [
"--headless=old", '--hide-scrollbars', '--mute-audio'
]
default_capabilities["goog:chromeOptions"]["args"].append(
"--headless=old")
default_capabilities["goog:chromeOptions"]["args"].append(
"--hide-scrollbars")
default_capabilities["goog:chromeOptions"]["args"].append(
"--mute-audio")
else:
# Default to new headless mode.
default_capabilities["goog:chromeOptions"]["args"] = [
"--headless=new"
]
default_capabilities["goog:chromeOptions"]["args"].append(
"--headless=new")

session_capabilities = merge_dicts_recursively(default_capabilities,
capabilities)
Expand Down
Loading