Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@applitools/eyes.cypress

Package Overview
Dependencies
Maintainers
11
Versions
141
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@applitools/eyes.cypress - npm Package Compare versions

Comparing version 1.1.1 to 1.1.2

18

package.json
{
"name": "@applitools/eyes.cypress",
"version": "1.1.1",
"version": "1.1.2",
"main": "index.js",
"license": "MIT",
"scripts": {
"test:mocha": "mocha --no-timeouts 'tests/**/*.test.js'",
"test:mocha": ": ${APPLITOOLS_API_KEY:?} && mocha --no-timeouts 'tests/**/*.test.js'",
"eslint": "eslint '**/*.js'",
"test": "npm run test:mocha && npm run eslint",
"build": "",
"build": "#",
"cypress": "cd tests/fixtures/testApp && cypress open --config integrationFolder=cypress/integration-timeout,pluginsFile=cypress/plugins/index-run.js,supportFile=cypress/support/index-run.js"

@@ -22,3 +22,3 @@ },

"dependencies": {
"@applitools/eyes.sdk.core": "~1.5.0",
"@applitools/eyes.sdk.core": "^1.6.0",
"cors": "^2.8.4",

@@ -29,3 +29,3 @@ "cssom": "0.3.1",

"he": "^1.1.1",
"lodash": "^4.17.5",
"lodash": "^4.17.10",
"mime-types": "^2.1.18",

@@ -43,7 +43,7 @@ "morgan": "^1.9.0",

"eslint-plugin-prettier": "^2.6.0",
"jsdom": "^11.7.0",
"mocha": "^5.0.5",
"nock": "^9.2.5",
"prettier": "^1.11.1"
"jsdom": "^11.11.0",
"mocha": "^5.2.0",
"nock": "^9.2.6",
"prettier": "^1.13.0"
}
}

@@ -16,6 +16,6 @@ require('dotenv').config();

const eyesCommands = {
open: async ({url, appName, testName, viewportSize}) => {
const eyes = await openEyes({apiKey, url, appName, testName, viewportSize});
checkWindow = eyes.checkWindow;
close = eyes.close;
open: async ({url, appName, testName, viewportSize, isVerbose}) => {
const eyes = await openEyes({apiKey, url, appName, testName, viewportSize, isVerbose});
checkWindow = eyes.checkWindow.bind(eyes);
close = eyes.close.bind(eyes);
},

@@ -50,4 +50,6 @@

function closeEyes() {
if (server) server.close();
async function closeEyes() {
if (server) {
await new Promise((resolve, reject) => server.close(err => (err ? reject(err) : resolve())));
}
server = null;

@@ -80,3 +82,3 @@ }

function moduleExports({port = eyesPort}) {
function moduleExports({port = eyesPort} = {}) {
eyesPort = port;

@@ -83,0 +85,0 @@ return {

@@ -9,2 +9,3 @@ const {

RenderRequest,
RenderInfo,
} = require('@applitools/eyes.sdk.core');

@@ -15,6 +16,6 @@

class EyesWrapper extends EyesBase {
constructor(config = {}) {
constructor({apiKey, isVerbose = false} = {}) {
super();
this.setApiKey(config.apiKey);
this.setLogHandler(new ConsoleLogHandler(true)); // TODO open to configuration / based on env
this.setApiKey(apiKey);
this.setLogHandler(new ConsoleLogHandler(isVerbose)); // TODO open to configuration / based on env
}

@@ -24,2 +25,3 @@

await super.openBase(appName, testName);
this._viewportSizeHandler.set(new RectangleSize(viewportSize)); // Not doing this causes an exception at a later

@@ -56,7 +58,6 @@ }

* @param {RGridDom} rGridDom The DOM of a page with resources
* @param {number} [renderWidth]
* @param {RenderingInfo} [renderingInfo]
* @return {Promise.<String>} The results of the render
*/
async postRender({url, resources, cdt, renderWidth, renderInfo}) {
async postRender({url, resources, cdt, viewportSize, renderInfo}) {
this._serverConnector.setRenderingAuthToken(renderInfo.getAccessToken());

@@ -66,4 +67,11 @@ this._serverConnector.setRenderingServerUrl(renderInfo.getServiceUrl());

const renderRequest = new RenderRequest(renderInfo.getResultsUrl(), url, rGridDom, renderWidth);
const runningRender = await this._renderWindowTask.postRender(rGridDom, renderRequest);
const renderRequest = new RenderRequest(
renderInfo.getResultsUrl(),
url,
rGridDom,
RenderInfo.fromRectangleSize(new RectangleSize(viewportSize)),
'Linux',
'chrome',
);
const runningRender = await this._renderWindowTask.postRender(renderRequest);
return runningRender.getRenderId();

@@ -70,0 +78,0 @@ }

@@ -10,6 +10,7 @@ const EyesWrapper = require('./EyesWrapper');

testName,
viewportSize,
viewportSize = {width: 1024, height: 768},
url,
apiKey,
wrapper = new EyesWrapper({apiKey}),
isVerbose = false,
wrapper = new EyesWrapper({apiKey, isVerbose}),
}) {

@@ -25,3 +26,2 @@ async function checkWindow({resourceUrls, cdt, tag}) {

const renderWidth = viewportSize ? viewportSize.width : 1024; // TODO is viewportSize the right thing to use here? what if not defined?
const renderId = await wrapper.postRender({

@@ -31,3 +31,3 @@ url,

cdt,
renderWidth,
viewportSize,
renderInfo,

@@ -34,0 +34,0 @@ });

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc