@applitools/eyes-testcafe
Advanced tools
Comparing version 1.1.6 to 1.1.7
v1.1.6 / 2019-06-30 | ||
=================== | ||
* 1.1.6 [[d4929f0](/commit/d4929f0875fe866a13d2191f887b6adf26b1d048)] | ||
* added basic result printing & readme fix [[bcf3dbb](/commit/bcf3dbb145e6bcfe3081be9d468a5836e4bc8ebe)] | ||
* changelog [[c785c24](/commit/c785c243a70ab7d36ebe2ab270a0ea97781440e6)] | ||
v1.1.5 / 2019-06-26 | ||
@@ -3,0 +10,0 @@ =================== |
{ | ||
"name": "@applitools/eyes-testcafe", | ||
"version": "1.1.6", | ||
"version": "1.1.7", | ||
"description": "Eyes Testcafe SDK", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -38,6 +38,10 @@ 'use strict'; | ||
this._logger.log('[open] called by user'); | ||
this._currentTest = await this._openAndInitTest(args); | ||
if (this._shouldSkip('open')) { | ||
return; | ||
} | ||
this._assertCanOpen(args); | ||
await this._assertClosed('open'); | ||
this._testcafeSize = await this._handleResizeTestcafe(args.browser, args.t, this._testcafeSize); | ||
this._currentTest = await this._openTest(args); | ||
} | ||
@@ -47,3 +51,3 @@ | ||
this._logger.log('[close] called by user'); | ||
if (this._shouldIgnore('close')) { | ||
if (this._shouldSkip('close')) { | ||
return; | ||
@@ -59,3 +63,3 @@ } | ||
this._logger.log('[checkWindow] called by user'); | ||
if (this._shouldIgnore('checkWindow')) { | ||
if (this._shouldSkip('checkWindow')) { | ||
return; | ||
@@ -77,2 +81,5 @@ } | ||
this._logger.log('[waitForResults] called by user'); | ||
if (this._shouldSkip('waitForResults')) { | ||
return []; | ||
} | ||
await this._assertClosed('waitForResults'); | ||
@@ -99,3 +106,3 @@ let results = await Promise.all(this._closedTests.map(b => b.closePromise)); | ||
async _openTest(args) { | ||
async _openAndInitTest(args) { | ||
const testInfo = this._initTestInfo({ | ||
@@ -105,3 +112,2 @@ isTestStarted: true, | ||
config: { | ||
userAgent: await this._getUserAgent(args.t), | ||
...this._defaultConfig, | ||
@@ -112,10 +118,19 @@ ...args, | ||
}); | ||
if (this._defaultConfig.eyesIsDisabled && args.isDisabled === false) { | ||
throw new Error( | ||
`Eyes is globaly disabled (via APPLITOOLS_IS_DISABLED or with applitools.config.js), ` + | ||
`but the test was set with isDisabled false. ` + | ||
`A test cannot be enabled when Eyes is disabled globaly. ` + | ||
`Please enable the test or enable Eyes globaly.`, | ||
); | ||
} | ||
if (testInfo.isDisabled) { | ||
this._logger.log('[_openTest] skipping open since eyes is disabled'); | ||
return; | ||
return testInfo; | ||
} | ||
testInfo.config.userAgent = await this._getUserAgent(args.t); | ||
const stringableConfig = {...testInfo.config}; | ||
delete stringableConfig.t; | ||
this._logger.log(`[_openTest] opening with' ${JSON.stringify(stringableConfig)}`); | ||
this._logger.log(`[_openAndInitTest] opening with ${JSON.stringify(stringableConfig)}`); | ||
testInfo.eyes = await this._client.openEyes(testInfo.config); | ||
@@ -165,10 +180,2 @@ return testInfo; | ||
} | ||
if (this._defaultConfig.eyesIsDisabled && args.isDisabled === false) { | ||
throw new Error( | ||
`Eyes is globaly disabled (via APPLITOOLS_IS_DISABLED or with applitools.config.js), ` + | ||
`but the test was set with isDisabled false. ` + | ||
`A test cannot be enabled when Eyes is disabled globaly. ` + | ||
`Please enable the test or enable Eyes globaly.`, | ||
); | ||
} | ||
} | ||
@@ -199,9 +206,9 @@ | ||
_shouldIgnore(methodName) { | ||
_shouldSkip(methodName) { | ||
if (!this._currentTest) { | ||
this._logger.log(`[${methodName}] closed when no current test, ignoring.`); | ||
this._logger.log(`no current test, skipping ${methodName}()`); | ||
return true; | ||
} | ||
if (this._currentTest.isDisabled) { | ||
this._logger.log(`[${methodName}] eyes is disabled, ignoring.`); | ||
this._logger.log(`eyes is disabled, skipping ${methodName}().`); | ||
return true; | ||
@@ -208,0 +215,0 @@ } |
@@ -27,7 +27,8 @@ 'use strict'; | ||
logger.log(`mapping proxy url ${proxyUrl} for ${cssBlobs.length} css blobs`); | ||
logger.log('mapping proxy url', proxyUrl); | ||
logger.log(`mapping ${cssBlobs.length} css blobs`); | ||
cssBlobs.forEach(r => (r.value = Buffer.from(doMapProxyUrls(r.value, proxyUrl)))); | ||
logger.log(`mapping proxy url ${proxyUrl} for ${proxyStyleElements.length} style elements`); | ||
logger.log(`mapping ${proxyStyleElements.length} style elements`); | ||
proxyStyleElements.forEach(n => (n.nodeValue = doMapProxyUrls(n.nodeValue, proxyUrl))); | ||
logger.log(`mapping proxy url ${proxyUrl} for ${styleAttrs.length} style attributes`); | ||
logger.log(`mapping ${styleAttrs.length} style attributes`); | ||
styleAttrs.forEach(a => (a.value = doMapProxyUrls(a.value, proxyUrl))); | ||
@@ -34,0 +35,0 @@ }; |
84564
1022