@loki/target-chrome-core
Advanced tools
Comparing version 0.20.0 to 0.20.2
{ | ||
"name": "@loki/target-chrome-core", | ||
"version": "0.20.0", | ||
"version": "0.20.2", | ||
"description": "Loki Chrome target core lib", | ||
@@ -23,3 +23,3 @@ "keywords": [ | ||
"dependencies": { | ||
"@loki/browser": "^0.20.0", | ||
"@loki/browser": "^0.20.2", | ||
"@loki/core": "^0.20.0" | ||
@@ -30,3 +30,3 @@ }, | ||
}, | ||
"gitHead": "1b20d9cd168206370bdfaff35449ed41031fb1ee" | ||
"gitHead": "7b8b5dfab879d46a6568a837b733cc7d2f6ba9ba" | ||
} |
const debug = require('debug')('loki:chrome'); | ||
const { | ||
disableAnimations, | ||
disablePointerEvents, | ||
getSelectorBoxSize, | ||
@@ -20,2 +21,3 @@ getStories, | ||
const RETRY_LOADING_STORIES_TIMEOUT = 10000; | ||
const LOADING_STORIES_TIMEOUT = 60000; | ||
@@ -165,2 +167,3 @@ const CAPTURING_SCREENSHOT_TIMEOUT = 30000; | ||
} | ||
await evaluateOnNewDocument(`(${disablePointerEvents})(window);`); | ||
@@ -228,2 +231,14 @@ debug(`Navigating to ${url}`); | ||
// Clamp x/y positions to viewport otherwise chrome | ||
// ignores scale | ||
if (clip.x < 0) { | ||
clip.height += clip.x; | ||
clip.x = 0; | ||
} | ||
if (clip.y < 0) { | ||
clip.width += clip.y; | ||
clip.y = 0; | ||
} | ||
debug('Capturing screenshot'); | ||
@@ -254,3 +269,3 @@ const screenshot = await Page.captureScreenshot({ | ||
const launchStoriesTab = withTimeout(LOADING_STORIES_TIMEOUT)( | ||
withRetries(2)(async url => { | ||
withRetries(5, RETRY_LOADING_STORIES_TIMEOUT)(async url => { | ||
const tab = await launchNewTab({ | ||
@@ -257,0 +272,0 @@ width: 100, |
13991
355
Updated@loki/browser@^0.20.2