@applitools/eyes-sdk-core
Advanced tools
Comparing version
const utils = require('@applitools/utils') | ||
const MatchResult = require('../match/MatchResult') | ||
const validateLazyLoadOptions = require('../config/LazyLoadOptions') | ||
@@ -18,2 +19,3 @@ function makeCheck({eyes}) { | ||
} | ||
validateLazyLoadOptions(settings && settings.lazyLoad) | ||
const result = await eyes.check(settings, driver) | ||
@@ -20,0 +22,0 @@ return result ? result.toJSON() : new MatchResult().toJSON() |
@@ -11,2 +11,5 @@ const utils = require('@applitools/utils') | ||
const CheckSettingsUtils = require('./CheckSettingsUtils') | ||
const EyesUtils = require('./EyesUtils') | ||
const {lazyLoad} = require('@applitools/snippets') | ||
const makeLazyLoadOptions = require('../config/LazyLoadOptions') | ||
@@ -146,2 +149,20 @@ class EyesClassic extends EyesCore { | ||
} | ||
const lazyLoadOptions = makeLazyLoadOptions(this._checkSettings.lazyLoad) | ||
if (lazyLoadOptions) { | ||
this._logger.log('lazy loading the page before capturing a screenshot') | ||
const scripts = { | ||
main: { | ||
script: lazyLoad, | ||
args: [[lazyLoadOptions]], | ||
}, | ||
poll: { | ||
script: lazyLoad, | ||
args: [[]], | ||
}, | ||
} | ||
await EyesUtils.executePollScript(this._logger, this._driver, scripts, {pollTimeout: lazyLoadOptions.waitingTime}) | ||
} | ||
let dom | ||
@@ -148,0 +169,0 @@ let afterScreenShotScrollingOffeset = null |
@@ -14,2 +14,5 @@ const utils = require('@applitools/utils') | ||
const CheckSettingsUtils = require('../sdk/CheckSettingsUtils') | ||
const EyesUtils = require('./EyesUtils') | ||
const {lazyLoad} = require('@applitools/snippets') | ||
const makeLazyLoadOptions = require('../config/LazyLoadOptions') | ||
@@ -165,2 +168,3 @@ class EyesVisualGrid extends EyesCore { | ||
) | ||
const lazyLoadOptions = makeLazyLoadOptions(checkSettings.lazyLoad) | ||
const showLogs = this._configuration.getShowLogs() | ||
@@ -182,2 +186,20 @@ | ||
waitBeforeCapture: () => utils.general.sleep(waitBeforeCapture), | ||
lazyLoadBeforeCapture: async () => { | ||
if (lazyLoadOptions) { | ||
this._logger.log('lazy loading the page before capturing snapshots') | ||
const scripts = { | ||
main: { | ||
script: lazyLoad, | ||
args: [[lazyLoadOptions]], | ||
}, | ||
poll: { | ||
script: lazyLoad, | ||
args: [[]], | ||
}, | ||
} | ||
await EyesUtils.executePollScript(this._logger, this._driver, scripts, { | ||
pollTimeout: lazyLoadOptions.waitingTime, | ||
}) | ||
} | ||
}, | ||
}) | ||
@@ -184,0 +206,0 @@ |
@@ -18,5 +18,7 @@ const takeDomSnapshot = require('./takeDomSnapshot') | ||
waitBeforeCapture, | ||
lazyLoadBeforeCapture, | ||
}) { | ||
const cookieJar = driver.features.allCookies ? await driver.getCookies().catch(() => []) : [] | ||
const currentContext = driver.currentContext | ||
if (lazyLoadBeforeCapture) await lazyLoadBeforeCapture() | ||
@@ -69,2 +71,3 @@ if (!breakpoints) { | ||
} catch (err) { | ||
logger.log(err) | ||
const actualViewportSize = await driver.getViewportSize() | ||
@@ -71,0 +74,0 @@ if (isStrictBreakpoints) { |
{ | ||
"name": "@applitools/eyes-sdk-core", | ||
"version": "13.7.0", | ||
"version": "13.8.0", | ||
"description": "The core components of Eyes JavaScript SDK", | ||
@@ -30,2 +30,5 @@ "keywords": [ | ||
}, | ||
"aliases": [ | ||
"core" | ||
], | ||
"exports": { | ||
@@ -84,4 +87,4 @@ ".": { | ||
"@applitools/screenshoter": "3.4.1", | ||
"@applitools/snippets": "2.2.3", | ||
"@applitools/types": "1.4.7", | ||
"@applitools/snippets": "2.4.0", | ||
"@applitools/types": "1.5.0", | ||
"@applitools/utils": "1.3.6", | ||
@@ -98,3 +101,3 @@ "axios": "0.26.0", | ||
"@applitools/test-utils": "1.3.2", | ||
"@applitools/visual-grid-client": "15.12.41", | ||
"@applitools/visual-grid-client": "15.12.42", | ||
"chai": "4.2.0", | ||
@@ -101,0 +104,0 @@ "chai-uuid": "1.0.6", |
Unidentified License
License(Experimental) Something that seems like a license was found, but its contents could not be matched with a known license.
Found 1 instance in 1 package
Unidentified License
License(Experimental) Something that seems like a license was found, but its contents could not be matched with a known license.
Found 1 instance in 1 package
451771
0.54%106
0.95%13935
0.44%+ Added
+ Added
Updated
Updated