Skip to content

Commit

Permalink
add screenshot script
Browse files Browse the repository at this point in the history
plantain-00 committed Aug 26, 2017

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
1 parent 0d5a092 commit 402a1d6
Showing 7 changed files with 269 additions and 1 deletion.
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:
@@ -18,4 +19,5 @@ addons:
- ubuntu-toolchain-r-test
packages:
- g++-4.8
- libnss3
firefox: latest
19 changes: 18 additions & 1 deletion clean-scripts.config.js
Original file line number Diff line number Diff line change
@@ -24,7 +24,21 @@ module.exports = {
`rimraf demo/*.bundle-*.css`
]
},
`rev-static --config demo/rev-static.config.js`
`rev-static --config demo/rev-static.config.js`,
async () => {
const { createServer } = require('http-server')
const puppeteer = require('puppeteer')
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 })
}
server.close()
browser.close()
}
],
lint: {
ts: `tslint "src/**/*.ts" "src/**/*.tsx" "demo/**/*.ts" "demo/**/*.tsx"`,
@@ -35,6 +49,9 @@ module.exports = {
test: [
'tsc -p spec',
process.env.APPVEYOR ? 'echo "skip karma test"' : 'karma start spec/karma.config.js',
'git checkout demo/vue/screenshot.png',
'git checkout demo/react/screenshot.png',
'git checkout demo/angular/screenshot.png',
() => new Promise((resolve, reject) => {
childProcess.exec('git status -s', (error, stdout, stderr) => {
if (error) {
Binary file added demo/angular/screenshot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added demo/react/screenshot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added demo/vue/screenshot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
247 changes: 247 additions & 0 deletions package-lock.json
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -38,6 +38,7 @@
"core-js": "2.4.1",
"file2variable-cli": "1.5.2",
"github-fork-ribbon-css": "0.2.1",
"http-server": "0.10.0",
"jasmine": "2.7.0",
"karma": "1.7.0",
"karma-chrome-launcher": "2.2.0",
@@ -47,6 +48,7 @@
"less": "2.7.2",
"mkdirp": "0.5.1",
"no-unused-export": "1.2.1",
"puppeteer": "0.10.1",
"react": "15.6.1",
"react-dom": "15.6.1",
"rev-static": "3.3.1",

0 comments on commit 402a1d6

Please sign in to comment.