Skip to content

Commit

Permalink
Merge pull request #3 from smartfrog-oss/development
Browse files Browse the repository at this point in the history
Development
  • Loading branch information
mouafa committed Oct 26, 2018
2 parents 4ad5d1a + 5c527b2 commit 1a0aa20
Show file tree
Hide file tree
Showing 4 changed files with 585 additions and 12 deletions.
3 changes: 2 additions & 1 deletion main.js
Expand Up @@ -23,7 +23,8 @@ async function boot() {

async function teardown() {
log('👋 firn')
global.browser.close()
await global.browser.close()
global.browser = null
}

module.exports = main
4 changes: 2 additions & 2 deletions package.json
@@ -1,6 +1,6 @@
{
"name": "firn",
"version": "0.2.0",
"version": "0.2.2",
"description": "visual regression test tool",
"main": "main.js",
"author": "mouafa",
Expand All @@ -17,7 +17,7 @@
"make-dir": "1.3.0",
"promx": "1.0.1",
"puppeteer": "1.7.0",
"royax": "0.1.1"
"royax": "1.0.0"
},
"devDependencies": {
"coveralls": "3.0.2",
Expand Down
6 changes: 4 additions & 2 deletions src/lib/shot.js
Expand Up @@ -32,14 +32,16 @@ class Shot {
page.setViewport(this.viewport)
await page.goto(this.url, { waitUntil: 'networkidle2' })
const buffer = await page.screenshot({ path: paths.file, fullPage: true })
page.close() // no need to wait until page is closed
// page.close() // no need to wait until page is closed
return buffer
}

async check() {
if (!this.hasLegit()) {
await this.legitimate()
return true
const match = true
raport.add({ url: this.url, suffix: this.suffix }, { match })
return match
}
await this.capture()
const [err, match] = await compare(this.ligitPath, this.tmpPath)
Expand Down

0 comments on commit 1a0aa20

Please sign in to comment.