Skip to content

Commit

Permalink
add and save screenshot source
Browse files Browse the repository at this point in the history
  • Loading branch information
plantain-00 committed Aug 27, 2017
1 parent 29f4ee5 commit 434bc2f
Show file tree
Hide file tree
Showing 7 changed files with 145 additions and 4 deletions.
2 changes: 2 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
language: node_js
dist: trusty
node_js:
- "8"
before_install:
Expand All @@ -18,4 +19,5 @@ addons:
- ubuntu-toolchain-r-test
packages:
- g++-4.8
- libnss3
firefox: latest
3 changes: 3 additions & 0 deletions clean-scripts.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,16 @@ module.exports = {
async () => {
const { createServer } = require('http-server')
const puppeteer = require('puppeteer')
const fs = require('fs')
const server = createServer()
server.listen(8000)
const browser = await puppeteer.launch()
const page = await browser.newPage()
for (const type of ['vue', 'react', 'angular']) {
await page.goto(`http://localhost:8000/demo/${type}`)
await page.screenshot({ path: `demo/${type}/screenshot.png`, fullPage: true })
const content = await page.content()
fs.writeFileSync(`demo/${type}/screenshot-src.html`, content)
}
server.close()
browser.close()
Expand Down
44 changes: 44 additions & 0 deletions demo/angular/screenshot-src.html

Large diffs are not rendered by default.

15 changes: 15 additions & 0 deletions demo/react/screenshot-src.html

Large diffs are not rendered by default.

35 changes: 35 additions & 0 deletions demo/vue/screenshot-src.html

Large diffs are not rendered by default.

48 changes: 45 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
"less": "2.7.2",
"mkdirp": "0.5.1",
"no-unused-export": "1.2.1",
"puppeteer": "0.9.0",
"puppeteer": "0.10.1",
"react": "15.6.1",
"react-dom": "15.6.1",
"rev-static": "3.3.1",
Expand Down

0 comments on commit 434bc2f

Please sign in to comment.