MCPcopy Index your code
hub / github.com/microsoft/playwright-python / __init__

Method __init__

tests/conftest.py:231–257  ·  view source on GitHub ↗
(
        self, browser_name: str, launch_server_options: Dict, tmpfile: Path
    )

Source from the content-addressed store, hash-verified

229
230class RemoteServer:
231 def __init__(
232 self, browser_name: str, launch_server_options: Dict, tmpfile: Path
233 ) -> None:
234 driver_dir = Path(inspect.getfile(playwright)).parent / "driver"
235 if sys.platform == "win32":
236 node_executable = driver_dir / "node.exe"
237 else:
238 node_executable = driver_dir / "node"
239 cli_js = driver_dir / "package" / "cli.js"
240 tmpfile.write_text(json.dumps(launch_server_options))
241 self.process = subprocess.Popen(
242 [
243 str(node_executable),
244 str(cli_js),
245 "launch-server",
246 "--browser",
247 browser_name,
248 "--config",
249 str(tmpfile),
250 ],
251 stdout=subprocess.PIPE,
252 stderr=sys.stderr,
253 cwd=driver_dir,
254 )
255 assert self.process.stdout
256 self.ws_endpoint = self.process.stdout.readline().decode().strip()
257 self.process.stdout.close()
258
259 def kill(self) -> None:
260 # Send the signal to all the process groups

Callers

nothing calls this directly

Calls 1

closeMethod · 0.45

Tested by

no test coverage detected