From d18658d41551e2f3b209584834996b5fa6133524 Mon Sep 17 00:00:00 2001 From: Viet Nguyen Duc Date: Wed, 13 Nov 2024 11:43:41 +0700 Subject: [PATCH] [ci] Update python tests Signed-off-by: Viet Nguyen Duc --- .github/workflows/ci-python.yml | 21 ++++++++++++--- py/conftest.py | 6 ++--- .../webdriver/marionette/mn_options_tests.py | 27 +++++++++++-------- 3 files changed, 36 insertions(+), 18 deletions(-) diff --git a/.github/workflows/ci-python.yml b/.github/workflows/ci-python.yml index 6f1dad4068f9b..3487592babe75 100644 --- a/.github/workflows/ci-python.yml +++ b/.github/workflows/ci-python.yml @@ -85,10 +85,16 @@ jobs: fail-fast: false matrix: include: + - browser: chrome + os: ubuntu + - browser: edge + os: ubuntu - browser: firefox + os: ubuntu with: - name: Integration Tests (remote, ${{ matrix.browser }}) + name: Integration Tests (remote, ${{ matrix.browser }}, ${{ matrix.os }}) browser: ${{ matrix.browser }} + os: ${{ matrix.os }} cache-key: py-remote-${{ matrix.browser }} run: bazel test --local_test_jobs 1 --flaky_test_attempts 3 //py:test-remote @@ -103,10 +109,17 @@ jobs: - browser: safari os: macos - browser: chrome - os: macos + os: ubuntu + - browser: edge + os: ubuntu + - browser: firefox + os: ubuntu with: - name: Integration Tests (${{ matrix.browser }}, ${{ matrix.os }}) + name: Integration Tests (local, ${{ matrix.browser }}, ${{ matrix.os }}) browser: ${{ matrix.browser }} os: ${{ matrix.os }} cache-key: py-browser-${{ matrix.browser }} - run: bazel test --flaky_test_attempts 3 //py:test-${{ matrix.browser }} + run: | + bazel test --flaky_test_attempts 3 //py:common-${{ matrix.browser }} + bazel test --flaky_test_attempts 3 //py:common-${{ matrix.browser }}-bidi + bazel test --flaky_test_attempts 5 //py:test-${{ matrix.browser }} diff --git a/py/conftest.py b/py/conftest.py index d5bf9aca8c1ea..12051a08131e0 100644 --- a/py/conftest.py +++ b/py/conftest.py @@ -32,11 +32,11 @@ "chrome", "edge", "firefox", - "ie", + # "ie", "remote", "safari", - "webkitgtk", - "wpewebkit", + # "webkitgtk", + # "wpewebkit", ) diff --git a/py/test/selenium/webdriver/marionette/mn_options_tests.py b/py/test/selenium/webdriver/marionette/mn_options_tests.py index 1e9200836aa67..cbf939df2ca05 100644 --- a/py/test/selenium/webdriver/marionette/mn_options_tests.py +++ b/py/test/selenium/webdriver/marionette/mn_options_tests.py @@ -41,20 +41,20 @@ def test_we_can_pass_options(self, driver, pages): class TestUnit: def test_ctor(self): opts = Options() - assert opts._binary is None - assert not opts._preferences + assert opts.binary_location == "" + assert opts._preferences == {"remote.active-protocols": 3} assert opts._profile is None assert not opts._arguments assert isinstance(opts.log, Log) def test_binary(self): opts = Options() - assert opts.binary is None + assert opts.binary_location == "" other_binary = FirefoxBinary() - assert other_binary != opts.binary + assert other_binary != opts.binary_location opts.binary = other_binary - assert other_binary == opts.binary + assert other_binary._start_cmd == opts.binary_location path = "/path/to/binary" opts.binary = path @@ -63,16 +63,16 @@ def test_binary(self): def test_prefs(self): opts = Options() - assert len(opts.preferences) == 0 + assert len(opts.preferences) == 1 assert isinstance(opts.preferences, dict) opts.set_preference("spam", "ham") - assert len(opts.preferences) == 1 - opts.set_preference("eggs", True) assert len(opts.preferences) == 2 + opts.set_preference("eggs", True) + assert len(opts.preferences) == 3 opts.set_preference("spam", "spam") - assert len(opts.preferences) == 2 - assert opts.preferences == {"spam": "spam", "eggs": True} + assert len(opts.preferences) == 3 + assert opts.preferences == {"eggs": True, "remote.active-protocols": 3, "spam": "spam"} def test_profile(self, tmpdir_factory): opts = Options() @@ -99,7 +99,12 @@ def test_arguments(self): def test_to_capabilities(self): opts = Options() firefox_caps = DesiredCapabilities.FIREFOX.copy() - firefox_caps.update({"pageLoadStrategy": PageLoadStrategy.normal}) + firefox_caps.update( + { + "pageLoadStrategy": PageLoadStrategy.normal, + "moz:firefoxOptions": {"prefs": {"remote.active-protocols": 3}}, + } + ) assert opts.to_capabilities() == firefox_caps profile = FirefoxProfile()