Skip to content

Commit 847eedc

Browse files
committed
Merge remote-tracking branch 'origin/rb_bidi_get_client_windows' into rb_bidi_get_client_windows
2 parents 9190773 + 8a426e9 commit 847eedc

File tree

6 files changed

+21
-32
lines changed

6 files changed

+21
-32
lines changed

.github/workflows/ci-python.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,13 @@ jobs:
2121
- name: Checkout source tree
2222
uses: actions/checkout@v4
2323
- name: Set up Python 3.9
24-
uses: actions/setup-python@v4
24+
uses: actions/setup-python@v6
2525
with:
2626
python-version: 3.9
2727
- name: Install dependencies
2828
run: |
2929
python -m pip install --upgrade pip
30-
pip install tox==4.27.0
30+
pip install tox==4.30.2
3131
- name: Generate docs
3232
run: tox -c py/tox.ini
3333
env:
@@ -41,13 +41,13 @@ jobs:
4141
- name: Checkout source tree
4242
uses: actions/checkout@v4
4343
- name: Set up Python 3.9
44-
uses: actions/setup-python@v4
44+
uses: actions/setup-python@v6
4545
with:
4646
python-version: 3.9
4747
- name: Install dependencies
4848
run: |
4949
python -m pip install --upgrade pip
50-
pip install tox==4.27.0
50+
pip install tox==4.30.2
5151
- name: Run type checking
5252
run: |
5353
tox -c py/tox.ini || true

.github/workflows/update-documentation.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ jobs:
6868
distribution: 'temurin'
6969
- name: Set up Python 3.9
7070
if: ${{ inputs.language == 'py' || inputs.language == 'all' }}
71-
uses: actions/setup-python@v5
71+
uses: actions/setup-python@v6
7272
with:
7373
python-version: 3.9
7474
- name: Install dependencies

py/selenium/webdriver/common/actions/interaction.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,13 @@
1616
# under the License.
1717
from typing import Union
1818

19+
from .input_device import InputDevice
20+
1921
KEY = "key"
2022
POINTER = "pointer"
2123
NONE = "none"
2224
WHEEL = "wheel"
23-
SOURCE_TYPES = {KEY, POINTER, NONE}
25+
SOURCE_TYPES = {KEY, POINTER, WHEEL, NONE}
2426

2527
POINTER_MOUSE = "mouse"
2628
POINTER_TOUCH = "touch"
@@ -32,7 +34,7 @@
3234
class Interaction:
3335
PAUSE = "pause"
3436

35-
def __init__(self, source: str) -> None:
37+
def __init__(self, source: InputDevice) -> None:
3638
self.source = source
3739

3840

py/selenium/webdriver/common/actions/key_actions.py

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
from __future__ import annotations
1919

2020
from ..utils import keys_to_typing
21-
from .interaction import KEY, POINTER, WHEEL, Interaction
21+
from .interaction import KEY, Interaction
2222
from .key_input import KeyInput
2323
from .pointer_input import PointerInput
2424
from .wheel_input import WheelInput
@@ -29,18 +29,7 @@ def __init__(self, source: KeyInput | PointerInput | WheelInput | None = None) -
2929
if source is None:
3030
source = KeyInput(KEY)
3131
self.input_source = source
32-
33-
# Determine the correct source type string based on the input object
34-
if isinstance(source, KeyInput):
35-
source_type = KEY
36-
elif isinstance(source, PointerInput):
37-
source_type = POINTER
38-
elif isinstance(source, WheelInput):
39-
source_type = WHEEL
40-
else:
41-
source_type = KEY
42-
43-
super().__init__(source_type)
32+
super().__init__(source)
4433

4534
def key_down(self, letter: str) -> KeyActions:
4635
return self._key_action("create_key_down", letter)
@@ -60,6 +49,6 @@ def send_keys(self, text: str | list) -> KeyActions:
6049
return self
6150

6251
def _key_action(self, action: str, letter) -> KeyActions:
63-
meth = getattr(self.input_source, action)
52+
meth = getattr(self.source, action)
6453
meth(letter)
6554
return self

py/selenium/webdriver/common/actions/wheel_actions.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,14 @@
1717

1818
from typing import Optional
1919

20-
from .interaction import Interaction
20+
from .interaction import WHEEL, Interaction
2121
from .wheel_input import WheelInput
2222

2323

2424
class WheelActions(Interaction):
2525
def __init__(self, source: Optional[WheelInput] = None):
2626
if source is None:
27-
source = WheelInput("wheel")
27+
source = WheelInput(WHEEL)
2828
super().__init__(source)
2929

3030
def pause(self, duration: float = 0):

py/selenium/webdriver/common/desired_capabilities.py

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -26,19 +26,17 @@ class DesiredCapabilities:
2626
Usage Example::
2727
2828
from selenium import webdriver
29+
from selenium.webdriver.firefox.options import Options
2930
3031
selenium_grid_url = "http://198.0.0.1:4444/wd/hub"
3132
32-
# Create a desired capabilities object as a starting point.
33-
capabilities = DesiredCapabilities.FIREFOX.copy()
34-
capabilities["platform"] = "WINDOWS"
35-
capabilities["version"] = "10"
33+
# Create a new Options object for the desired browser.
34+
options = Options()
35+
options.set_capability("platformName", "windows")
36+
options.browser_version = "142"
3637
37-
# Instantiate an instance of Remote WebDriver with the desired capabilities.
38-
driver = webdriver.Remote(desired_capabilities=capabilities, command_executor=selenium_grid_url)
39-
40-
Note: Always use '.copy()' on the DesiredCapabilities object to avoid the side
41-
effects of altering the Global class instance.
38+
# Instantiate an instance of Remote WebDriver with the new options.
39+
driver = webdriver.Remote(command_executor=selenium_grid_url, options=options)
4240
"""
4341

4442
FIREFOX = {

0 commit comments

Comments
 (0)