@applitools/eyes.cypress
Advanced tools
Comparing version 3.0.3 to 3.0.4
{ | ||
"name": "@applitools/eyes.cypress", | ||
"version": "3.0.3", | ||
"version": "3.0.4", | ||
"main": "index.js", | ||
@@ -35,3 +35,3 @@ "license": "MIT", | ||
"@applitools/dom-capture": "^2.0.0", | ||
"@applitools/rendering-grid-client": "^4.0.5", | ||
"@applitools/rendering-grid-client": "^4.0.6", | ||
"body-parser": "1.18.2", | ||
@@ -45,3 +45,3 @@ "cors": "^2.8.4", | ||
"cookie-parser": "^1.4.3", | ||
"cypress": "^3.0.3", | ||
"cypress": "^3.1.0", | ||
"eslint": "^5.3.0", | ||
@@ -55,4 +55,4 @@ "eslint-plugin-mocha-no-only": "^1.0.0", | ||
"node-fetch": "^2.2.0", | ||
"prettier": "^1.14.0" | ||
"prettier": "^1.14.2" | ||
} | ||
} |
@@ -12,3 +12,6 @@ 'use strict'; | ||
const eyes = await openEyes(args); | ||
const runningTest = {}; | ||
const runningTest = { | ||
abort: eyes.abort, | ||
closePromise: undefined, | ||
}; | ||
checkWindow = eyes.checkWindow; | ||
@@ -108,5 +111,14 @@ close = makeClose(eyes.close, runningTest); | ||
const closePromises = runningTests.filter(getClosePromise).map(getClosePromise); | ||
const testResults = await waitForTestResults(closePromises); | ||
// const aborts = runningTests.filter(test => !test.closePromise).map(test => test.abort); | ||
// await Promise.all(aborts.map(abort => abort())); | ||
const aborts = runningTests.filter(test => !test.closePromise).map(test => test.abort); | ||
logger.log( | ||
`Waiting for test results of ${closePromises.length} closed tests. Going to abort ${ | ||
aborts.length | ||
} tests`, | ||
); | ||
const [testResults] = await Promise.all([ | ||
waitForTestResults(closePromises), | ||
Promise.all(aborts.map(abort => abort())), | ||
]); | ||
return testResults; | ||
@@ -113,0 +125,0 @@ }; |
31731
530