diff --git a/.github/workflows/ci-python.yml b/.github/workflows/ci-python.yml index e0c906c4d8885..4d5bcabea5605 100644 --- a/.github/workflows/ci-python.yml +++ b/.github/workflows/ci-python.yml @@ -102,17 +102,21 @@ jobs: include: - browser: safari os: macos + test-common: "" - browser: chrome os: ubuntu + test-common: "-bidi" - browser: edge os: ubuntu + test-common: "-bidi" - browser: firefox os: ubuntu + test-common: "-bidi" with: name: Integration Tests (${{ matrix.browser }}, ${{ matrix.os }}) browser: ${{ matrix.browser }} os: ${{ matrix.os }} cache-key: py-browser-${{ matrix.browser }} run: | - bazel test --local_test_jobs 1 --flaky_test_attempts 3 //py:common-${{ matrix.browser }}-bidi + bazel test --local_test_jobs 1 --flaky_test_attempts 3 //py:common-${{ matrix.browser }}${{ matrix.test-common }} bazel test --local_test_jobs 1 --flaky_test_attempts 3 //py:test-${{ matrix.browser }} diff --git a/py/selenium/webdriver/remote/webdriver.py b/py/selenium/webdriver/remote/webdriver.py index a02aa537624ab..a071c6df5e51f 100644 --- a/py/selenium/webdriver/remote/webdriver.py +++ b/py/selenium/webdriver/remote/webdriver.py @@ -1047,6 +1047,13 @@ def start_devtools(self): import_cdp() if not devtools: + if self.caps["browserName"].lower() == "firefox": + warnings.warn( + "CDP support for Firefox is deprecated and will be removed in future versions. Please switch to WebDriver BiDi.", + DeprecationWarning, + stacklevel=2, + ) + if self.caps.get("se:cdp"): ws_url = self.caps.get("se:cdp") version = self.caps.get("se:cdpVersion").split(".")[0] @@ -1127,11 +1134,6 @@ def _get_cdp_details(self): if _firefox: # Mozilla Automation Team asked to only support 85 # until WebDriver Bidi is available. - warnings.warn( - "CDP support for Firefox is deprecated and will be removed in future versions. Please switch to WebDriver BiDi.", - DeprecationWarning, - stacklevel=2, - ) version = 85 else: version = re.search(r".*/(\d+)\.", browser_version).group(1) diff --git a/py/test/selenium/webdriver/common/devtools_tests.py b/py/test/selenium/webdriver/common/devtools_tests.py index 168990a060b48..de194cddbcddf 100644 --- a/py/test/selenium/webdriver/common/devtools_tests.py +++ b/py/test/selenium/webdriver/common/devtools_tests.py @@ -25,7 +25,7 @@ def test_check_console_messages(driver, pages): devtools, connection = driver.start_devtools() console_api_calls = [] - if driver.capabilities["browserName"] == "firefox": + if driver.caps["browserName"].lower() == "firefox": assert ( record[0].message.args[0] == "CDP support for Firefox is deprecated and will be removed in future versions. Please switch to WebDriver BiDi."