html-snapshots 0.19.0 → 1.0.1

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.
Files changed (47) hide show
  1. package/.github/workflows/verify.yml +2 -2
  2. package/HISTORY.md +42 -0
  3. package/README.md +92 -244
  4. package/examples/README.md +149 -0
  5. package/examples/custom/package-lock.json +1090 -9
  6. package/examples/custom/package.json +1 -1
  7. package/examples/debug-phantomjs/package-lock.json +1977 -292
  8. package/examples/debug-phantomjs/package.json +1 -1
  9. package/examples/debug-phantomjs/snapshot.js +1 -0
  10. package/examples/debug-puppeteer/README.md +18 -0
  11. package/examples/debug-puppeteer/package-lock.json +2804 -0
  12. package/examples/debug-puppeteer/package.json +12 -0
  13. package/examples/debug-puppeteer/snapshot.js +30 -0
  14. package/examples/html5rocks/package-lock.json +734 -18
  15. package/examples/html5rocks/package.json +1 -1
  16. package/examples/html5rocks/snapshot.js +0 -6
  17. package/examples/process-limit/package-lock.json +734 -18
  18. package/examples/process-limit/package.json +1 -1
  19. package/examples/simple-promise/package-lock.json +734 -18
  20. package/examples/simple-promise/package.json +1 -1
  21. package/examples/sitemap-index/package-lock.json +734 -18
  22. package/examples/sitemap-index/package.json +1 -1
  23. package/examples/sitemap-index/snapshot.js +0 -1
  24. package/examples/verbose/package-lock.json +734 -19
  25. package/examples/verbose/package.json +1 -1
  26. package/examples/verbose/snapshot.js +1 -0
  27. package/lib/html-snapshots.js +87 -4
  28. package/lib/input-generators/_base.js +7 -1
  29. package/lib/puppeteer/index.js +98 -0
  30. package/lib/puppeteer/removeScripts.js +8 -0
  31. package/package.json +6 -2
  32. package/test/mocha/browsers/puppeteer.js +106 -0
  33. package/test/mocha/browsers/server/index.html +9 -0
  34. package/test/mocha/browsers/test.js +11 -0
  35. package/test/mocha/html-snapshots/basics.js +60 -47
  36. package/test/mocha/html-snapshots/phantomjs-options.js +54 -60
  37. package/test/mocha/html-snapshots/process-limit.js +100 -92
  38. package/test/mocha/html-snapshots/puppeteer.js +47 -0
  39. package/test/mocha/html-snapshots/robots.js +137 -120
  40. package/test/mocha/html-snapshots/server/public/page-sitemap.xml +16 -0
  41. package/test/mocha/html-snapshots/sitemap-index.js +89 -80
  42. package/test/mocha/html-snapshots/sitemap.js +75 -31
  43. package/test/mocha/html-snapshots/snapshot-scripts.js +124 -120
  44. package/test/mocha/html-snapshots/test.js +11 -2
  45. package/test/mocha/html-snapshots/use-jquery.js +65 -64
  46. package/test/mocha/html-snapshots/utils.js +29 -29
  47. package/examples/utils/index.js +0 -25
@@ -7,6 +7,6 @@
7
7
  "start": "node ./snapshot.js"
8
8
  },
9
9
  "dependencies": {
10
- "html-snapshots": "^0.19.0"
10
+ "html-snapshots": "^1.0.0"
11
11
  }
12
12
  }
@@ -32,6 +32,7 @@ htmlSnapshots.run({
32
32
  outputDirClean: true,
33
33
  selector: "#mainContent",
34
34
  timeout: 10000,
35
+ browser: "phantomjs",
35
36
  phantomjsOptions: {
36
37
  // The key must exactly match the loc as defined in the sitemap.xml
37
38
  "https://www.sitemaps.org/protocol.html": "--remote-debugger-port=9000"
@@ -0,0 +1,18 @@
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.