devopsgroup-io / siteshooter

:camera: Automate full website screenshots and PDF generation with multiple viewport support.
https://devopsgroup.io
Mozilla Public License 2.0
67 stars 13 forks source link

unable to screenshot an angular4 app #90

Open benhalverson opened 7 years ago

benhalverson commented 7 years ago

Environment:

@angular/cli: 1.4.7
node: 8.5.0
os: darwin x64
@angular/common: 4.0.0
@angular/core: 4.0.0
@angular/forms: 4.0.0
@angular/http: 4.0.0
@angular/platform-browser: 4.0.0
@angular/platform-browser-dynamic: 4.0.0
@angular/router: 4.0.0
@angular/cli: 1.4.7
@angular/compiler: 4.0.0
@angular/compiler-cli: 4.0.0
typescript: 2.2.2

Steps to reproduce siteshooter -init add localhost:4200 to siteshooter.yml under name:

expected result crawled and screenshot web app actual result only screenshots loading screen

benhalverson commented 7 years ago

@stevebritton Here's a detailed log when I run siteshooter -s -V ⤷ Generating screenshots [19:29:15:473] Function: renderUrlsToFile [19:29:15:473] Function: retrievePage

localhost:4200

[19:29:16:261] PhantomJS - createPage [19:29:16:261] Setting Authentication [19:29:16:261] Function: getUserAgent Mozilla/5.0 (Macintosh; Intel Mac OS X) AppleWebKit/538.1 (KHTML, like Gecko) PhantomJS/2.1.1 Safari/538.1 info: TypeError: undefined is not an object (evaluating '((Object)).assign.apply') info: http://localhost:4200/vendor.bundle.js:30109 in combine info: http://localhost:4200/vendor.bundle.js:29959 in ../../../common/@angular/common.es5.js info: http://localhost:4200/inline.bundle.js:55 in webpack_require info: http://localhost:4200/vendor.bundle.js:79523 in ../../../platform-browser-dynamic/@angular/platform-browser-dynamic.es5.js info: http://localhost:4200/inline.bundle.js:55 in webpack_require info: http://localhost:4200/main.bundle.js:3845 in ../../../../../src/main.ts info: http://localhost:4200/inline.bundle.js:55 in webpack_require info: http://localhost:4200/main.bundle.js:3888 info: http://localhost:4200/inline.bundle.js:55 in webpack_require info: http://localhost:4200/inline.bundle.js:26 in webpackJsonpCallback [19:29:16:558] PhantomJS - onLoadFinished success [19:29:16:559] Function: renderViewPort ✔︎ Viewport: tablet-landscape(1024x768) [19:29:16:560] PhantomJS - Open Page: http://localhost:4200 success [19:29:16:811] Document Ready: false [19:29:17:063] Document Ready: true [19:29:17:065] Adding page to content collection: http://localhost:4200 [19:29:17:179] Injecting custom siteshooter JS object [19:29:17:285] Injecting inject.js file [19:29:17:395] inject.js script loaded false [19:29:19:400] Rendering page with a set delay of 2000 milliseconds [19:29:19:573] Function: nextPage [19:29:19:573] Function: callbackPerUrl [19:29:19:573] Rendered http://localhost:4200 at /Users/bhalverson/projects/biocl_cln2_unbranded_16_4573/tmp/screenshots/localhost:4200/tablet-landscape.png [19:29:19:573] Function: retrievePage

localhost:4200/#/home

[19:29:19:696] PhantomJS - createPage [19:29:19:696] Setting Authentication [19:29:19:696] Function: getUserAgent Mozilla/5.0 (Macintosh; Intel Mac OS X) AppleWebKit/538.1 (KHTML, like Gecko) PhantomJS/2.1.1 Safari/538.1 info: TypeError: undefined is not an object (evaluating '((Object)).assign.apply') info: http://localhost:4200/vendor.bundle.js:30109 in combine info: http://localhost:4200/vendor.bundle.js:29959 in ../../../common/@angular/common.es5.js info: http://localhost:4200/inline.bundle.js:55 in webpack_require info: http://localhost:4200/vendor.bundle.js:79523 in ../../../platform-browser-dynamic/@angular/platform-browser-dynamic.es5.js info: http://localhost:4200/inline.bundle.js:55 in webpack_require info: http://localhost:4200/main.bundle.js:3845 in ../../../../../src/main.ts info: http://localhost:4200/inline.bundle.js:55 in webpack_require info: http://localhost:4200/main.bundle.js:3888 info: http://localhost:4200/inline.bundle.js:55 in webpack_require info: http://localhost:4200/inline.bundle.js:26 in webpackJsonpCallback [19:29:19:910] PhantomJS - onLoadFinished success [19:29:19:910] Function: renderViewPort ✔︎ Viewport: tablet-landscape(1024x768) [19:29:19:910] PhantomJS - Open Page: http://localhost:4200/#/home success [19:29:20:163] Document Ready: false [19:29:20:419] Document Ready: true [19:29:20:420] Adding page to content collection: http://localhost:4200/#/home [19:29:20:558] Injecting custom siteshooter JS object [19:29:20:665] Injecting inject.js file [19:29:20:771] inject.js script loaded false [19:29:22:775] Rendering page with a set delay of 2000 milliseconds [19:29:23:018] Function: nextPage [19:29:23:019] Function: callbackPerUrl [19:29:23:019] Rendered http://localhost:4200/#/home at /Users/bhalverson/projects/biocl_cln2_unbranded_16_4573/tmp/screenshots/localhost:4200/#/home/tablet-landscape.png [19:29:23:019] Function: callbackFinal [19:29:25:030] Optimizing screenshot images

⤷ Collecting website content

✔︎ Successfully saved: content-collection.json ✔︎ Pages added: 2

✔︎ Siteshooter tasks complete

benhalverson commented 6 years ago

@stevebritton I was able to work around this issue by replacing phantomjs with puppeteer