diff --git a/Browser/entry/__main__.py b/Browser/entry/__main__.py index 57b591147..4a9c71967 100644 --- a/Browser/entry/__main__.py +++ b/Browser/entry/__main__.py @@ -422,6 +422,13 @@ def launch_browser_server(browser, options): to the keyword `Launch Browser Server`. Arguments must be in the form of `argument_name=value`. See the keyword documentation for more details on the available options. + Values are converted by Robot Framework, so quote the whole `argument_name=value` pair when + it contains spaces or quotes. Otherwise the shell strips them and the conversion fails. + + \b + Example: + rfbrowser launch-browser-server chromium "timeout=10 sec" "proxy={'server': 'http://localhost:8888'}" + == Connecting to a randomly generated websocket == When the browser server is started, the generated wsEndpoint is printed to the console. diff --git a/Browser/keywords/playwright_state.py b/Browser/keywords/playwright_state.py index 84cd3c1f6..77758bdb9 100755 --- a/Browser/keywords/playwright_state.py +++ b/Browser/keywords/playwright_state.py @@ -1701,8 +1701,8 @@ def save_storage_state(self) -> str: | `New context` | `New Page` https://login.page.html | # Perform login - | VAR ${username} %{USERNAME} # Convert environment variable to secret - | VAR ${password} %{PASSWORD} # Convert environment variable to secret + | VAR ${username: Secret} %{USERNAME} # Convert environment variable to secret + | VAR ${password: Secret} %{PASSWORD} # Convert environment variable to secret | `Fill Secret` id=username ${username} | `Fill Secret` id=password ${password} | `Click` id=button diff --git a/atest/test/01_Browser_Management/playwright_state.robot b/atest/test/01_Browser_Management/playwright_state.robot index 39c0e1ffd..1e3170d4d 100644 --- a/atest/test/01_Browser_Management/playwright_state.robot +++ b/atest/test/01_Browser_Management/playwright_state.robot @@ -463,6 +463,8 @@ Launch Browser Server Via CLI ... headless\=${HEADLESS} ... port\=8273 ... wsPath\=server3 + ... timeout\=30s + ... slowMo\=0s Wait Until Keyword Succeeds ... 10s ... 1s @@ -482,6 +484,36 @@ Launch Browser Server Via CLI Get Viewport Size height == 100 [Teardown] Terminate All Processes +Launch Browser Server Via CLI With Proxy + [Documentation] The `proxy` TypedDict is converted twice: once by the CLI and once when + ... the entry point calls the keyword by attribute access. Nothing listens on port 1, so + ... a refused proxy connection is what proves the option survived both conversions and + ... reached the browser. A proxy that was accepted but ignored would let the page load + ... and this test would prove nothing. + [Tags] no-docker-pr + ${python} = Get Python Binary Path + ${process} = Start Process + ... ${python} + ... -m + ... Browser.entry + ... launch-browser-server + ... chromium + ... headless\=${HEADLESS} + ... port\=8274 + ... wsPath\=server4 + ... timeout\=30s + ... proxy\={'server': 'http://localhost:1'} + Wait Until Keyword Succeeds + ... 10s + ... 1s + ... Connect To Browser + ... wsEndpoint=ws://localhost:8274/server4 + ... browser=chromium + Run Keyword And Expect Error + ... *net::ERR_PROXY_CONNECTION_FAILED* + ... New Page ${LOGIN_URL} + [Teardown] Run Keywords Close Browser ALL AND Terminate All Processes + Connect To Browser With Timeout TRY Connect To Browser wsEndpoint=ws://10.66.66.66:8277/server2 timeout=100ms