snapshot 1.11.1 → 1.12.0

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: c170770aac05bc57d39e39fd2b7cbf1e6b028c5c
4
- data.tar.gz: 464bc150daa1faee0c65064203800fe4af5836b7
3
+ metadata.gz: a7f61f2f3c7aa60d70e206209b8d11396233590a
4
+ data.tar.gz: eb1d37214aa896123087ee76ad074d03f0852231
5
5
  SHA512:
6
- metadata.gz: db251e93a1991fa4ea261fe667ea4fa5ef996a4e4891b6a37d30ad0db4e9235807040395dc8659e56b0794dfc0855c98852fed8a1901099e1657efcc36475c1b
7
- data.tar.gz: 78d20002241921a55701f8baa750d9737660e9971e1b4f0e9bb4b134b962622e8c8268e5b4fe2a219f2afb428876983acf340585ec14da6d7ef42f4daf1aad5f
6
+ metadata.gz: dd88feb6567be7d744de8666406162b0241618a542e4a0deaa9bfaa5c7c6188714e745e7ac13f1de5c8f81ca8276623ab68d3431a743ed875d198dab6db71b20
7
+ data.tar.gz: 6ae65a84f6518243ca080a1c3aebe906e0556bfe6b33175b5737f8a1b2b305f0b3c0ef2a6611e4da9addd8c844a8a5627d7b1d12ed1236f5cf6ca6a4edae6967
data/README.md CHANGED
@@ -1,24 +1,24 @@
1
1
  <h3 align="center">
2
- <a href="https://github.com/fastlane/fastlane">
3
- <img src="assets/fastlane.png" width="150" />
2
+ <a href="https://github.com/fastlane/fastlane/tree/master/fastlane">
3
+ <img src="../fastlane/assets/fastlane.png" width="150" />
4
4
  <br />
5
5
  fastlane
6
6
  </a>
7
7
  </h3>
8
8
  <p align="center">
9
- <a href="https://github.com/fastlane/deliver">deliver</a> &bull;
10
- <b>snapshot</b> &bull;
11
- <a href="https://github.com/fastlane/frameit">frameit</a> &bull;
12
- <a href="https://github.com/fastlane/pem">pem</a> &bull;
13
- <a href="https://github.com/fastlane/sigh">sigh</a> &bull;
14
- <a href="https://github.com/fastlane/produce">produce</a> &bull;
15
- <a href="https://github.com/fastlane/cert">cert</a> &bull;
16
- <a href="https://github.com/fastlane/spaceship">spaceship</a> &bull;
17
- <a href="https://github.com/fastlane/pilot">pilot</a> &bull;
9
+ <a href="https://github.com/fastlane/fastlane/tree/master/deliver">deliver</a> &bull;
10
+ <b>snapshot</b> &bull;
11
+ <a href="https://github.com/fastlane/fastlane/tree/master/frameit">frameit</a> &bull;
12
+ <a href="https://github.com/fastlane/fastlane/tree/master/pem">pem</a> &bull;
13
+ <a href="https://github.com/fastlane/fastlane/tree/master/sigh">sigh</a> &bull;
14
+ <a href="https://github.com/fastlane/fastlane/tree/master/produce">produce</a> &bull;
15
+ <a href="https://github.com/fastlane/fastlane/tree/master/cert">cert</a> &bull;
16
+ <a href="https://github.com/fastlane/fastlane/tree/master/spaceship">spaceship</a> &bull;
17
+ <a href="https://github.com/fastlane/fastlane/tree/master/pilot">pilot</a> &bull;
18
18
  <a href="https://github.com/fastlane/boarding">boarding</a> &bull;
19
- <a href="https://github.com/fastlane/gym">gym</a> &bull;
20
- <a href="https://github.com/fastlane/scan">scan</a> &bull;
21
- <a href="https://github.com/fastlane/match">match</a>
19
+ <a href="https://github.com/fastlane/fastlane/tree/master/gym">gym</a> &bull;
20
+ <a href="https://github.com/fastlane/fastlane/tree/master/scan">scan</a> &bull;
21
+ <a href="https://github.com/fastlane/fastlane/tree/master/match">match</a>
22
22
  </p>
23
23
  -------
24
24
 
@@ -30,7 +30,7 @@ snapshot
30
30
  ============
31
31
 
32
32
  [![Twitter: @FastlaneTools](https://img.shields.io/badge/contact-@FastlaneTools-blue.svg?style=flat)](https://twitter.com/FastlaneTools)
33
- [![License](https://img.shields.io/badge/license-MIT-green.svg?style=flat)](https://github.com/fastlane/snapshot/blob/master/LICENSE)
33
+ [![License](https://img.shields.io/badge/license-MIT-green.svg?style=flat)](https://github.com/fastlane/fastlane/blob/master/snapshot/LICENSE)
34
34
  [![Gem](https://img.shields.io/gem/v/snapshot.svg?style=flat)](http://rubygems.org/gems/snapshot)
35
35
 
36
36
  ###### Automate taking localized screenshots of your iOS app on every device
@@ -43,7 +43,7 @@ It's hard to get everything right!
43
43
  - No loading indicators
44
44
  - Same content / screens
45
45
  - [Clean Status Bar](#use-a-clean-status-bar)
46
- - Uploading screenshots ([`deliver`](https://github.com/fastlane/deliver) is your friend)
46
+ - Uploading screenshots ([`deliver`](https://github.com/fastlane/fastlane/tree/master/deliver) is your friend)
47
47
 
48
48
  More information about [creating perfect screenshots](https://krausefx.com/blog/creating-perfect-app-store-screenshots-of-your-ios-app).
49
49
 
@@ -57,7 +57,7 @@ Apple announced a new version of Xcode with support for UI Tests built in right
57
57
 
58
58
  As a result, `snapshot` was completely rewritten from ground up without changing its public API.
59
59
 
60
- Please check out the [MigrationGuide to 1.0](/MigrationGuide.md) :+1:
60
+ Please check out the [MigrationGuide to 1.0](/snapshot/MigrationGuide.md) :+1:
61
61
 
62
62
  **Why change to UI Tests?**
63
63
 
@@ -69,13 +69,13 @@ Please check out the [MigrationGuide to 1.0](/MigrationGuide.md) :+1:
69
69
 
70
70
  -------
71
71
  <p align="center">
72
- <a href="#features">Features</a> &bull;
73
- <a href="#installation">Installation</a> &bull;
74
- <a href="#ui-tests">UI Tests</a> &bull;
75
- <a href="#quick-start">Quick Start</a> &bull;
76
- <a href="#usage">Usage</a> &bull;
77
- <a href="#tips">Tips</a> &bull;
78
- <a href="#how-does-it-work">How?</a> &bull;
72
+ <a href="#features">Features</a> &bull;
73
+ <a href="#installation">Installation</a> &bull;
74
+ <a href="#ui-tests">UI Tests</a> &bull;
75
+ <a href="#quick-start">Quick Start</a> &bull;
76
+ <a href="#usage">Usage</a> &bull;
77
+ <a href="#tips">Tips</a> &bull;
78
+ <a href="#how-does-it-work">How?</a> &bull;
79
79
  <a href="#need-help">Need help?</a>
80
80
  </p>
81
81
 
@@ -87,7 +87,7 @@ Please check out the [MigrationGuide to 1.0](/MigrationGuide.md) :+1:
87
87
  - Create hundreds of screenshots in multiple languages on all simulators
88
88
  - Configure it once, store the configuration in git
89
89
  - Do something else, while the computer takes the screenshots for you
90
- - Integrates with [`fastlane`](https://fastlane.tools) and [`deliver`](https://github.com/fastlane/deliver)
90
+ - Integrates with [`fastlane`](https://fastlane.tools) and [`deliver`](https://github.com/fastlane/fastlane/tree/master/deliver)
91
91
  - Generates a beautiful web page, which shows all screenshots on all devices. This is perfect to send to Q&A or the marketing team
92
92
  - `snapshot` automatically waits for network requests to be finished before taking a screenshot (we don't want loading images in the App Store screenshots)
93
93
 
@@ -120,11 +120,11 @@ Install the gem
120
120
  Make sure, you have the latest version of the Xcode command line tools installed:
121
121
 
122
122
  xcode-select --install
123
-
123
+
124
124
  # UI Tests
125
125
 
126
126
  ## Getting started
127
- This project uses Apple's newly announced UI Tests. I will not go into detail on how to write scripts.
127
+ This project uses Apple's newly announced UI Tests. I will not go into detail on how to write scripts.
128
128
 
129
129
  Here a few links to get started:
130
130
 
@@ -141,13 +141,13 @@ Here a few links to get started:
141
141
  - Create a new UI Test target in your Xcode project ([top part of this article](https://krausefx.com/blog/run-xcode-7-ui-tests-from-the-command-line))
142
142
  - Run `snapshot init` in your project folder
143
143
  - Add the ./SnapshotHelper.swift to your UI Test target (You can move the file anywhere you want)
144
- - (Objective C only) add the bridging header to your test class.
144
+ - (Objective C only) add the bridging header to your test class.
145
145
  - `#import "MYUITests-Swift.h"`
146
146
  - The bridging header is named after your test target with -Swift.h appended.
147
147
  - In your UI Test class, click the `Record` button on the bottom left and record your interaction
148
148
  - To take a snapshot, call the following between interactions
149
149
  - Swift: `snapshot("01LoginScreen")`
150
- - Objective C: `[Snapshot snapshot:@"01LoginScreen" waitForLoadingIndicator:YES];`
150
+ - Objective C: `[Snapshot snapshot:@"01LoginScreen" waitForLoadingIndicator:YES];`
151
151
  - Add the following code to your `setUp()` method
152
152
 
153
153
  **Swift**
@@ -193,7 +193,7 @@ There are a lot of options available that define how to build your app, for exam
193
193
 
194
194
  ```sh
195
195
  snapshot --scheme "UITests" --configuration "Release" --sdk "iphonesimulator"
196
- ```
196
+ ```
197
197
 
198
198
  Reinstall the app before running `snapshot`
199
199
 
@@ -268,7 +268,7 @@ You can run this command in the terminal to delete and re-create all iOS simulat
268
268
  snapshot reset_simulators
269
269
  ```
270
270
 
271
- **Warning**: This will delete **all** your simulators and replace by new ones! This is useful, if you run into weird problems when running `snapshot`.
271
+ **Warning**: This will delete **all** your simulators and replace by new ones! This is useful, if you run into weird problems when running `snapshot`.
272
272
 
273
273
  You can use the environment variable `SNAPSHOT_FORCE_DELETE` to stop asking for confirmation before deleting.
274
274
 
@@ -276,13 +276,13 @@ You can use the environment variable `SNAPSHOT_FORCE_DELETE` to stop asking for
276
276
 
277
277
  Some updates require the helper files to be updated. `snapshot` will automatically warn you and tell you how to update.
278
278
 
279
- Basically you can run
279
+ Basically you can run
280
280
 
281
281
  ```
282
282
  snapshot update
283
283
  ```
284
284
 
285
- to update your `SnapshotHelper.swift` files. In case you modified your `SnapshotHelper.swift` and want to manually update the file, check out [SnapshotHelper.swift](https://github.com/fastlane/snapshot/blob/master/lib/assets/SnapshotHelper.swift).
285
+ to update your `SnapshotHelper.swift` files. In case you modified your `SnapshotHelper.swift` and want to manually update the file, check out [SnapshotHelper.swift](https://github.com/fastlane/fastlane/blob/master/snapshot/lib/assets/SnapshotHelper.swift).
286
286
 
287
287
  ## Launch Arguments
288
288
 
@@ -325,7 +325,7 @@ When you run unit tests in Xcode, the reporter generates a plist file, documenti
325
325
 
326
326
  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
327
 
328
- `snapshot` then iterates through all test events and check where we did this weird rotation. Once `snapshot` has all events triggered by `snapshot` it collects a ordered list of all the file names of the actual screenshots of the application.
328
+ `snapshot` then iterates through all test events and check where we did this weird rotation. Once `snapshot` has all events triggered by `snapshot` it collects a ordered list of all the file names of the actual screenshots of the application.
329
329
 
330
330
  In the test output, the Swift `snapshot` function will print out something like this
331
331
 
@@ -347,24 +347,24 @@ Also, feel free to duplicate radar [23062925](https://openradar.appspot.com/rada
347
347
  ## [`fastlane`](https://fastlane.tools) Toolchain
348
348
 
349
349
  - [`fastlane`](https://fastlane.tools): Connect all deployment tools into one streamlined workflow
350
- - [`deliver`](https://github.com/fastlane/deliver): Upload screenshots, metadata and your app to the App Store
351
- - [`frameit`](https://github.com/fastlane/frameit): Quickly put your screenshots into the right device frames
352
- - [`PEM`](https://github.com/fastlane/pem): Automatically generate and renew your push notification profiles
353
- - [`sigh`](https://github.com/fastlane/sigh): Because you would rather spend your time building stuff than fighting provisioning
354
- - [`produce`](https://github.com/fastlane/produce): Create new iOS apps on iTunes Connect and Dev Portal using the command line
355
- - [`cert`](https://github.com/fastlane/cert): Automatically create and maintain iOS code signing certificates
356
- - [`spaceship`](https://github.com/fastlane/spaceship): Ruby library to access the Apple Dev Center and iTunes Connect
357
- - [`pilot`](https://github.com/fastlane/pilot): The best way to manage your TestFlight testers and builds from your terminal
358
- - [`boarding`](https://github.com/fastlane/boarding): The easiest way to invite your TestFlight beta testers
359
- - [`gym`](https://github.com/fastlane/gym): Building your iOS apps has never been easier
360
- - [`scan`](https://github.com/fastlane/scan): The easiest way to run tests of your iOS and Mac app
361
- - [`match`](https://github.com/fastlane/match): Easily sync your certificates and profiles across your team using git
350
+ - [`deliver`](https://github.com/fastlane/fastlane/tree/master/deliver): Upload screenshots, metadata and your app to the App Store
351
+ - [`frameit`](https://github.com/fastlane/fastlane/tree/master/frameit): Quickly put your screenshots into the right device frames
352
+ - [`PEM`](https://github.com/fastlane/fastlane/tree/master/pem): Automatically generate and renew your push notification profiles
353
+ - [`sigh`](https://github.com/fastlane/fastlane/tree/master/sigh): Because you would rather spend your time building stuff than fighting provisioning
354
+ - [`produce`](https://github.com/fastlane/fastlane/tree/master/produce): Create new iOS apps on iTunes Connect and Dev Portal using the command line
355
+ - [`cert`](https://github.com/fastlane/fastlane/tree/master/cert): Automatically create and maintain iOS code signing certificates
356
+ - [`spaceship`](https://github.com/fastlane/fastlane/tree/master/spaceship): Ruby library to access the Apple Dev Center and iTunes Connect
357
+ - [`pilot`](https://github.com/fastlane/fastlane/tree/master/pilot): The best way to manage your TestFlight testers and builds from your terminal
358
+ - [`boarding`](https://github.com/fastlane/boarding): The easiest way to invite your TestFlight beta testers
359
+ - [`gym`](https://github.com/fastlane/fastlane/tree/master/gym): Building your iOS apps has never been easier
360
+ - [`scan`](https://github.com/fastlane/fastlane/tree/master/scan): The easiest way to run tests of your iOS and Mac app
361
+ - [`match`](https://github.com/fastlane/fastlane/tree/master/match): Easily sync your certificates and profiles across your team using git
362
362
 
363
363
  ##### [Like this tool? Be the first to know about updates and new fastlane tools](https://tinyletter.com/krausefx)
364
364
 
365
365
  ## Frame the screenshots
366
366
 
367
- If you want to add frames around the screenshots and even put a title on top, check out [frameit](https://github.com/fastlane/frameit).
367
+ If you want to add frames around the screenshots and even put a title on top, check out [frameit](https://github.com/fastlane/fastlane/tree/master/frameit).
368
368
 
369
369
  ## Available language codes
370
370
  ```ruby
@@ -398,7 +398,7 @@ You can access the language using the `deviceLanguage` variable.
398
398
  Please submit an issue on GitHub and provide information about your setup
399
399
 
400
400
  # Code of Conduct
401
- Help us keep `snapshot` open and inclusive. Please read and follow our [Code of Conduct](https://github.com/fastlane/code-of-conduct).
401
+ Help us keep `snapshot` open and inclusive. Please read and follow our [Code of Conduct](https://github.com/fastlane/fastlane/blob/master/CODE_OF_CONDUCT.md).
402
402
 
403
403
  # License
404
404
  This project is licensed under the terms of the MIT license. See the LICENSE file.
data/bin/snapshot CHANGED
@@ -10,6 +10,7 @@ HighLine.track_eof = false
10
10
  class SnapshotApplication
11
11
  include Commander::Methods
12
12
 
13
+ # rubocop:disable Metrics/MethodLength
13
14
  def run
14
15
  program :version, Snapshot::VERSION
15
16
  program :description, 'CLI for \'snapshot\' - Automate taking localized screenshots of your iOS app on every device'
@@ -29,9 +30,7 @@ class SnapshotApplication
29
30
  c.description = 'Take new screenshots based on the Snapfile.'
30
31
 
31
32
  c.action do |args, options|
32
- o = options.__hash__.dup
33
- o.delete(:verbose)
34
- Snapshot.config = FastlaneCore::Configuration.create(Snapshot::Options.available_options, o)
33
+ load_config(options)
35
34
 
36
35
  Snapshot::DependencyChecker.check_simulators
37
36
  Snapshot::Runner.new.work
@@ -73,10 +72,37 @@ class SnapshotApplication
73
72
  end
74
73
  end
75
74
 
75
+ command :clear_derived_data do |c|
76
+ c.syntax = 'snapshot clear_derived_data -f path'
77
+ c.description = "Clear the directory where build products and other derived data will go"
78
+
79
+ c.action do |args, options|
80
+ load_config(options)
81
+ derived_data_path = Snapshot.config[:derived_data_path]
82
+
83
+ if !derived_data_path
84
+ Snapshot::UI.user_error! "No derived_data_path"
85
+ elsif !Dir.exist?(derived_data_path)
86
+ Snapshot::UI.important "Path #{derived_data_path} does not exist"
87
+ else
88
+ FileUtils.rm_rf(derived_data_path)
89
+ Snapshot::UI.success "Removed #{derived_data_path}"
90
+ end
91
+ end
92
+ end
93
+
76
94
  default_command :run
77
95
 
78
96
  run!
79
97
  end
98
+
99
+ private
100
+
101
+ def load_config(options)
102
+ o = options.__hash__.dup
103
+ o.delete(:verbose)
104
+ Snapshot.config = FastlaneCore::Configuration.create(Snapshot::Options.available_options, o)
105
+ end
80
106
  end
81
107
 
82
108
  begin
@@ -144,7 +144,12 @@ module Snapshot
144
144
  env_name: 'SNAPSHOT_BREAK_ON_FIRST_ERROR',
145
145
  description: "Should snapshot stop immediately after the tests completely failed on one device?",
146
146
  default_value: false,
147
- is_string: false)
147
+ is_string: false),
148
+ FastlaneCore::ConfigItem.new(key: :derived_data_path,
149
+ short_option: "-f",
150
+ env_name: "SNAPSHOT_DERIVED_DATA_PATH",
151
+ description: "The directory where build products and other derived data will go",
152
+ optional: true)
148
153
  ]
149
154
  end
150
155
  end
@@ -14,7 +14,7 @@ module Snapshot
14
14
  UI.error "Found old snapshot configuration file 'snapshot.js'"
15
15
  UI.error "You updated to snapshot 1.0 which now uses UI Automation"
16
16
  UI.error "Please follow the migration guide: https://github.com/fastlane/snapshot/blob/master/MigrationGuide.md"
17
- UI.error "And read the updated documentation: https://github.com/fastlane/snapshot"
17
+ UI.error "And read the updated documentation: https://github.com/fastlane/fastlane/tree/master/snapshot"
18
18
  sleep 3 # to be sure the user sees this, as compiling clears the screen
19
19
  end
20
20
 
@@ -55,7 +55,9 @@ module Snapshot
55
55
  ReportsGenerator.new.generate
56
56
 
57
57
  # Clear the Derived Data
58
- FileUtils.rm_rf(TestCommandGenerator.derived_data_path)
58
+ unless Snapshot.config[:derived_data_path]
59
+ FileUtils.rm_rf(TestCommandGenerator.derived_data_path)
60
+ end
59
61
  end
60
62
 
61
63
  # This is its own method so that it can re-try if the tests fail randomly
@@ -27,7 +27,7 @@ module Snapshot
27
27
  puts ""
28
28
  puts "3) Add `snapshot(\"0Launch\")` to wherever you want to create the screenshots".yellow
29
29
  puts ""
30
- puts "More information on GitHub: https://github.com/fastlane/snapshot".green
30
+ puts "More information on GitHub: https://github.com/fastlane/fastlane/tree/master/snapshot".green
31
31
  end
32
32
  end
33
33
  end
@@ -53,7 +53,7 @@ module Snapshot
53
53
  end
54
54
 
55
55
  def pipe
56
- ["| tee '#{xcodebuild_log_path}' | xcpretty #{Snapshot.config[:xcpretty_args]}"]
56
+ ["| tee #{xcodebuild_log_path.shellescape} | xcpretty #{Snapshot.config[:xcpretty_args]}"]
57
57
  end
58
58
 
59
59
  def device_udid(device)
@@ -88,7 +88,7 @@ module Snapshot
88
88
  end
89
89
 
90
90
  def derived_data_path
91
- Snapshot.cache[:derived_data_path] ||= Dir.mktmpdir("snapshot_derived")
91
+ Snapshot.cache[:derived_data_path] ||= (Snapshot.config[:derived_data_path] || Dir.mktmpdir("snapshot_derived"))
92
92
  end
93
93
  end
94
94
  end
@@ -1,4 +1,4 @@
1
1
  module Snapshot
2
- VERSION = "1.11.1".freeze
2
+ VERSION = "1.12.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.11.1
4
+ version: 1.12.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-03-07 00:00:00.000000000 Z
11
+ date: 2016-03-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: fastimage
@@ -176,14 +176,14 @@ dependencies:
176
176
  requirements:
177
177
  - - "~>"
178
178
  - !ruby/object:Gem::Version
179
- version: 0.35.1
179
+ version: 0.38.0
180
180
  type: :development
181
181
  prerelease: false
182
182
  version_requirements: !ruby/object:Gem::Requirement
183
183
  requirements:
184
184
  - - "~>"
185
185
  - !ruby/object:Gem::Version
186
- version: 0.35.1
186
+ version: 0.38.0
187
187
  - !ruby/object:Gem::Dependency
188
188
  name: webmock
189
189
  requirement: !ruby/object:Gem::Requirement