Created
November 2, 2018 08:09
-
-
Save dobromir-hristov/2dfb1f7569d33f815aabce444b282296 to your computer and use it in GitHub Desktop.
Sequental iterate + screenshot
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
async function main(){ | |
const response = await getJson('sone/endpoint') // vzimame vsi4ko | |
const finalResult = await response.reduce((promiseChain, currentItem) => { | |
return promiseChain.then(results => { | |
return screenShotAndCompare(currentItem) | |
}) | |
}, Promise.resolve()) | |
// Tuk ve4e sme gotovi | |
} | |
async function screenShotAndCompare(item){ | |
const screenshot = await screenShotItem(item) | |
return compareItem(screenshot, oldScreenshot) // tr go ima6 ot nqkyde | |
} | |
main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment