@applitools/eyes.cypress
Advanced tools
Comparing version 3.2.24 to 3.2.25
v3.2.24 / 2018-11-20 | ||
==================== | ||
* 3.2.24 - Amit Zur [[2873a34](https://github.com/applitools/eyes.cypress/commit/2873a3471a3e9fe6cca2577307070c9e0d30142c)] | ||
* update visual-grid-client to 6.0.1 to fix deviceInfo - Amit Zur [[7567c4a](https://github.com/applitools/eyes.cypress/commit/7567c4af53c31d5ddf9583b0d42cdab19d73721c)] | ||
* add scriptHooks to readme - Amit Zur [[84c88cf](https://github.com/applitools/eyes.cypress/commit/84c88cf88629e10a5dc71eae2241c02c27b8be99)] | ||
* license - Amit Zur [[faaa444](https://github.com/applitools/eyes.cypress/commit/faaa444109865845460e5bef2baadd16e5ff7021)] | ||
* play script - Amit Zur [[9109990](https://github.com/applitools/eyes.cypress/commit/9109990a1d59bb8990051c8de2c754c9179ea6ee)] | ||
* changelog - Amit Zur [[85e72da](https://github.com/applitools/eyes.cypress/commit/85e72da393ac17c13e52e9bfe1b655089102aa7f)] | ||
v3.2.23 / 2018-11-14 | ||
@@ -3,0 +13,0 @@ ==================== |
{ | ||
"name": "@applitools/eyes.cypress", | ||
"version": "3.2.24", | ||
"version": "3.2.25", | ||
"main": "index.js", | ||
@@ -38,3 +38,3 @@ "license": "MIT", | ||
"@applitools/functional-commons": "^1.0.27", | ||
"@applitools/visual-grid-client": "^6.0.1", | ||
"@applitools/visual-grid-client": "^7.1.1", | ||
"body-parser": "^1.18.3", | ||
@@ -49,3 +49,3 @@ "chalk": "^2.4.1", | ||
"cookie-parser": "^1.4.3", | ||
"cypress": "^3.1.1", | ||
"cypress": "^3.1.2", | ||
"eslint": "^5.9.0", | ||
@@ -52,0 +52,0 @@ "eslint-plugin-mocha-no-only": "^1.0.0", |
@@ -5,3 +5,3 @@ /* global Cypress,cy,window,before,after */ | ||
const makeSend = require('./makeSend'); | ||
const {processDocument} = require('@applitools/visual-grid-client/browser'); | ||
const {processPage} = require('@applitools/visual-grid-client/browser'); | ||
const send = makeSend(Cypress.config('eyesPort'), cy.request); | ||
@@ -12,3 +12,3 @@ const makeSendRequest = require('./sendRequest'); | ||
const Blob = window.frameElement.ownerDocument.defaultView.Blob; // yucky! cypress uses socket.io to communicate between browser and node. In order to encode the data in binary format, socket.io checks for binary values. But `value instanceof Blob` is falsy since Blob from the cypress runner window is not the Blob from the command's window. So using the Blob from cypress runner window here. | ||
const eyesCheckWindow = makeEyesCheckWindow({sendRequest, processDocument, Blob}); | ||
const eyesCheckWindow = makeEyesCheckWindow({sendRequest, processPage, Blob}); | ||
@@ -15,0 +15,0 @@ const openEyes = poll(function(data) { |
'use strict'; | ||
const getAllBlobs = require('./getAllBlobs'); | ||
function makeEyesCheckWindow({sendRequest, processDocument, Blob}) { | ||
function makeEyesCheckWindow({sendRequest, processPage, Blob}) { | ||
return function eyesCheckWindow(doc, args) { | ||
@@ -18,4 +19,5 @@ let tag, sizeMode, selector, region, scriptHooks, ignore, sendDom; | ||
return processDocument(doc).then(({resourceUrls, blobs, frames, url, cdt, allBlobs}) => { | ||
const blobData = blobs.map(({url, type}) => ({url, type})); | ||
return processPage(doc).then(mainFrame => { | ||
const allBlobs = getAllBlobs(mainFrame); | ||
const {resourceUrls, blobData, frames, url, cdt} = replaceBlobsWithBlobDataInFrame(mainFrame); | ||
return Promise.all(allBlobs.map(putResource)).then(() => | ||
@@ -51,4 +53,18 @@ sendRequest({ | ||
} | ||
function replaceBlobsWithBlobDataInFrame({url, cdt, resourceUrls, blobs, frames}) { | ||
return { | ||
url, | ||
cdt, | ||
resourceUrls, | ||
blobData: blobs.map(mapBlobData), | ||
frames: frames.map(replaceBlobsWithBlobDataInFrame), | ||
}; | ||
} | ||
function mapBlobData({url, type}) { | ||
return {url, type}; | ||
} | ||
} | ||
module.exports = makeEyesCheckWindow; |
@@ -143,3 +143,3 @@ 'use strict'; | ||
resourceUrls: frame.resourceUrls, | ||
resourceContents: blobDataToResourceContents(frame.blobs), | ||
resourceContents: blobDataToResourceContents(frame.blobData), | ||
frames: frame.frames ? createResourceContents(frame.frames) : undefined, | ||
@@ -146,0 +146,0 @@ }; |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
121079
33
690
+ Added@applitools/visual-grid-client@7.2.8(transitive)
- Removed@applitools/visual-grid-client@6.0.1(transitive)