diff options
Diffstat (limited to 'crocoite')
-rw-r--r-- | crocoite/devtools.py | 3 | ||||
-rw-r--r-- | crocoite/test_devtools.py | 10 |
2 files changed, 12 insertions, 1 deletions
diff --git a/crocoite/devtools.py b/crocoite/devtools.py index d62a8a1..6e97ca3 100644 --- a/crocoite/devtools.py +++ b/crocoite/devtools.py @@ -245,8 +245,9 @@ class Tab: # increase size limit of a single frame to something ridiciously high, # so we can safely grab screenshots maxSize = 100*1024*1024 # 100 MB + # chrome does not like pings and kills the connection, disable them ws = await websockets.connect(kwargs['webSocketDebuggerUrl'], - max_size=maxSize) + max_size=maxSize, ping_interval=None) ret = cls (kwargs['id'], ws) await ret.run () return ret diff --git a/crocoite/test_devtools.py b/crocoite/test_devtools.py index a6eeda2..4ffbbf8 100644 --- a/crocoite/test_devtools.py +++ b/crocoite/test_devtools.py @@ -151,3 +151,13 @@ def test_tab_function_hash (tab): d = {tab.Network.enable: 1, tab.Network.disable: 2, tab.Page: 3, tab.Page.enable: 4} assert len (d) == 4 +@pytest.mark.asyncio +async def test_ws_ping(tab): + """ + Chrome does not like websocket pings and closes the connection if it + receives one. Not sure why. + """ + with pytest.raises (Crashed): + await tab.ws.ping () + await tab.Browser.getVersion () + |