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
2 changes: 1 addition & 1 deletion py/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ respect-gitignore = true
target-version = "py39"

[tool.ruff.lint]
extend-select = ["E4", "E7", "E9", "F", "I", "E501", "RUF022"]
extend-select = ["E4", "E7", "E9", "F", "I", "E501", "RUF022", "TID252"]
fixable = ["ALL"]

[tool.ruff.format]
Expand Down
2 changes: 1 addition & 1 deletion py/selenium/common/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
# specific language governing permissions and limitations
# under the License.

from .exceptions import (
from selenium.common.exceptions import (
DetachedShadowRootException,
ElementClickInterceptedException,
ElementNotInteractableException,
Expand Down
56 changes: 28 additions & 28 deletions py/selenium/webdriver/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,34 +15,34 @@
# specific language governing permissions and limitations
# under the License.

from .chrome.options import Options as ChromeOptions # noqa
from .chrome.service import Service as ChromeService # noqa
from .chrome.webdriver import WebDriver as Chrome # noqa
from .common.action_chains import ActionChains # noqa
from .common.desired_capabilities import DesiredCapabilities # noqa
from .common.keys import Keys # noqa
from .common.proxy import Proxy # noqa
from .edge.options import Options as EdgeOptions # noqa
from .edge.service import Service as EdgeService # noqa
from .edge.webdriver import WebDriver as ChromiumEdge # noqa
from .edge.webdriver import WebDriver as Edge # noqa
from .firefox.firefox_profile import FirefoxProfile # noqa
from .firefox.options import Options as FirefoxOptions # noqa
from .firefox.service import Service as FirefoxService # noqa
from .firefox.webdriver import WebDriver as Firefox # noqa
from .ie.options import Options as IeOptions # noqa
from .ie.service import Service as IeService # noqa
from .ie.webdriver import WebDriver as Ie # noqa
from .remote.webdriver import WebDriver as Remote # noqa
from .safari.options import Options as SafariOptions
from .safari.service import Service as SafariService # noqa
from .safari.webdriver import WebDriver as Safari # noqa
from .webkitgtk.options import Options as WebKitGTKOptions # noqa
from .webkitgtk.service import Service as WebKitGTKService # noqa
from .webkitgtk.webdriver import WebDriver as WebKitGTK # noqa
from .wpewebkit.options import Options as WPEWebKitOptions # noqa
from .wpewebkit.service import Service as WPEWebKitService # noqa
from .wpewebkit.webdriver import WebDriver as WPEWebKit # noqa
from selenium.webdriver.chrome.options import Options as ChromeOptions # noqa
from selenium.webdriver.chrome.service import Service as ChromeService # noqa
from selenium.webdriver.chrome.webdriver import WebDriver as Chrome # noqa
from selenium.webdriver.common.action_chains import ActionChains # noqa
from selenium.webdriver.common.desired_capabilities import DesiredCapabilities # noqa
from selenium.webdriver.common.keys import Keys # noqa
from selenium.webdriver.common.proxy import Proxy # noqa
from selenium.webdriver.edge.options import Options as EdgeOptions # noqa
from selenium.webdriver.edge.service import Service as EdgeService # noqa
from selenium.webdriver.edge.webdriver import WebDriver as ChromiumEdge # noqa
from selenium.webdriver.edge.webdriver import WebDriver as Edge # noqa
from selenium.webdriver.firefox.firefox_profile import FirefoxProfile # noqa
from selenium.webdriver.firefox.options import Options as FirefoxOptions # noqa
from selenium.webdriver.firefox.service import Service as FirefoxService # noqa
from selenium.webdriver.firefox.webdriver import WebDriver as Firefox # noqa
from selenium.webdriver.ie.options import Options as IeOptions # noqa
from selenium.webdriver.ie.service import Service as IeService # noqa
from selenium.webdriver.ie.webdriver import WebDriver as Ie # noqa
from selenium.webdriver.remote.webdriver import WebDriver as Remote # noqa
from selenium.webdriver.safari.options import Options as SafariOptions
from selenium.webdriver.safari.service import Service as SafariService # noqa
from selenium.webdriver.safari.webdriver import WebDriver as Safari # noqa
from selenium.webdriver.webkitgtk.options import Options as WebKitGTKOptions # noqa
from selenium.webdriver.webkitgtk.service import Service as WebKitGTKService # noqa
from selenium.webdriver.webkitgtk.webdriver import WebDriver as WebKitGTK # noqa
from selenium.webdriver.wpewebkit.options import Options as WPEWebKitOptions # noqa
from selenium.webdriver.wpewebkit.service import Service as WPEWebKitService # noqa
from selenium.webdriver.wpewebkit.webdriver import WebDriver as WPEWebKit # noqa

__version__ = "4.36.0.202508121825"

Expand Down
5 changes: 2 additions & 3 deletions py/selenium/webdriver/chrome/webdriver.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,11 @@

from typing import Optional

from selenium.webdriver.chrome.options import Options
from selenium.webdriver.chrome.service import Service
from selenium.webdriver.chromium.webdriver import ChromiumDriver
from selenium.webdriver.common.desired_capabilities import DesiredCapabilities

from .options import Options
from .service import Service


class WebDriver(ChromiumDriver):
"""Controls the ChromeDriver and allows you to drive the browser."""
Expand Down
11 changes: 5 additions & 6 deletions py/selenium/webdriver/common/action_chains.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,13 @@

from typing import TYPE_CHECKING, Union

from selenium.webdriver.common.actions.action_builder import ActionBuilder
from selenium.webdriver.common.actions.key_input import KeyInput
from selenium.webdriver.common.actions.pointer_input import PointerInput
from selenium.webdriver.common.actions.wheel_input import ScrollOrigin, WheelInput
from selenium.webdriver.common.utils import keys_to_typing
from selenium.webdriver.remote.webelement import WebElement

from .actions.action_builder import ActionBuilder
from .actions.key_input import KeyInput
from .actions.pointer_input import PointerInput
from .actions.wheel_input import ScrollOrigin, WheelInput
from .utils import keys_to_typing

if TYPE_CHECKING:
from selenium.webdriver.remote.webdriver import WebDriver

Expand Down
15 changes: 7 additions & 8 deletions py/selenium/webdriver/common/actions/action_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,15 @@

from typing import Any, Optional, Union

from selenium.webdriver.common.actions import interaction
from selenium.webdriver.common.actions.key_actions import KeyActions
from selenium.webdriver.common.actions.key_input import KeyInput
from selenium.webdriver.common.actions.pointer_actions import PointerActions
from selenium.webdriver.common.actions.pointer_input import PointerInput
from selenium.webdriver.common.actions.wheel_actions import WheelActions
from selenium.webdriver.common.actions.wheel_input import WheelInput
from selenium.webdriver.remote.command import Command

from . import interaction
from .key_actions import KeyActions
from .key_input import KeyInput
from .pointer_actions import PointerActions
from .pointer_input import PointerInput
from .wheel_actions import WheelActions
from .wheel_input import WheelInput


class ActionBuilder:
def __init__(
Expand Down
2 changes: 1 addition & 1 deletion py/selenium/webdriver/common/actions/interaction.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
# under the License.
from typing import Union

from .input_device import InputDevice
from selenium.webdriver.common.actions.input_device import InputDevice

KEY = "key"
POINTER = "pointer"
Expand Down
10 changes: 5 additions & 5 deletions py/selenium/webdriver/common/actions/key_actions.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@

from __future__ import annotations

from ..utils import keys_to_typing
from .interaction import KEY, Interaction
from .key_input import KeyInput
from .pointer_input import PointerInput
from .wheel_input import WheelInput
from selenium.webdriver.common.actions.interaction import KEY, Interaction
from selenium.webdriver.common.actions.key_input import KeyInput
from selenium.webdriver.common.actions.pointer_input import PointerInput
from selenium.webdriver.common.actions.wheel_input import WheelInput
from selenium.webdriver.common.utils import keys_to_typing


class KeyActions(Interaction):
Expand Down
6 changes: 3 additions & 3 deletions py/selenium/webdriver/common/actions/key_input.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
from . import interaction
from .input_device import InputDevice
from .interaction import Interaction, Pause
from selenium.webdriver.common.actions import interaction
from selenium.webdriver.common.actions.input_device import InputDevice
from selenium.webdriver.common.actions.interaction import Interaction, Pause


class KeyInput(InputDevice):
Expand Down
9 changes: 4 additions & 5 deletions py/selenium/webdriver/common/actions/pointer_actions.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,12 @@
# under the License.
from typing import Optional

from selenium.webdriver.common.actions import interaction
from selenium.webdriver.common.actions.interaction import Interaction
from selenium.webdriver.common.actions.mouse_button import MouseButton
from selenium.webdriver.common.actions.pointer_input import PointerInput
from selenium.webdriver.remote.webelement import WebElement

from . import interaction
from .interaction import Interaction
from .mouse_button import MouseButton
from .pointer_input import PointerInput


class PointerActions(Interaction):
def __init__(self, source: Optional[PointerInput] = None, duration: int = 250):
Expand Down
5 changes: 2 additions & 3 deletions py/selenium/webdriver/common/actions/pointer_input.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,10 @@
from typing import Any, Optional, Union

from selenium.common.exceptions import InvalidArgumentException
from selenium.webdriver.common.actions.input_device import InputDevice
from selenium.webdriver.common.actions.interaction import POINTER, POINTER_KINDS
from selenium.webdriver.remote.webelement import WebElement

from .input_device import InputDevice
from .interaction import POINTER, POINTER_KINDS


class PointerInput(InputDevice):
DEFAULT_MOVE_DURATION = 250
Expand Down
4 changes: 2 additions & 2 deletions py/selenium/webdriver/common/actions/wheel_actions.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@

from typing import Optional

from .interaction import WHEEL, Interaction
from .wheel_input import WheelInput
from selenium.webdriver.common.actions.interaction import WHEEL, Interaction
from selenium.webdriver.common.actions.wheel_input import WheelInput


class WheelActions(Interaction):
Expand Down
5 changes: 2 additions & 3 deletions py/selenium/webdriver/common/actions/wheel_input.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,10 @@
# under the License.
from typing import Union

from selenium.webdriver.common.actions import interaction
from selenium.webdriver.common.actions.input_device import InputDevice
from selenium.webdriver.remote.webelement import WebElement

from . import interaction
from .input_device import InputDevice


class ScrollOrigin:
def __init__(self, origin: Union[str, WebElement], x_offset: int, y_offset: int) -> None:
Expand Down
3 changes: 1 addition & 2 deletions py/selenium/webdriver/common/bidi/browsing_context.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@
from typing import Any, Callable, Optional, Union

from selenium.webdriver.common.bidi.common import command_builder

from .session import Session
from selenium.webdriver.common.bidi.session import Session


class ReadinessState:
Expand Down
5 changes: 2 additions & 3 deletions py/selenium/webdriver/common/bidi/script.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,8 @@

from selenium.common.exceptions import WebDriverException
from selenium.webdriver.common.bidi.common import command_builder

from .log import LogEntryAdded
from .session import Session
from selenium.webdriver.common.bidi.log import LogEntryAdded
from selenium.webdriver.common.bidi.session import Session


class ResultOwnership:
Expand Down
2 changes: 1 addition & 1 deletion py/selenium/webdriver/common/fedcm/dialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

from typing import Optional

from .account import Account
from selenium.webdriver.common.fedcm.account import Account


class Dialog:
Expand Down
5 changes: 2 additions & 3 deletions py/selenium/webdriver/edge/webdriver.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,8 @@

from selenium.webdriver.chromium.webdriver import ChromiumDriver
from selenium.webdriver.common.desired_capabilities import DesiredCapabilities

from .options import Options
from .service import Service
from selenium.webdriver.edge.options import Options
from selenium.webdriver.edge.service import Service


class WebDriver(ChromiumDriver):
Expand Down
7 changes: 3 additions & 4 deletions py/selenium/webdriver/firefox/webdriver.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,11 @@
from typing import Optional

from selenium.webdriver.common.driver_finder import DriverFinder
from selenium.webdriver.firefox.options import Options
from selenium.webdriver.firefox.remote_connection import FirefoxRemoteConnection
from selenium.webdriver.firefox.service import Service
from selenium.webdriver.remote.webdriver import WebDriver as RemoteWebDriver

from .options import Options
from .remote_connection import FirefoxRemoteConnection
from .service import Service


class WebDriver(RemoteWebDriver):
"""Controls the GeckoDriver and allows you to drive the browser."""
Expand Down
5 changes: 2 additions & 3 deletions py/selenium/webdriver/ie/webdriver.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,12 @@
from typing import Optional

from selenium.webdriver.common.driver_finder import DriverFinder
from selenium.webdriver.ie.options import Options
from selenium.webdriver.ie.service import Service
from selenium.webdriver.remote.client_config import ClientConfig
from selenium.webdriver.remote.remote_connection import RemoteConnection
from selenium.webdriver.remote.webdriver import WebDriver as RemoteWebDriver

from .options import Options
from .service import Service


class WebDriver(RemoteWebDriver):
"""Controls the IEServerDriver and allows you to drive Internet
Expand Down
2 changes: 1 addition & 1 deletion py/selenium/webdriver/remote/fedcm.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

from typing import Optional

from .command import Command
from selenium.webdriver.remote.command import Command


class FedCM:
Expand Down
2 changes: 1 addition & 1 deletion py/selenium/webdriver/remote/mobile.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
# specific language governing permissions and limitations
# under the License.

from .command import Command
from selenium.webdriver.remote.command import Command


class _ConnectionType:
Expand Down
9 changes: 4 additions & 5 deletions py/selenium/webdriver/remote/remote_connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,10 @@
import urllib3

from selenium import __version__

from . import utils
from .client_config import ClientConfig
from .command import Command
from .errorhandler import ErrorCode
from selenium.webdriver.remote import utils
from selenium.webdriver.remote.client_config import ClientConfig
from selenium.webdriver.remote.command import Command
from selenium.webdriver.remote.errorhandler import ErrorCode

LOGGER = logging.getLogger(__name__)

Expand Down
4 changes: 2 additions & 2 deletions py/selenium/webdriver/remote/shadowroot.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@

from hashlib import md5 as md5_hash

from ..common.by import By
from .command import Command
from selenium.webdriver.common.by import By
from selenium.webdriver.remote.command import Command


class ShadowRoot:
Expand Down
3 changes: 1 addition & 2 deletions py/selenium/webdriver/remote/switch_to.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,9 @@
from selenium.common.exceptions import NoSuchElementException, NoSuchFrameException, NoSuchWindowException
from selenium.webdriver.common.alert import Alert
from selenium.webdriver.common.by import By
from selenium.webdriver.remote.command import Command
from selenium.webdriver.remote.webelement import WebElement

from .command import Command


class SwitchTo:
def __init__(self, driver) -> None:
Expand Down
Loading