Skip to content

fix: env param in BrowserType.launch doesn't serialize properly to Nodejs #612

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 2 commits into from
Apr 5, 2021

Conversation

nmashewske
Copy link
Contributor

The Nodejs code expects the env param to be of type EnvArr, which is defined as EnvArray = { name: string, value: string }[];
This updates the playwright-python code to format the env dict to the same format to fix the error:
playwright._impl._api_types.Error: env: expected array, got object

Example to reproduce error:

from playwright.sync_api import sync_playwright

with sync_playwright() as p:
    env = {"SSLKEYLOGFILE": "~/test"}
    browser = p.chromium.launch(env=env)
    page = browser.new_page()
    page.goto("http://playwright.dev")
    print(page.title())
    browser.close()

The Nodejs code expects the env param to be of type EnvArr, which is defined as EnvArray = { name: string, value: string }[];
This updates the playwright-python code to format the env dict to the same format to avoid crashing
@pavelfeldman pavelfeldman merged commit 4ac3256 into microsoft:master Apr 5, 2021
@pavelfeldman
Copy link
Member

It is not the EnvArr that we need to match, but rather a protocol.yml, but the fix is the same!

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

Successfully merging this pull request may close these issues.

2 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy