MCPcopy Index your code
hub / github.com/plotly/dash / __init__

Method __init__

dash/testing/browser.py:42–86  ·  view source on GitHub ↗
(
        self,
        browser: str,
        remote: bool = False,
        remote_url: Optional[str] = None,
        headless: bool = False,
        options: Optional[Union[dict, list]] = None,
        download_path: str = "",
        percy_run: bool = True,
        percy_finalize: bool = True,
        percy_assets_root: str = "",
        wait_timeout: int = 10,
        pause: bool = False,
    )

Source from the content-addressed store, hash-verified

40
41 # pylint: disable=too-many-arguments
42 def __init__(
43 self,
44 browser: str,
45 remote: bool = False,
46 remote_url: Optional[str] = None,
47 headless: bool = False,
48 options: Optional[Union[dict, list]] = None,
49 download_path: str = "",
50 percy_run: bool = True,
51 percy_finalize: bool = True,
52 percy_assets_root: str = "",
53 wait_timeout: int = 10,
54 pause: bool = False,
55 ):
56 self._browser = browser.lower()
57 self._remote_url = remote_url
58 self._remote = (
59 True if remote_url and remote_url != SELENIUM_GRID_DEFAULT else remote
60 )
61 self._headless = headless
62 self._options = options
63 self._download_path = download_path
64 self._wait_timeout = wait_timeout
65 self._percy_finalize = percy_finalize
66 self._percy_run = percy_run
67 self._pause = pause
68
69 self._driver = until(self._try_get_webdriver, timeout=30)
70 self._driver.implicitly_wait(2)
71
72 self._wd_wait = WebDriverWait(self.driver, wait_timeout)
73 self._last_ts = 0
74 self._url = ""
75
76 self._window_idx = 0 # switch browser tabs
77
78 if self._percy_run:
79 # Percy CLI handles build initialization via percy exec wrapper
80 self._percy_assets_root = percy_assets_root
81 # No explicit initialization needed
82
83 logger.debug("initialize browser with arguments")
84 logger.debug(" headless => %s", self._headless)
85 logger.debug(" download_path => %s", self._download_path)
86 logger.debug(" percy asset root => %s", os.path.abspath(percy_assets_root))
87
88 def __enter__(self):
89 return self

Callers

nothing calls this directly

Calls 1

untilFunction · 0.90

Tested by

no test coverage detected