From ba19a179995f715b0d8eeaaa1c809d94bd122324 Mon Sep 17 00:00:00 2001 From: Marek Dlugajczyk Date: Sun, 7 Aug 2022 11:18:03 +0200 Subject: [PATCH 1/2] Add Splinter driver kwargs Chrome example override --- README.rst | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/README.rst b/README.rst index b0870ab..5579c01 100644 --- a/README.rst +++ b/README.rst @@ -147,6 +147,24 @@ Fixtures """ return {"service_log_path": Path("/log/directory/geckodriver.log")} +.. code-block:: python + + import pytest + from selenium import webdriver + + @pytest.fixture(scope='session') + def splinter_driver_kwargs(): + """Override Chrome WebDriver options""" + chrome_options = webdriver.ChromeOptions() + + # List of Chromium Command Line Switches + # https://peter.sh/experiments/chromium-command-line-switches/ + chrome_options.add_argument("--window-size=1440,1200") + chrome_options.add_argument("--ignore-ssl-errors=yes") + chrome_options.add_argument("--ignore-certificate-errors") + + return {"options": chrome_options} + * splinter_window_size Size of the browser window on browser initialization. Tuple in form (, ). Default is (1366, 768) From 57a1c1d3b9ef11a9d01d7ce583957889a8b313b7 Mon Sep 17 00:00:00 2001 From: Marek Dlugajczyk Date: Mon, 8 Aug 2022 22:30:06 +0200 Subject: [PATCH 2/2] Add code snippet explanation [ci skip] --- README.rst | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.rst b/README.rst index 5579c01..f864171 100644 --- a/README.rst +++ b/README.rst @@ -147,6 +147,8 @@ Fixtures """ return {"service_log_path": Path("/log/directory/geckodriver.log")} +The snippet below configures Chrome to ignore certificate errors and sets a specific window size + .. code-block:: python import pytest