@applitools/eyes.cypress
Advanced tools
Comparing version 1.0.0 to 1.1.0
{ | ||
"name": "@applitools/eyes.cypress", | ||
"version": "1.0.0", | ||
"version": "1.1.0", | ||
"main": "index.js", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
@@ -9,3 +9,3 @@ # Eyes.Cypress | ||
### Install npm package | ||
Install eyes.cypress as a local dev dependency in your tested project: | ||
Install `eyes.cypress` as a local dev dependency in your tested project: | ||
``` | ||
@@ -18,3 +18,3 @@ npm install --save-dev @applitools/eyes.cypress | ||
``` | ||
require '@applitools/eyes.cypress' | ||
require('@applitools/eyes.cypress') | ||
``` | ||
@@ -76,3 +76,3 @@ | ||
##### Available port | ||
If you want to be absolutely sure that `eyes` will use an available port, it's also possible to pass `0` as the port: | ||
If you want to be absolutely sure that `eyes.cypress` will use an available port, it's also possible to pass `0` as the port: | ||
``` | ||
@@ -79,0 +79,0 @@ const { getEyesPort } = require('@applitools/eyes.cypress')({ port: 0 }); |
@@ -30,4 +30,4 @@ /* global fetch, Cypress, cy */ | ||
Cypress.Commands.add('eyesOpen', (appName, testName, viewportSize) => { | ||
// TODO: this causes cypress to throw an error that I don't understand: cy.log('Eyes: open'); | ||
return cy.window().then(win => { | ||
Cypress.log({name: 'Eyes: open'}); | ||
return cy.window({log: false}).then(win => { | ||
return EyesServer.open(win.location.href, appName, testName, viewportSize); | ||
@@ -37,6 +37,5 @@ }); | ||
// TODO get url from test somehow | ||
Cypress.Commands.add('eyesCheckWindow', () => { | ||
cy.log('Eyes: checkWindow'); // TODO so why doesn't this throw an error? | ||
return cy.document().then(doc => { | ||
Cypress.Commands.add('eyesCheckWindow', ({timeout} = {}) => { | ||
Cypress.log({name: 'Eyes: check window'}); | ||
return cy.document({log: false}).then({timeout: timeout || 60000}, doc => { | ||
const {documentElement} = doc; | ||
@@ -50,4 +49,4 @@ const cdt = domNodesToCdt([documentElement]); | ||
Cypress.Commands.add('eyesClose', () => { | ||
// TODO: this causes cypress to throw an error that I don't understand: cy.log('Eyes: close'); | ||
Cypress.log({name: 'Eyes: close'}); | ||
return EyesServer.close(); | ||
}); |
@@ -25,3 +25,5 @@ /* eslint-disable no-use-before-define */ | ||
const index = elementNodeFactory(domNodes, elementNode); | ||
childIndexes.push(index); | ||
if (index !== null) { | ||
childIndexes.push(index); | ||
} | ||
}); | ||
@@ -34,3 +36,4 @@ | ||
let node; | ||
if (elementNode.nodeType === NODE_TYPES.ELEMENT) { | ||
const {nodeType} = elementNode; | ||
if (nodeType === NODE_TYPES.ELEMENT) { | ||
node = { | ||
@@ -47,3 +50,3 @@ nodeType: NODE_TYPES.ELEMENT, | ||
}; | ||
} else if (elementNode.nodeType === NODE_TYPES.TEXT) { | ||
} else if (nodeType === NODE_TYPES.TEXT) { | ||
node = { | ||
@@ -53,3 +56,3 @@ nodeType: NODE_TYPES.TEXT, | ||
}; | ||
} else if (elementNode.nodeType === NODE_TYPES.DOCUMENT) { | ||
} else if (nodeType === NODE_TYPES.DOCUMENT) { | ||
node = { | ||
@@ -59,8 +62,11 @@ nodeType: NODE_TYPES.DOCUMENT_TYPE, | ||
}; | ||
} | ||
if (node) { | ||
domNodes.push(node); | ||
return domNodes.length - 1; | ||
} else { | ||
throw new Error(`Unknown nodeType: ${elementNode.nodeType}`); | ||
console.log(`Unknown nodeType: ${nodeType}`); | ||
return null; | ||
} | ||
domNodes.push(node); | ||
return domNodes.length - 1; | ||
}; | ||
@@ -67,0 +73,0 @@ |
const {uniq} = require('lodash'); | ||
module.exports = el => { | ||
const srcUrls = [...el.querySelectorAll('img[src],script[src]')].map(srcEl => | ||
srcEl.getAttribute('src'), | ||
); | ||
const srcUrls = [...el.querySelectorAll('img[src]')].map(srcEl => srcEl.getAttribute('src')); | ||
@@ -8,0 +6,0 @@ const cssUrls = [...el.querySelectorAll('link[rel="stylesheet"]')].map(link => |
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
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
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
533
21951
4