snapshot 1.12.3 → 1.13.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3a2f6706dde254c8ec5cf7470a1539cb7cbdc83f
4
- data.tar.gz: 41ed453012760f5795b1f54262d286d1e3e38271
3
+ metadata.gz: be52a63e105fca678eab15efe749632ba3ca661f
4
+ data.tar.gz: 7ce985585dddbb6d1e309c2b780e0a2236bdfea3
5
5
  SHA512:
6
- metadata.gz: 8f5d96bed914afa3ce3c54ea5afac1b6f16ebf3ca7657804721495b735fb7f4eee8ad7b105ed69ddcfb875fc7bfb82f7212b39f23643908297b0e070713b5bdc
7
- data.tar.gz: 434a2585a607f638397bcb422e3601e26425e8448e5004933c13b46e0ded3726a025ca5bccfa876cd13448f7a85f0c2deece84b694ce8f1ce7c30a9c18f44315
6
+ metadata.gz: 09e128bad2e2b626c77d3df4f5103af3625a17094843b05aef541a097e58d905ea08a022712ae7b93e7f356a4221bccf0778149d08fbe99935272d8d626f7c84
7
+ data.tar.gz: aadbf5467434ead6d261cb704b5aa82412d81c3678ec939f31bbf1eae20c91930aa981a54b75383f58c77d4ba02311f2f3eb524210d6598ad3cc278ad03683db
data/README.md CHANGED
@@ -35,6 +35,8 @@ snapshot
35
35
 
36
36
  ###### Automate taking localized screenshots of your iOS app on every device
37
37
 
38
+ 'snapshot' generates localized iOS screenshots for different device types and languages for the App Store and can be uploaded using ([`deliver`](https://github.com/fastlane/fastlane/tree/master/deliver)).
39
+
38
40
  You have to manually create 20 (languages) x 6 (devices) x 5 (screenshots) = **600 screenshots**.
39
41
 
40
42
  It's hard to get everything right!
@@ -321,7 +323,7 @@ launch_arguments([
321
323
 
322
324
  The easiest solution would be to just render the UIWindow into a file. That's not possible because UI Tests don't run on a main thread. So `snapshot` uses a different approach:
323
325
 
324
- When you run unit tests in Xcode, the reporter generates a plist file, documenting all events that occured during the tests ([More Information](http://michele.io/test-logs-in-xcode)). Additionally, Xcode generates screenshots before, during and after each of these events. There is no way to manually trigger a screenshot event. The screenshots and the plist files are stored in the DerivedData directory, which `snapshot` stores in a temporary folder.
326
+ When you run unit tests in Xcode, the reporter generates a plist file, documenting all events that occurred during the tests ([More Information](http://michele.io/test-logs-in-xcode)). Additionally, Xcode generates screenshots before, during and after each of these events. There is no way to manually trigger a screenshot event. The screenshots and the plist files are stored in the DerivedData directory, which `snapshot` stores in a temporary folder.
325
327
 
326
328
  When the user calls `snapshot(...)` in the UI Tests (Swift or Objective C) the script actually does a rotation to `.Unknown` which doesn't have any effect on the actual app, but is enough to trigger a screenshot. It has no effect to the application and is not something you would do in your tests. The goal was to find *some* event that a user would never trigger, so that we know it's from `snapshot`.
327
329
 
@@ -94,7 +94,7 @@ public class Snapshot: NSObject {
94
94
  waitForLoadingIndicatorToDisappear()
95
95
  }
96
96
 
97
- print("snapshot: \(name)") // more information about this, check out https://github.com/fastlane/snapshot
97
+ print("snapshot: \(name)") // more information about this, check out https://github.com/fastlane/fastlane/tree/master/snapshot
98
98
 
99
99
  sleep(1) // Waiting for the animation to be finished (kind of)
100
100
  XCUIDevice.sharedDevice().orientation = .Unknown
@@ -49,7 +49,7 @@ module Snapshot
49
49
 
50
50
  print_results(results)
51
51
 
52
- raise self.collected_errors.join('; ') if self.collected_errors.count > 0
52
+ UI.user_error!(self.collected_errors.join('; ')) if self.collected_errors.count > 0
53
53
 
54
54
  # Generate HTML report
55
55
  ReportsGenerator.new.generate
@@ -111,6 +111,7 @@ module Snapshot
111
111
  end
112
112
 
113
113
  # Returns true if it succeded
114
+ # rubocop:disable Metrics/AbcSize
114
115
  def launch(language, locale, device_type, launch_arguments)
115
116
  screenshots_path = TestCommandGenerator.derived_data_path
116
117
  FileUtils.rm_rf(File.join(screenshots_path, "Logs"))
@@ -189,12 +190,21 @@ module Snapshot
189
190
 
190
191
  return Collector.fetch_screenshots(raw_output, dir_name, device_type, launch_arguments.first)
191
192
  end
193
+ # rubocop:enable Metrics/AbcSize
192
194
 
193
195
  def open_simulator_for_device(device)
194
196
  return unless ENV['FASTLANE_EXPLICIT_OPEN_SIMULATOR']
195
197
 
196
- UI.message("Explicitly opening simulator for device: #{device}")
197
- `open -a Simulator --args -CurrentDeviceUDID #{TestCommandGenerator.device_udid(device)}`
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)}`
198
208
  end
199
209
 
200
210
  def uninstall_app(device_type)
@@ -17,15 +17,16 @@ module Snapshot
17
17
 
18
18
  puts "-------------------------------------------------------".yellow
19
19
  puts "Open your Xcode project and make sure to do the following:".yellow
20
- puts "1) Add the ./fastlane/SnapshotHelper.swift to your UI Test target".yellow
20
+ puts "1) Add a new UI Test target to your project".yellow
21
+ puts "2) Add the ./fastlane/SnapshotHelper.swift to your UI Test target".yellow
21
22
  puts " You can move the file anywhere you want".yellow
22
- puts "2) Call `setupSnapshot(app)` when launching your app".yellow
23
+ puts "3) Call `setupSnapshot(app)` when launching your app".yellow
23
24
  puts ""
24
25
  puts " let app = XCUIApplication()"
25
26
  puts " setupSnapshot(app)"
26
27
  puts " app.launch()"
27
28
  puts ""
28
- puts "3) Add `snapshot(\"0Launch\")` to wherever you want to create the screenshots".yellow
29
+ puts "4) Add `snapshot(\"0Launch\")` to wherever you want to create the screenshots".yellow
29
30
  puts ""
30
31
  puts "More information on GitHub: https://github.com/fastlane/fastlane/tree/master/snapshot".green
31
32
  end
@@ -7,6 +7,7 @@ module Snapshot
7
7
  parts << "xcodebuild"
8
8
  parts += options
9
9
  parts += destination(device_type)
10
+ parts += build_settings
10
11
  parts += actions
11
12
  parts += suffix
12
13
  parts += pipe
@@ -39,6 +40,13 @@ module Snapshot
39
40
  options
40
41
  end
41
42
 
43
+ def build_settings
44
+ build_settings = []
45
+ build_settings << "FASTLANE_SNAPSHOT=YES"
46
+
47
+ build_settings
48
+ end
49
+
42
50
  def actions
43
51
  actions = []
44
52
  actions << :clean if Snapshot.config[:clean]
@@ -1,4 +1,4 @@
1
1
  module Snapshot
2
- VERSION = "1.12.3".freeze
2
+ VERSION = "1.13.0".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.12.3
4
+ version: 1.13.0
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-05-25 00:00:00.000000000 Z
11
+ date: 2016-07-27 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.36.1
33
+ version: 0.43.3
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.36.1
43
+ version: 0.43.3
44
44
  - - "<"
45
45
  - !ruby/object:Gem::Version
46
46
  version: 1.0.0