wraith 3.0.3 → 3.0.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 580ee47d4629051a51efa4f59448b293108ae733
4
- data.tar.gz: f1fdbf3b91b84d85dc0aa234f895c5e9d650cf5d
3
+ metadata.gz: c409214f8f7834c0b3b2c6fa5f010686f092d9a4
4
+ data.tar.gz: a3542e23dbcbf0c3f8da7bb6c07cd92828912418
5
5
  SHA512:
6
- metadata.gz: 7c500d724dca2ec13c30119982f24b9643fafb9bc4122aa1e8391d358675d918281638595e76892fd88b6ac80fee036c766d9a146d6a0cea26882ca942109961
7
- data.tar.gz: 7f522bf3908890d76cfc593bb1cba012df841d23bd10d3df5d86d960080bc6db2f92d4ee1053cfdda05388ca4247c8683fa4b487a8d26b660504476667f4b8d6
6
+ metadata.gz: 479c53baad28975382e6080c8c0828bc7d63c89971c7d88a45903a2ae114940dc9b64b67e59852e226556d760bb073da40cb5d5e4e4f571d44183b9235bc8b10
7
+ data.tar.gz: 67c76a4f7a7638d08df5ff730aea5349cb10a5181f29df869cdacf439e9906dd317dde59e5376efe782920e1385a7ffcb360a96a8c2d90777ed954dedd138ba2
@@ -33,7 +33,6 @@ module.exports = function (config) {
33
33
  currentDimensions = dimensions;
34
34
  }
35
35
 
36
- page.viewportSize = { width: currentDimensions.viewportWidth, height: currentDimensions.viewportHeight};
37
36
  page.settings = { loadImages: true, javascriptEnabled: javascriptEnabled };
38
37
 
39
38
  // If you want to use additional phantomjs commands, place them here
@@ -58,18 +57,27 @@ module.exports = function (config) {
58
57
  });
59
58
 
60
59
  function runSetupJavaScriptThenCaptureImage() {
60
+ resize();
61
61
  if (globalBeforeCaptureJS) {
62
62
  require(globalBeforeCaptureJS)(page);
63
63
  }
64
64
  if (pathBeforeCaptureJS) {
65
65
  require(pathBeforeCaptureJS)(page);
66
66
  }
67
- captureImage();
67
+ resizeAndCaptureImage();
68
68
  }
69
69
 
70
- function captureImage() {
70
+ function resize() {
71
+ page.viewportSize = { width: currentDimensions.viewportWidth, height: currentDimensions.viewportHeight};
72
+ }
71
73
 
74
+ function resizeAndCaptureImage() {
72
75
  console.log('Snapping ' + url + ' at: ' + currentDimensions.viewportWidth + 'x' + currentDimensions.viewportHeight);
76
+ resize();
77
+ setTimeout(captureImage, 1000); // give page time to re-render properly
78
+ }
79
+
80
+ function captureImage() {
73
81
  page.clipRect = {
74
82
  top: 0,
75
83
  left: 0,
@@ -82,7 +90,7 @@ module.exports = function (config) {
82
90
  if (helper.takingMultipleScreenshots(dimensions) && dimensionsProcessed < dimensions.length) {
83
91
  currentDimensions = dimensions[dimensionsProcessed];
84
92
  image_name = helper.replaceImageNameWithDimensions(image_name, currentDimensions);
85
- setTimeout(captureImage, 1000);
93
+ setTimeout(resizeAndCaptureImage, 1000);
86
94
  }
87
95
  else {
88
96
  // prevent CI from failing from 'Unsafe JavaScript attempt to access frame with URL about:blank from frame with URL' errors
@@ -1,3 +1,3 @@
1
1
  module Wraith
2
- VERSION = "3.0.3"
2
+ VERSION = "3.0.4"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wraith
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.3
4
+ version: 3.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dave Blooman