Example #1
0
 async def __aenter__(self) -> AsyncPlaywright:
     self._connection = await run_driver_async()
     self._connection.run_async()
     playwright = AsyncPlaywright(
         await self._connection.wait_for_object_with_known_name("Playwright")
     )
     playwright.stop = self.__aexit__  # type: ignore
     return playwright
Example #2
0
 async def __aenter__(self) -> AsyncPlaywright:
     self._connection = Connection(
         None, create_remote_object, compute_driver_executable()
     )
     loop = asyncio.get_running_loop()
     self._connection._loop = loop
     loop.create_task(self._connection.run())
     playwright = AsyncPlaywright(
         await self._connection.wait_for_object_with_known_name("Playwright")
     )
     playwright.stop = self.__aexit__  # type: ignore
     return playwright
Example #3
0
 async def __aenter__(self) -> AsyncPlaywright:
     self._connection = await run_driver_async()
     self._connection.run_async()
     return AsyncPlaywright(
         await
         self._connection.wait_for_object_with_known_name("Playwright"))