Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions .github/workflows/ci-python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,22 @@ jobs:
env:
TOXENV: mypy

unit-tests:
name: Unit Tests
needs: build
uses: ./.github/workflows/bazel.yml
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu
- os: macos
with:
name: Unit Tests (${{ matrix.os }})
os: ${{ matrix.os }}
cache-key: python-unit-test-${{ matrix.os }}
run: bazel test //py:unit

remote-tests:
name: Remote Tests
needs: build
Expand Down Expand Up @@ -83,6 +99,10 @@ jobs:
os: ubuntu
- browser: firefox
os: ubuntu
- browser: chrome
os: windows
- browser: edge
os: windows
with:
name: Integration Tests (${{ matrix.browser }}, ${{ matrix.os }})
browser: ${{ matrix.browser }}
Expand All @@ -108,4 +128,5 @@ jobs:
os: ${{ matrix.os }}
cache-key: py-browser-${{ matrix.browser }}
run: |
bazel test --local_test_jobs 1 --flaky_test_attempts 3 --pin_browsers=true //py:common-${{ matrix.browser }}
bazel test --local_test_jobs 1 --flaky_test_attempts 3 --pin_browsers=true //py:test-${{ matrix.browser }}
1 change: 1 addition & 0 deletions py/selenium/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.

"""Selenium type definitions."""

from collections.abc import Iterable
Expand Down
4 changes: 4 additions & 0 deletions py/test/selenium/webdriver/chrome/chrome_service_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

import os
import subprocess
import sys
import time
from unittest.mock import patch

Expand Down Expand Up @@ -107,6 +108,9 @@ def test_log_output_null_default(driver, capfd) -> None:
driver.quit()


@pytest.mark.xfail(
sys.platform == "win32", reason="chromedriver doesn't return an error on windows if you use an invalid profile path"
)
@pytest.mark.no_driver_after_test
def test_driver_is_stopped_if_browser_cant_start(clean_driver, clean_options, driver_executable) -> None:
clean_options.add_argument("--user-data-dir=/no/such/location")
Expand Down
4 changes: 4 additions & 0 deletions py/test/selenium/webdriver/edge/edge_service_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

import os
import subprocess
import sys
import time
from unittest.mock import patch

Expand Down Expand Up @@ -107,6 +108,9 @@ def test_log_output_null_default(driver, capfd) -> None:
driver.quit()


@pytest.mark.xfail(
sys.platform == "win32", reason="edgedriver doesn't return an error on windows if you use an invalid profile path"
)
@pytest.mark.no_driver_after_test
def test_driver_is_stopped_if_browser_cant_start(clean_driver, clean_options, clean_service, driver_executable) -> None:
clean_options.add_argument("--user-data-dir=/no/such/location")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def test_get_remote_connection_headers_defaults():
assert headers.get("Accept") == "application/json"
assert headers.get("Content-Type") == "application/json;charset=UTF-8"
assert headers.get("User-Agent").startswith(f"selenium/{__version__} (python ")
assert headers.get("User-Agent").split(" ")[-1] in {"windows)", "mac)", "linux)", "mac", "windows", "linux"}
assert headers.get("User-Agent").split(" ")[-1].rstrip(")") in ("win32", "windows", "mac", "linux")


def test_get_remote_connection_headers_adds_auth_header_if_pass(recwarn):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
# specific language governing permissions and limitations
# under the License.


import pytest

from selenium.webdriver.common.virtual_authenticator import VirtualAuthenticatorOptions
Expand Down