snapshot 1.13.0 → 1.13.1

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: be52a63e105fca678eab15efe749632ba3ca661f
4
- data.tar.gz: 7ce985585dddbb6d1e309c2b780e0a2236bdfea3
3
+ metadata.gz: 6b36155d8934cfc7940851a53eae0e15e760dca0
4
+ data.tar.gz: 88fdec491ff05bcbb6d97de2951530e629a9f1f4
5
5
  SHA512:
6
- metadata.gz: 09e128bad2e2b626c77d3df4f5103af3625a17094843b05aef541a097e58d905ea08a022712ae7b93e7f356a4221bccf0778149d08fbe99935272d8d626f7c84
7
- data.tar.gz: aadbf5467434ead6d261cb704b5aa82412d81c3678ec939f31bbf1eae20c91930aa981a54b75383f58c77d4ba02311f2f3eb524210d6598ad3cc278ad03683db
6
+ metadata.gz: 20539bd5c66a1a1456f5f90f312f5fe51c7daaba79f6eabf97c8926ee770445f96235d30458d869b088e5a9d36c6f8712b0d59763d88071093d820e932db940b
7
+ data.tar.gz: d78ef35d43fdb4ebc08df2a2254f1624078d5bb634b9785d1393f12bebbb2e48a1fa5a4c90a56e0fc39a1a32ad56f3d6f51f774d250db308864ead96191dd676
@@ -9,6 +9,7 @@ module Snapshot
9
9
  # All the errors we experience while running snapshot
10
10
  attr_accessor :collected_errors
11
11
 
12
+ # rubocop:disable Metrics/AbcSize
12
13
  def work
13
14
  if File.exist?("./fastlane/snapshot.js") or File.exist?("./snapshot.js")
14
15
  UI.error "Found old snapshot configuration file 'snapshot.js'"
@@ -32,9 +33,9 @@ module Snapshot
32
33
  self.collected_errors = []
33
34
  results = {} # collect all the results for a nice table
34
35
  launch_arguments_set = config_launch_arguments
35
- Snapshot.config[:devices].each do |device|
36
+ Snapshot.config[:devices].each_with_index do |device, device_index|
36
37
  launch_arguments_set.each do |launch_arguments|
37
- Snapshot.config[:languages].each do |language|
38
+ Snapshot.config[:languages].each_with_index do |language, language_index|
38
39
  locale = nil
39
40
  if language.kind_of?(Array)
40
41
  locale = language[1]
@@ -42,6 +43,10 @@ module Snapshot
42
43
  end
43
44
  results[device] ||= {}
44
45
 
46
+ current_run = device_index * Snapshot.config[:languages].count + language_index + 1
47
+ number_of_runs = Snapshot.config[:languages].count * Snapshot.config[:devices].count
48
+ UI.message("snapshot run #{current_run} of #{number_of_runs}")
49
+
45
50
  results[device][language] = run_for_device_and_language(language, locale, device, launch_arguments)
46
51
  end
47
52
  end
@@ -59,6 +64,7 @@ module Snapshot
59
64
  FileUtils.rm_rf(TestCommandGenerator.derived_data_path)
60
65
  end
61
66
  end
67
+ # rubocop:enable Metrics/AbcSize
62
68
 
63
69
  # This is its own method so that it can re-try if the tests fail randomly
64
70
  # @return true/false depending on if the tests succeded
@@ -192,19 +198,11 @@ module Snapshot
192
198
  end
193
199
  # rubocop:enable Metrics/AbcSize
194
200
 
195
- def open_simulator_for_device(device)
201
+ def open_simulator_for_device(device_name)
196
202
  return unless ENV['FASTLANE_EXPLICIT_OPEN_SIMULATOR']
197
203
 
198
- # As a second level of feature switching, see if we want to try the xcode-select variant
199
- if ENV['FASTLANE_EXPLICIT_OPEN_SIMULATOR'] == '2'
200
- simulator_path = File.join(FastlaneCore::Helper.xcode_path, 'Applications', 'Simulator.app')
201
- UI.message("Explicitly opening simulator at #{simulator_path} for device: #{device}")
202
- else
203
- simulator_path = 'Simulator'
204
- UI.message("Explicitly opening simulator for device: #{device}")
205
- end
206
-
207
- `open -a #{simulator_path} --args -CurrentDeviceUDID #{TestCommandGenerator.device_udid(device)}`
204
+ device = TestCommandGenerator.find_device(device_name)
205
+ FastlaneCore::Simulator.launch(device) if device
208
206
  end
209
207
 
210
208
  def uninstall_app(device_type)
@@ -64,21 +64,23 @@ module Snapshot
64
64
  ["| tee #{xcodebuild_log_path.shellescape} | xcpretty #{Snapshot.config[:xcpretty_args]}"]
65
65
  end
66
66
 
67
- def device_udid(device)
68
- # we now fetch the device's udid. Why? Because we might get this error message
67
+ def find_device(device_name)
68
+ # We might get this error message
69
69
  # > The requested device could not be found because multiple devices matched the request.
70
70
  #
71
71
  # This happens when you have multiple simulators for a given device type / iOS combination
72
72
  # { platform:iOS Simulator, id:1685B071-AFB2-4DC1-BE29-8370BA4A6EBD, OS:9.0, name:iPhone 5 }
73
73
  # { platform:iOS Simulator, id:A141F23B-96B3-491A-8949-813B376C28A7, OS:9.0, name:iPhone 5 }
74
74
  #
75
-
76
- device_udid = nil
77
- FastlaneCore::Simulator.all.each do |sim|
78
- device_udid = sim.udid if sim.name.strip == device.strip and sim.ios_version == Snapshot.config[:ios_version]
75
+ FastlaneCore::Simulator.all.find do |sim|
76
+ sim.name.strip == device_name.strip && sim.ios_version == Snapshot.config[:ios_version]
79
77
  end
78
+ end
79
+
80
+ def device_udid(device_name)
81
+ device = find_device(device_name)
80
82
 
81
- return device_udid
83
+ device ? device.udid : nil
82
84
  end
83
85
 
84
86
  def destination(device)
@@ -1,4 +1,4 @@
1
1
  module Snapshot
2
- VERSION = "1.13.0".freeze
2
+ VERSION = "1.13.1".freeze
3
3
  DESCRIPTION = "Automate taking localized screenshots of your iOS app on every device"
4
4
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: snapshot
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.13.0
4
+ version: 1.13.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Felix Krause
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-07-27 00:00:00.000000000 Z
11
+ date: 2016-08-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: fastimage
@@ -30,7 +30,7 @@ dependencies:
30
30
  requirements:
31
31
  - - ">="
32
32
  - !ruby/object:Gem::Version
33
- version: 0.43.3
33
+ version: 0.50.0
34
34
  - - "<"
35
35
  - !ruby/object:Gem::Version
36
36
  version: 1.0.0
@@ -40,7 +40,7 @@ dependencies:
40
40
  requirements:
41
41
  - - ">="
42
42
  - !ruby/object:Gem::Version
43
- version: 0.43.3
43
+ version: 0.50.0
44
44
  - - "<"
45
45
  - !ruby/object:Gem::Version
46
46
  version: 1.0.0