Skip to content

Commit 4679e55

Browse files
authored
Merge branch 'trunk' into rb_add_support_for_chrome_beta
2 parents b674937 + 679b0f3 commit 4679e55

File tree

11 files changed

+394
-260
lines changed

11 files changed

+394
-260
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ py/selenium/webdriver/remote/isDisplayed.js
7676
py/docs/build/
7777
py/docs/source/**/*
7878
!py/docs/source/conf.py
79+
!py/docs/source/*.rst
7980
py/build/
8081
py/LICENSE
8182
py/pytestdebug.log

py/conftest.py

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -370,3 +370,29 @@ def firefox_options(request):
370370
if request.config.option.headless:
371371
options.add_argument("-headless")
372372
return options
373+
374+
375+
@pytest.fixture
376+
def chromium_options(request):
377+
try:
378+
driver_option = request.config.option.drivers[0].lower()
379+
except (AttributeError, TypeError):
380+
raise Exception("This test requires a --driver to be specified")
381+
382+
# Skip if not Chrome or Edge
383+
if driver_option not in ("chrome", "edge"):
384+
pytest.skip(f"This test requires Chrome or Edge, got {driver_option}")
385+
386+
# skip tests in the 'remote' directory if run with a local driver
387+
if request.node.path.parts[-2] == "remote" and get_driver_class(driver_option) != "Remote":
388+
pytest.skip(f"Remote tests can't be run with driver '{driver_option}'")
389+
390+
if driver_option == "chrome":
391+
options = webdriver.ChromeOptions()
392+
elif driver_option == "edge":
393+
options = webdriver.EdgeOptions()
394+
395+
if request.config.option.headless:
396+
options.add_argument("--headless=new")
397+
398+
return options

py/docs/.readthedocs.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,11 @@ version: 2
1010
build:
1111
os: ubuntu-24.04
1212
tools:
13-
python: "3.11"
13+
python: "3.12"
1414
commands:
1515
- pip install -r py/docs/requirements.txt
1616
- pip install -r py/requirements.txt
17+
- cd py && python3 generate_api_module_listing.py && cd
1718
- PYTHONPATH=py sphinx-autogen -o $READTHEDOCS_OUTPUT/html py/docs/source/api.rst
1819
- PYTHONPATH=py sphinx-build -b html -d build/docs/doctrees py/docs/source $READTHEDOCS_OUTPUT/html
1920

py/docs/Makefile

Lines changed: 0 additions & 131 deletions
This file was deleted.

py/docs/README.rst

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -49,22 +49,14 @@ and develop the Python docs.
4949
To clean up the build assets and tox cache
5050
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
5151

52-
Although there is a Sphinx Makefile option, to clean up using the tox environment above, one can
53-
manually clean the build assets by deleting the ``build`` directory on the root (``selenium/build``
54-
using the default directory on git clone). Note that tox caches parts of the build and recognizes
55-
changes to speed up the build. To start fresh, delete the aformentioned directory to clean the
56-
Sphinx build assets and delete the ``selenium/py/.tox`` directory to clean the tox environment.
52+
After using the tox environment above, you can clean up the build assets by deleting the ``build``
53+
directory in the root of the repo. Note that tox caches parts of the build and recognizes changes
54+
to speed up the build. To start fresh, delete the ``py/.tox`` directory to clean the tox environment.
5755

5856

5957
Known documentation issues
6058
==========================
6159

62-
The API Reference primarily builds from the source code. But currently the initial template stating
63-
which modules to document is hard coded within ``py/docs/source/api.rst``. So if modules are added or
64-
removed, then the generated docs will be inaccurate. It would be preferred that the API docs generate
65-
soley from the code if possible. This is being tracked in
66-
`#14178 <https://github.com/SeleniumHQ/selenium/issues/14178>`_
67-
6860
We are working through the Sphinx build warnings and errors, trying to clean up both the syntax and
6961
the build.
7062

0 commit comments

Comments
 (0)