File: selenium.pyi

package info (click to toggle)
python-django-stubs 5.2.9-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 4,832 kB
  • sloc: python: 5,185; makefile: 15; sh: 8
file content (42 lines) | stat: -rw-r--r-- 1,637 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
from collections.abc import Callable, Sequence
from contextlib import AbstractContextManager
from types import TracebackType
from typing import Any, TypeVar

from django.test import LiveServerTestCase
from typing_extensions import Self

_F = TypeVar("_F", bound=Callable[..., Any])

class SeleniumTestCaseBase:
    browsers: Any
    browser: Any
    @classmethod
    def import_webdriver(cls, browser: Any) -> type[Any]: ...  # Type[WebDriver]
    def create_webdriver(self) -> Any: ...  # WebDriver

class ChangeWindowSize:
    def __init__(self, width: int, height: int, selenium: Any) -> None: ...
    def __enter__(self) -> Self: ...
    def __exit__(
        self,
        exc_type: type[BaseException] | None,
        exc_value: BaseException | None,
        traceback: TracebackType | None,
    ) -> None: ...

class SeleniumTestCase(LiveServerTestCase):
    implicit_wait: int
    screenshots: bool = False
    selenium: Any
    def desktop_size(self) -> AbstractContextManager[None]: ...
    def small_screen_size(self) -> AbstractContextManager[None]: ...
    def mobile_size(self) -> AbstractContextManager[None]: ...
    def rtl(self) -> AbstractContextManager[None]: ...
    def dark(self) -> AbstractContextManager[None]: ...
    def set_emulated_media(self, *, media: str | None = None, features: list[dict[str, str]] | None = None) -> None: ...
    def high_contrast(self) -> AbstractContextManager[None]: ...
    def take_screenshot(self, name: str) -> None: ...
    def disable_implicit_wait(self) -> AbstractContextManager[None]: ...

def screenshot_cases(method_names: str | Sequence[str]) -> Callable[[_F], _F]: ...