1 |
|
2 |
|
3 |
|
4 |
|
5 | 'use strict'
|
6 |
|
7 | const takeCapture = require('../lib/take_capture.js')
|
8 | const assert = require('assert')
|
9 | const fs = require('fs')
|
10 | const co = require('co')
|
11 |
|
12 | describe('take-capture', function () {
|
13 | this.timeout(80000)
|
14 | before(() => co(function * () {
|
15 |
|
16 | }))
|
17 |
|
18 | after(() => co(function * () {
|
19 |
|
20 | }))
|
21 |
|
22 | it('Take capture', () => co(function * () {
|
23 | yield takeCapture(
|
24 | `${__dirname}/../doc/mocks/mock-html.html`,
|
25 | `${__dirname}/../tmp/testing-capture.png`,
|
26 | {
|
27 | selector: 'h1',
|
28 | width: 1280,
|
29 | height: 320
|
30 | }
|
31 | )
|
32 | assert.ok(
|
33 | fs.existsSync(`${__dirname}/../tmp/testing-capture.png`)
|
34 | )
|
35 | }))
|
36 | })
|
37 |
|
38 |
|