html-snapshots 1.3.2 → 1.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/common/index.js +57 -3
- package/lib/common/sitemap/sitemap-collection.js +3 -2
- package/lib/common/sitemap/sitemap-index.js +1 -4
- package/lib/common/sitemap/sitemap.js +15 -13
- package/lib/html-snapshots.js +5 -6
- package/lib/input-generators/_base.js +5 -5
- package/package.json +5 -6
- package/.c8rc.json +0 -5
- package/.eslintignore +0 -5
- package/.eslintrc.json +0 -16
- package/.github/issue_template.md +0 -16
- package/.github/workflows/verify.yml +0 -32
- package/docs/example-heroku-redis.md +0 -43
- package/docs/notes.md +0 -42
- package/examples/README.md +0 -149
- package/examples/custom/README.md +0 -22
- package/examples/custom/myFilter.js +0 -22
- package/examples/custom/package-lock.json +0 -2804
- package/examples/custom/package.json +0 -12
- package/examples/custom/snapshot.js +0 -28
- package/examples/debug-phantomjs/README.md +0 -38
- package/examples/debug-phantomjs/package-lock.json +0 -2922
- package/examples/debug-phantomjs/package.json +0 -12
- package/examples/debug-phantomjs/snapshot.js +0 -60
- package/examples/debug-puppeteer/README.md +0 -18
- package/examples/debug-puppeteer/package-lock.json +0 -2804
- package/examples/debug-puppeteer/package.json +0 -12
- package/examples/debug-puppeteer/snapshot.js +0 -30
- package/examples/html5rocks/README.md +0 -22
- package/examples/html5rocks/package-lock.json +0 -3218
- package/examples/html5rocks/package.json +0 -12
- package/examples/html5rocks/snapshot.js +0 -59
- package/examples/process-limit/README.md +0 -24
- package/examples/process-limit/package-lock.json +0 -2830
- package/examples/process-limit/package.json +0 -12
- package/examples/process-limit/snapshot.js +0 -30
- package/examples/simple-promise/README.md +0 -20
- package/examples/simple-promise/package-lock.json +0 -2830
- package/examples/simple-promise/package.json +0 -12
- package/examples/simple-promise/snapshot.js +0 -30
- package/examples/sitemap-index/README.md +0 -20
- package/examples/sitemap-index/package-lock.json +0 -2830
- package/examples/sitemap-index/package.json +0 -12
- package/examples/sitemap-index/snapshot.js +0 -34
- package/examples/verbose/README.md +0 -22
- package/examples/verbose/package-lock.json +0 -2805
- package/examples/verbose/package.json +0 -12
- package/examples/verbose/snapshot.js +0 -34
- package/test/helpers/options.js +0 -55
- package/test/helpers/result.js +0 -32
- package/test/helpers/sitemap.js +0 -130
- package/test/mocha/async/test.js +0 -416
- package/test/mocha/browsers/puppeteer.js +0 -129
- package/test/mocha/browsers/server/index.html +0 -9
- package/test/mocha/browsers/test.js +0 -11
- package/test/mocha/common/helpers.js +0 -87
- package/test/mocha/common/test.js +0 -188
- package/test/mocha/html-snapshots/basics.js +0 -88
- package/test/mocha/html-snapshots/myFilter.js +0 -10
- package/test/mocha/html-snapshots/phantomjs-options.js +0 -156
- package/test/mocha/html-snapshots/process-limit.js +0 -156
- package/test/mocha/html-snapshots/puppeteer.js +0 -47
- package/test/mocha/html-snapshots/robots.js +0 -194
- package/test/mocha/html-snapshots/server/contact/index.html +0 -57
- package/test/mocha/html-snapshots/server/favicon.ico +0 -0
- package/test/mocha/html-snapshots/server/fonts/facebolf-webfont.eot +0 -0
- package/test/mocha/html-snapshots/server/fonts/facebolf-webfont.svg +0 -220
- package/test/mocha/html-snapshots/server/fonts/facebolf-webfont.ttf +0 -0
- package/test/mocha/html-snapshots/server/fonts/facebolf-webfont.woff +0 -0
- package/test/mocha/html-snapshots/server/images/ajax-loader.gif +0 -0
- package/test/mocha/html-snapshots/server/images/art1.jpg +0 -0
- package/test/mocha/html-snapshots/server/images/carpet.jpg +0 -0
- package/test/mocha/html-snapshots/server/images/carpets/carpet1.jpg +0 -0
- package/test/mocha/html-snapshots/server/images/carpets/carpet1_th.jpg +0 -0
- package/test/mocha/html-snapshots/server/images/carpets/carpet2.jpg +0 -0
- package/test/mocha/html-snapshots/server/images/carpets/carpet2_th.jpg +0 -0
- package/test/mocha/html-snapshots/server/images/carpets/carpet3.jpg +0 -0
- package/test/mocha/html-snapshots/server/images/carpets/carpet3_th.jpg +0 -0
- package/test/mocha/html-snapshots/server/images/carpets/carpet4.jpg +0 -0
- package/test/mocha/html-snapshots/server/images/carpets/carpet4_th.jpg +0 -0
- package/test/mocha/html-snapshots/server/images/floor.jpg +0 -0
- package/test/mocha/html-snapshots/server/images/foundation/orbit/bullets.jpg +0 -0
- package/test/mocha/html-snapshots/server/images/foundation/orbit/left-arrow-small.png +0 -0
- package/test/mocha/html-snapshots/server/images/foundation/orbit/left-arrow.png +0 -0
- package/test/mocha/html-snapshots/server/images/foundation/orbit/loading.gif +0 -0
- package/test/mocha/html-snapshots/server/images/foundation/orbit/mask-black.png +0 -0
- package/test/mocha/html-snapshots/server/images/foundation/orbit/pause-black.png +0 -0
- package/test/mocha/html-snapshots/server/images/foundation/orbit/right-arrow-small.png +0 -0
- package/test/mocha/html-snapshots/server/images/foundation/orbit/right-arrow.png +0 -0
- package/test/mocha/html-snapshots/server/images/foundation/orbit/rotator-black.png +0 -0
- package/test/mocha/html-snapshots/server/images/foundation/orbit/timer-black.png +0 -0
- package/test/mocha/html-snapshots/server/images/home-sprite/certification.png +0 -0
- package/test/mocha/html-snapshots/server/images/home-sprite/cleantrust.png +0 -0
- package/test/mocha/html-snapshots/server/images/home-sprite/institute.png +0 -0
- package/test/mocha/html-snapshots/server/images/home-sprite-s1a48fdbd81.png +0 -0
- package/test/mocha/html-snapshots/server/images/logo-300.png +0 -0
- package/test/mocha/html-snapshots/server/images/slider1-lg.jpg +0 -0
- package/test/mocha/html-snapshots/server/images/slider1.jpg +0 -0
- package/test/mocha/html-snapshots/server/index.css +0 -1
- package/test/mocha/html-snapshots/server/index.html +0 -57
- package/test/mocha/html-snapshots/server/nojq/index.html +0 -46
- package/test/mocha/html-snapshots/server/pjsopts/index.html +0 -55
- package/test/mocha/html-snapshots/server/public/page-sitemap.xml +0 -16
- package/test/mocha/html-snapshots/server/public/wordpress/category-sitemap.xml +0 -13
- package/test/mocha/html-snapshots/server/public/wordpress/page-sitemap.xml +0 -16
- package/test/mocha/html-snapshots/server/public/wordpress/post-sitemap.xml +0 -27
- package/test/mocha/html-snapshots/server/public/wordpress/post_tag-sitemap.xml +0 -17
- package/test/mocha/html-snapshots/server/public/wordpress/product-sitemap.xml +0 -13
- package/test/mocha/html-snapshots/server/public/wordpress-2/category-sitemap.xml +0 -13
- package/test/mocha/html-snapshots/server/public/wordpress-2/page-sitemap.xml +0 -16
- package/test/mocha/html-snapshots/server/public/wordpress-2/post-sitemap.xml +0 -27
- package/test/mocha/html-snapshots/server/public/wordpress-2/post_tag-sitemap.xml +0 -17
- package/test/mocha/html-snapshots/server/public/wordpress-2/product-sitemap.xml +0 -13
- package/test/mocha/html-snapshots/server/require.js +0 -1
- package/test/mocha/html-snapshots/server/services/carpets/index.html +0 -57
- package/test/mocha/html-snapshots/server/test_robots.txt +0 -13
- package/test/mocha/html-snapshots/server/test_robots_sitemap.txt +0 -15
- package/test/mocha/html-snapshots/server/test_robots_sitemap.xml +0 -22
- package/test/mocha/html-snapshots/server/test_sitemap_index-2.xml +0 -25
- package/test/mocha/html-snapshots/server/test_sitemap_index-3.xml +0 -25
- package/test/mocha/html-snapshots/server/test_sitemap_index.xml +0 -25
- package/test/mocha/html-snapshots/server/vendor/js/libs/webshim/minified/extras/custom-validity.js +0 -1
- package/test/mocha/html-snapshots/server/vendor/js/libs/webshim/minified/extras/modernizr-custom.js +0 -1
- package/test/mocha/html-snapshots/server/vendor/js/libs/webshim/minified/extras/mousepress.js +0 -1
- package/test/mocha/html-snapshots/server/vendor/js/libs/webshim/minified/polyfiller.js +0 -1
- package/test/mocha/html-snapshots/server/vendor/js/libs/webshim/minified/shims/FlashCanvas/canvas2png.js +0 -1
- package/test/mocha/html-snapshots/server/vendor/js/libs/webshim/minified/shims/FlashCanvas/flashcanvas.js +0 -1
- package/test/mocha/html-snapshots/server/vendor/js/libs/webshim/minified/shims/FlashCanvas/flashcanvas.swf +0 -0
- package/test/mocha/html-snapshots/server/vendor/js/libs/webshim/minified/shims/FlashCanvas/proxy.php +0 -73
- package/test/mocha/html-snapshots/server/vendor/js/libs/webshim/minified/shims/FlashCanvas/save.php +0 -49
- package/test/mocha/html-snapshots/server/vendor/js/libs/webshim/minified/shims/FlashCanvasPro/canvas2png.js +0 -1
- package/test/mocha/html-snapshots/server/vendor/js/libs/webshim/minified/shims/FlashCanvasPro/flash10canvas.swf +0 -0
- package/test/mocha/html-snapshots/server/vendor/js/libs/webshim/minified/shims/FlashCanvasPro/flash9canvas.swf +0 -0
- package/test/mocha/html-snapshots/server/vendor/js/libs/webshim/minified/shims/FlashCanvasPro/flashcanvas.js +0 -1
- package/test/mocha/html-snapshots/server/vendor/js/libs/webshim/minified/shims/FlashCanvasPro/proxy.php +0 -73
- package/test/mocha/html-snapshots/server/vendor/js/libs/webshim/minified/shims/FlashCanvasPro/save.php +0 -49
- package/test/mocha/html-snapshots/server/vendor/js/libs/webshim/minified/shims/combos/1.js +0 -1
- package/test/mocha/html-snapshots/server/vendor/js/libs/webshim/minified/shims/combos/10.js +0 -1
- package/test/mocha/html-snapshots/server/vendor/js/libs/webshim/minified/shims/combos/11.js +0 -1
- package/test/mocha/html-snapshots/server/vendor/js/libs/webshim/minified/shims/combos/12.js +0 -1
- package/test/mocha/html-snapshots/server/vendor/js/libs/webshim/minified/shims/combos/13.js +0 -1
- package/test/mocha/html-snapshots/server/vendor/js/libs/webshim/minified/shims/combos/14.js +0 -1
- package/test/mocha/html-snapshots/server/vendor/js/libs/webshim/minified/shims/combos/15.js +0 -1
- package/test/mocha/html-snapshots/server/vendor/js/libs/webshim/minified/shims/combos/16.js +0 -1
- package/test/mocha/html-snapshots/server/vendor/js/libs/webshim/minified/shims/combos/17.js +0 -1
- package/test/mocha/html-snapshots/server/vendor/js/libs/webshim/minified/shims/combos/18.js +0 -1
- package/test/mocha/html-snapshots/server/vendor/js/libs/webshim/minified/shims/combos/19.js +0 -1
- package/test/mocha/html-snapshots/server/vendor/js/libs/webshim/minified/shims/combos/2.js +0 -1
- package/test/mocha/html-snapshots/server/vendor/js/libs/webshim/minified/shims/combos/20.js +0 -1
- package/test/mocha/html-snapshots/server/vendor/js/libs/webshim/minified/shims/combos/21.js +0 -1
- package/test/mocha/html-snapshots/server/vendor/js/libs/webshim/minified/shims/combos/22.js +0 -1
- package/test/mocha/html-snapshots/server/vendor/js/libs/webshim/minified/shims/combos/23.js +0 -1
- package/test/mocha/html-snapshots/server/vendor/js/libs/webshim/minified/shims/combos/24.js +0 -1
- package/test/mocha/html-snapshots/server/vendor/js/libs/webshim/minified/shims/combos/25.js +0 -1
- package/test/mocha/html-snapshots/server/vendor/js/libs/webshim/minified/shims/combos/26.js +0 -1
- package/test/mocha/html-snapshots/server/vendor/js/libs/webshim/minified/shims/combos/27.js +0 -1
- package/test/mocha/html-snapshots/server/vendor/js/libs/webshim/minified/shims/combos/3.js +0 -1
- package/test/mocha/html-snapshots/server/vendor/js/libs/webshim/minified/shims/combos/4.js +0 -1
- package/test/mocha/html-snapshots/server/vendor/js/libs/webshim/minified/shims/combos/5.js +0 -1
- package/test/mocha/html-snapshots/server/vendor/js/libs/webshim/minified/shims/combos/59.js +0 -1
- package/test/mocha/html-snapshots/server/vendor/js/libs/webshim/minified/shims/combos/6.js +0 -1
- package/test/mocha/html-snapshots/server/vendor/js/libs/webshim/minified/shims/combos/7.js +0 -1
- package/test/mocha/html-snapshots/server/vendor/js/libs/webshim/minified/shims/combos/8.js +0 -1
- package/test/mocha/html-snapshots/server/vendor/js/libs/webshim/minified/shims/combos/9.js +0 -1
- package/test/mocha/html-snapshots/server/vendor/js/libs/webshim/minified/shims/details.js +0 -1
- package/test/mocha/html-snapshots/server/vendor/js/libs/webshim/minified/shims/dom-extend.js +0 -1
- package/test/mocha/html-snapshots/server/vendor/js/libs/webshim/minified/shims/es5.js +0 -1
- package/test/mocha/html-snapshots/server/vendor/js/libs/webshim/minified/shims/excanvas.js +0 -1
- package/test/mocha/html-snapshots/server/vendor/js/libs/webshim/minified/shims/form-core.js +0 -1
- package/test/mocha/html-snapshots/server/vendor/js/libs/webshim/minified/shims/form-datalist.js +0 -1
- package/test/mocha/html-snapshots/server/vendor/js/libs/webshim/minified/shims/form-message.js +0 -1
- package/test/mocha/html-snapshots/server/vendor/js/libs/webshim/minified/shims/form-native-extend.js +0 -1
- package/test/mocha/html-snapshots/server/vendor/js/libs/webshim/minified/shims/form-number-date-api.js +0 -1
- package/test/mocha/html-snapshots/server/vendor/js/libs/webshim/minified/shims/form-number-date-ui.js +0 -1
- package/test/mocha/html-snapshots/server/vendor/js/libs/webshim/minified/shims/form-shim-extend.js +0 -1
- package/test/mocha/html-snapshots/server/vendor/js/libs/webshim/minified/shims/geolocation.js +0 -1
- package/test/mocha/html-snapshots/server/vendor/js/libs/webshim/minified/shims/i18n/errormessages-ar.js +0 -1
- package/test/mocha/html-snapshots/server/vendor/js/libs/webshim/minified/shims/i18n/errormessages-ch-ZN.js +0 -1
- package/test/mocha/html-snapshots/server/vendor/js/libs/webshim/minified/shims/i18n/errormessages-de.txt +0 -33
- package/test/mocha/html-snapshots/server/vendor/js/libs/webshim/minified/shims/i18n/errormessages-el.js +0 -1
- package/test/mocha/html-snapshots/server/vendor/js/libs/webshim/minified/shims/i18n/errormessages-en.txt +0 -34
- package/test/mocha/html-snapshots/server/vendor/js/libs/webshim/minified/shims/i18n/errormessages-es.js +0 -1
- package/test/mocha/html-snapshots/server/vendor/js/libs/webshim/minified/shims/i18n/errormessages-fr.js +0 -1
- package/test/mocha/html-snapshots/server/vendor/js/libs/webshim/minified/shims/i18n/errormessages-he.js +0 -1
- package/test/mocha/html-snapshots/server/vendor/js/libs/webshim/minified/shims/i18n/errormessages-hi.js +0 -1
- package/test/mocha/html-snapshots/server/vendor/js/libs/webshim/minified/shims/i18n/errormessages-hu.js +0 -1
- package/test/mocha/html-snapshots/server/vendor/js/libs/webshim/minified/shims/i18n/errormessages-it.js +0 -1
- package/test/mocha/html-snapshots/server/vendor/js/libs/webshim/minified/shims/i18n/errormessages-ja.js +0 -1
- package/test/mocha/html-snapshots/server/vendor/js/libs/webshim/minified/shims/i18n/errormessages-nl.js +0 -1
- package/test/mocha/html-snapshots/server/vendor/js/libs/webshim/minified/shims/i18n/errormessages-pt-PT.js +0 -1
- package/test/mocha/html-snapshots/server/vendor/js/libs/webshim/minified/shims/i18n/errormessages-ru.js +0 -1
- package/test/mocha/html-snapshots/server/vendor/js/libs/webshim/minified/shims/i18n/errormessages-sv.js +0 -1
- package/test/mocha/html-snapshots/server/vendor/js/libs/webshim/minified/shims/json-storage.js +0 -1
- package/test/mocha/html-snapshots/server/vendor/js/libs/webshim/minified/shims/jwplayer/license.txt +0 -1
- package/test/mocha/html-snapshots/server/vendor/js/libs/webshim/minified/shims/jwplayer/player.swf +0 -0
- package/test/mocha/html-snapshots/server/vendor/js/libs/webshim/minified/shims/jwplayer/readme.html +0 -87
- package/test/mocha/html-snapshots/server/vendor/js/libs/webshim/minified/shims/mediaelement-core.js +0 -1
- package/test/mocha/html-snapshots/server/vendor/js/libs/webshim/minified/shims/mediaelement-jaris.js +0 -1
- package/test/mocha/html-snapshots/server/vendor/js/libs/webshim/minified/shims/mediaelement-native-fix.js +0 -1
- package/test/mocha/html-snapshots/server/vendor/js/libs/webshim/minified/shims/mediaelement-swf.js +0 -1
- package/test/mocha/html-snapshots/server/vendor/js/libs/webshim/minified/shims/mediaelement-yt.js +0 -1
- package/test/mocha/html-snapshots/server/vendor/js/libs/webshim/minified/shims/styles/details-arrows.png +0 -0
- package/test/mocha/html-snapshots/server/vendor/js/libs/webshim/minified/shims/styles/forms.png +0 -0
- package/test/mocha/html-snapshots/server/vendor/js/libs/webshim/minified/shims/styles/polyfill-loader.gif +0 -0
- package/test/mocha/html-snapshots/server/vendor/js/libs/webshim/minified/shims/styles/shim.css +0 -1
- package/test/mocha/html-snapshots/server/vendor/js/libs/webshim/minified/shims/swf/JarisFLVPlayer.swf +0 -0
- package/test/mocha/html-snapshots/server/vendor/js/libs/webshim/minified/shims/swf/jwwebshims.swf +0 -0
- package/test/mocha/html-snapshots/server/vendor/js/libs/webshim/minified/shims/swf/localStorage.swf +0 -0
- package/test/mocha/html-snapshots/server/vendor/js/libs/webshim/minified/shims/track-ui.js +0 -1
- package/test/mocha/html-snapshots/server/vendor/js/libs/webshim/minified/shims/track.js +0 -1
- package/test/mocha/html-snapshots/server/vendor/js/plugins/cload.js +0 -49
- package/test/mocha/html-snapshots/server/vendor/js/plugins/modernizr.js +0 -4
- package/test/mocha/html-snapshots/server/vendor/js/plugins/oldie.js +0 -74
- package/test/mocha/html-snapshots/sitemap-index.js +0 -140
- package/test/mocha/html-snapshots/sitemap.js +0 -104
- package/test/mocha/html-snapshots/snapshot-scripts.js +0 -206
- package/test/mocha/html-snapshots/test.js +0 -105
- package/test/mocha/html-snapshots/test_robots.txt +0 -13
- package/test/mocha/html-snapshots/test_sitemap.xml +0 -22
- package/test/mocha/html-snapshots/use-jquery.js +0 -144
- package/test/mocha/html-snapshots/utils.js +0 -200
- package/test/mocha/input-generators/server/public/wordpress/category-sitemap.xml +0 -13
- package/test/mocha/input-generators/server/public/wordpress/page-sitemap.xml +0 -16
- package/test/mocha/input-generators/server/public/wordpress/post-sitemap.xml +0 -55
- package/test/mocha/input-generators/server/public/wordpress/post_tag-sitemap.xml +0 -25
- package/test/mocha/input-generators/server/public/wordpress/product-sitemap.xml +0 -13
- package/test/mocha/input-generators/server/test_robots.txt +0 -15
- package/test/mocha/input-generators/server/test_robots_bad.txt +0 -11
- package/test/mocha/input-generators/server/test_robots_sitemap.txt +0 -17
- package/test/mocha/input-generators/server/test_robots_sitemap_bad.txt +0 -17
- package/test/mocha/input-generators/server/test_robots_sitemap_multi.txt +0 -18
- package/test/mocha/input-generators/server/test_sitemap.xml +0 -34
- package/test/mocha/input-generators/server/test_sitemap.xml.gz +0 -0
- package/test/mocha/input-generators/server/test_sitemap_bad.xml.gz +0 -0
- package/test/mocha/input-generators/server/test_sitemap_index.xml +0 -25
- package/test/mocha/input-generators/server/test_sitemap_index.xml.gz +0 -0
- package/test/mocha/input-generators/server/test_sitemap_index_empty.xml +0 -3
- package/test/mocha/input-generators/server/test_sitemap_index_malformed.xml +0 -2
- package/test/mocha/input-generators/sitemap-index.js +0 -87
- package/test/mocha/input-generators/sitemap.js +0 -320
- package/test/mocha/input-generators/test.js +0 -1447
- package/test/mocha/input-generators/test_line.txt +0 -5
- package/test/mocha/input-generators/test_robots.txt +0 -15
- package/test/mocha/input-generators/test_robots_bad.txt +0 -11
- package/test/mocha/input-generators/test_robots_sitemap.txt +0 -17
- package/test/mocha/input-generators/test_robots_sitemap_bad.txt +0 -17
- package/test/mocha/input-generators/test_robots_sitemap_multi.txt +0 -18
- package/test/mocha/input-generators/test_sitemap.xml +0 -34
- package/test/mocha/input-generators/test_sitemap.xml.gz +0 -0
- package/test/mocha/input-generators/test_sitemap_bad.xml.gz +0 -0
- package/test/mocha/input-generators/test_sitemap_index.xml +0 -25
- package/test/mocha/input-generators/test_sitemap_index.xml.gz +0 -0
- package/test/server/index.js +0 -32
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "html-snapshots-example",
|
|
3
|
-
"version": "0.1.0",
|
|
4
|
-
"author": "Alex Grant <alex@localnerve.com>",
|
|
5
|
-
"description": "An example using html-snapshots",
|
|
6
|
-
"scripts": {
|
|
7
|
-
"start": "node ./snapshot.js"
|
|
8
|
-
},
|
|
9
|
-
"dependencies": {
|
|
10
|
-
"html-snapshots": "^1.3.0"
|
|
11
|
-
}
|
|
12
|
-
}
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Debug PhantomJS processing of a page on a sample website.
|
|
3
|
-
* Copyright (c) 2013 - 2022, Alex Grant, LocalNerve, contributors
|
|
4
|
-
*
|
|
5
|
-
* Uses sitemap.xml to snapshot a sample website, but holds one page for debugging.
|
|
6
|
-
*
|
|
7
|
-
* Demonstrates how to walk through the html-snapshots default script.
|
|
8
|
-
* Demonstrates phantomjsOptions usage on a per-page basis.
|
|
9
|
-
*
|
|
10
|
-
*/
|
|
11
|
-
const path = require("path");
|
|
12
|
-
const util = require("util");
|
|
13
|
-
const assert = require("assert");
|
|
14
|
-
const htmlSnapshots = require("html-snapshots");
|
|
15
|
-
|
|
16
|
-
// Assert if NOT an error
|
|
17
|
-
function mustBeError(err) {
|
|
18
|
-
assert.throws(
|
|
19
|
-
() => {
|
|
20
|
-
assert.ifError(err);
|
|
21
|
-
},
|
|
22
|
-
err => !!err
|
|
23
|
-
);
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
// For debugging, it might make more sense to do this for a single page of interest using array input,
|
|
27
|
-
// but this also demonstrates the use of phantomjsOptions in the per-page case.
|
|
28
|
-
htmlSnapshots.run({
|
|
29
|
-
input: "sitemap",
|
|
30
|
-
source: "https://www.sitemaps.org/sitemap.xml",
|
|
31
|
-
outputDir: path.join(__dirname, "./tmp"),
|
|
32
|
-
outputDirClean: true,
|
|
33
|
-
selector: "#mainContent",
|
|
34
|
-
timeout: 10000,
|
|
35
|
-
browser: "phantomjs",
|
|
36
|
-
phantomjsOptions: {
|
|
37
|
-
// The key must exactly match the loc as defined in the sitemap.xml
|
|
38
|
-
"https://www.sitemaps.org/protocol.html": "--remote-debugger-port=9000"
|
|
39
|
-
}
|
|
40
|
-
}, (err, completed) => {
|
|
41
|
-
|
|
42
|
-
console.log("completed snapshots:");
|
|
43
|
-
console.log(util.inspect(completed));
|
|
44
|
-
|
|
45
|
-
// We expect the protocol.html page will timeout because we've held it in the debugger
|
|
46
|
-
// It will succeed if you use --remote-debugger-autorun=true
|
|
47
|
-
// However, the PhantomJS process instances won't exit so that you can (re)debug
|
|
48
|
-
mustBeError(err);
|
|
49
|
-
});
|
|
50
|
-
|
|
51
|
-
// Now, go open chrome and navigate to http://127.0.0.1:9000
|
|
52
|
-
// 1. click "about:blank"
|
|
53
|
-
// 2. click "Scripts" tab and find "about:blank" script in dropdown - that's the phantomjs script
|
|
54
|
-
// 3. Set some breakpoints
|
|
55
|
-
// 4. click the "Console" tab, type `__run()`, hit enter
|
|
56
|
-
// 5. Step through and observe whats going on.
|
|
57
|
-
//
|
|
58
|
-
// More info: http://phantomjs.org/troubleshooting.html
|
|
59
|
-
//
|
|
60
|
-
// You have to kill PhantomJS instances yourself if you start them with the debug option.
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
# Example
|
|
2
|
-
|
|
3
|
-
> Run a single page in the puppeteer debugger to see what is going on for a problem snapshot.
|
|
4
|
-
|
|
5
|
-
> All examples assume you already have NodeJS installed on your local machine
|
|
6
|
-
|
|
7
|
-
## How To Run
|
|
8
|
-
1. Clone this repo
|
|
9
|
-
2. Open a command prompt
|
|
10
|
-
3. Change to the examples/custom directory
|
|
11
|
-
4. Run `npm install`
|
|
12
|
-
5. Run `npm start`
|
|
13
|
-
|
|
14
|
-
## What It Does
|
|
15
|
-
This example loads google.com into puppeteer, starts it in headed mode in slow motion with devtools.
|
|
16
|
-
|
|
17
|
-
## Notes on Interpreting Results
|
|
18
|
-
This example starts headed chrome so you can inspect the page manually using devtools.
|