snapshot 0.4.2 → 0.4.3

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 220ee5914fa32542e9bd8442348d37a1285ced86
4
- data.tar.gz: df8c5d3dbfdb24e15b948e37e66b0db4cd9fb3a5
3
+ metadata.gz: 8ef5722f4c32f81f127f18884dec41265401a529
4
+ data.tar.gz: 03e0163a980e80c4511bdd9b721e6eecbe2702d3
5
5
  SHA512:
6
- metadata.gz: 99f0175931b6a61c7c18cc6172aee68bb8d197d39949a639565d9eca2c62e6e807fa83bb0f10bf0cde46f3975c4084bb9afebe0966515b47fb7e3daece566a08
7
- data.tar.gz: 42be82042bb157c4c4c92b2cb773257b1b99195221b0ad84e5b6cf21bfba2d0dde029187055ebc2932d3fa206643db89b245b1669361a3bd81c5eb3edaead08b
6
+ metadata.gz: e3d96e8e512bfc62217c38e01c70652a266515a9ec6abcec35808c51d2ae345b1154c222fed5d8471176089b46a2992b23aef9f0f629a10b353bae4dbc2368e5
7
+ data.tar.gz: 138574f7727d22549203de4bd733d1f57746d19f795f31402485bd49af1058fa7e6455c53d80f5e5f82adb1d002cee884e7111797a0fb3312142eba0e5af39d9
@@ -20,6 +20,7 @@ function captureLocalizedScreenshot(name) {
20
20
  var target = UIATarget.localTarget();
21
21
  var model = target.model();
22
22
  var rect = target.rect();
23
+ var deviceOrientation = target.deviceOrientation();
23
24
 
24
25
  var theSize = (rect.size.width > rect.size.height) ? rect.size.width.toFixed() : rect.size.height.toFixed();
25
26
 
@@ -41,11 +42,17 @@ function captureLocalizedScreenshot(name) {
41
42
  }
42
43
 
43
44
  var orientation = "portrait";
44
- if (rect.size.height < rect.size.width) orientation = "landscape";
45
+ if (deviceOrientation == UIA_DEVICE_ORIENTATION_LANDSCAPELEFT) {
46
+ orientation = "landscapeleft";
47
+ } else if (deviceOrientation == UIA_DEVICE_ORIENTATION_LANDSCAPERIGHT) {
48
+ orientation = "landscaperight";
49
+ } else if (deviceOrientation == UIA_DEVICE_ORIENTATION_PORTRAIT_UPSIDEDOWN) {
50
+ orientation = "portrait_upsidedown";
51
+ }
45
52
 
46
53
  var result = target.host().performTaskWithPathArgumentsTimeout("/usr/bin/printenv" , ["SNAPSHOT_LANGUAGE"], 5);
47
54
  var language = result.stdout.substring(0, result.stdout.length - 1);
48
55
 
49
- var parts = [language, model, orientation, name];
56
+ var parts = [language, model, name, orientation];
50
57
  target.captureScreenWithName(parts.join("-"));
51
58
  }
@@ -1,3 +1,3 @@
1
1
  module Snapshot
2
- VERSION = "0.4.2"
2
+ VERSION = "0.4.3"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: snapshot
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.2
4
+ version: 0.4.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Felix Krause