Skip to content

Commit 3129be6

Browse files
committed
added travis ci setup
updates for webrecorder-tests
1 parent 3480349 commit 3129be6

File tree

8 files changed

+31
-6
lines changed

8 files changed

+31
-6
lines changed

.travis.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
dist: trusty
2+
sudo: false
3+
language: python
4+
python:
5+
- "3.6"
6+
install:
7+
- pip install -r requirements.txt
8+
- pip install pytest pytest-asyncio psutil grappa vibora
9+
script: pytest

pytest.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
[pytest]
22
testpaths = tests
3-
addopts = --tb=native -r fXE
3+
addopts = --tb=native -s -v

requirements.txt

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
aiohttp
2+
uvloop
3+
aiodns
4+
cchardet
5+
pyee
6+
websockets
7+
ujson
8+
yarl
9+
async-timeout
10+
aiofiles

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
setup(
1919
name="simplechrome",
20-
version="1.0.2",
20+
version="1.0.3",
2121
description=(
2222
"Headless chrome/chromium automation library"
2323
"(unofficial fork of pypuppeteer)"

simplechrome/browser_fetcher.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
from urllib import request
99
from zipfile import ZipFile
1010

11-
DEFAULT_REVISION = "568432"
11+
DEFAULT_REVISION = "571375"
1212
logger = logging.getLogger(__name__)
1313

1414
__all__ = ["BrowserFetcher", "BF"]

simplechrome/connection.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,11 @@ async def _on_close(self) -> None:
162162
if not self._recv_fut.done():
163163
self._recv_fut.cancel()
164164

165+
try:
166+
await self._ws.close()
167+
except:
168+
pass
169+
165170

166171
class CDPSession(EventEmitter):
167172
def __init__(

simplechrome/launcher.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@
4848
"--disable-renderer-backgrounding",
4949
"--disable-infobars",
5050
"--disable-translate",
51+
"--autoplay-policy=no-user-gesture-required"
5152
]
5253

5354
DOT_DIR = Path.home() / ".simplechrome"
@@ -113,7 +114,7 @@ def _args_setup(self) -> None:
113114
if self.options.get("appMode", False):
114115
self.options["headless"] = False
115116
if "headless" not in self.options or self.options.get("headless"):
116-
self.args.extend(["--headless"])
117+
self.args.extend(["--headless", "--disable-gpu"])
117118

118119
if not self._check_supplied_userdd():
119120
if "userDataDir" not in self.options:
@@ -236,7 +237,7 @@ async def connect(options: dict = None, **kwargs: Any) -> Chrome:
236237
connection,
237238
contextIds=[],
238239
ignoreHTTPSErrors=options.get("ignoreHTTPSErrors", False),
239-
appMode=options.get("setDefaultViewport", False),
240+
appMode=options.get("appMode", False),
240241
process=None,
241242
closeCallback=lambda: connection.send("Browser.close"),
242243
)

simplechrome/page.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ async def create(
107107
"Security.setOverrideCertificateErrors", {"override": True}
108108
)
109109
if not appMode:
110-
await page.setViewport({"width": 800, "height": 600})
110+
await page.setViewport({"width": 900, "height": 900})
111111
return page
112112

113113
def __init__(

0 commit comments

Comments
 (0)