snapshot 1.10.0 → 1.11.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 +4 -4
- data/README.md +13 -5
- data/lib/assets/SnapfileTemplate +1 -1
- data/lib/snapshot/collector.rb +2 -2
- data/lib/snapshot/runner.rb +4 -1
- data/lib/snapshot/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1f1c80767948a568435448321574416a51975c4d
|
4
|
+
data.tar.gz: 08b2573705b5d716d1ada5a58067d341195330c3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ccf0d605b2de18c6aec30073fc7e641c70dfb94e31847f040c468941ed378db7f406c93d767665d76a53f648cc345982557c3bfee0941cde1f35bf37d3cd7291
|
7
|
+
data.tar.gz: 80050ee54779dd305ba6ac591dfeb9673cf96a5330ff6aa1f7b1dbc4be444d54f2102a08a4bb379690480235f0c8c168f6587b3a315f570b943c355c70ec301f
|
data/README.md
CHANGED
@@ -249,7 +249,7 @@ languages([
|
|
249
249
|
["pt", "pt_BR"] # Portuguese with Brazilian locale
|
250
250
|
])
|
251
251
|
|
252
|
-
launch_arguments("-username Felix")
|
252
|
+
launch_arguments(["-username Felix"])
|
253
253
|
|
254
254
|
# The directory in which the screenshots should be stored
|
255
255
|
output_directory './screenshots'
|
@@ -286,7 +286,18 @@ to update your `SnapshotHelper.swift` files. In case you modified your `Snapshot
|
|
286
286
|
|
287
287
|
## Launch Arguments
|
288
288
|
|
289
|
-
You can provide additional arguments to your app on launch. These strings will be available in your app (eg. not in the testing target) through `NSProcessInfo.processInfo().arguments`. Alternatively use user-default syntax (`-key value`) and they will be available as key-value pairs in `NSUserDefaults.standardUserDefaults()`.
|
289
|
+
You can provide additional arguments to your app on launch. These strings will be available in your app (eg. not in the testing target) through `NSProcessInfo.processInfo().arguments`. Alternatively, use user-default syntax (`-key value`) and they will be available as key-value pairs in `NSUserDefaults.standardUserDefaults()`.
|
290
|
+
|
291
|
+
```ruby
|
292
|
+
launch_arguments([
|
293
|
+
"-firstName Felix -lastName Krause"
|
294
|
+
])
|
295
|
+
```
|
296
|
+
|
297
|
+
```swift
|
298
|
+
name.text = NSUserDefaults.standardUserDefaults().stringForKey("firstName")
|
299
|
+
// name.text = "Felix"
|
300
|
+
```
|
290
301
|
|
291
302
|
`snapshot` includes `-FASTLANE_SNAPSHOT YES`, which will set a temporary user default for the key `FASTLANE_SNAPSHOT`, you may use this to detect when the app is run by `snapshot`.
|
292
303
|
|
@@ -294,9 +305,6 @@ You can provide additional arguments to your app on launch. These strings will b
|
|
294
305
|
if NSUserDefaults.standardUserDefaults().boolForKey("FASTLANE_SNAPSHOT") {
|
295
306
|
// runtime check that we are in snapshot mode
|
296
307
|
}
|
297
|
-
|
298
|
-
username.text = NSUserDefaults.standardUserDefaults().stringForKey("username")
|
299
|
-
// username.text = "Felix"
|
300
308
|
```
|
301
309
|
|
302
310
|
Specify multiple argument strings and `snapshot` will generate screenshots for each combination of arguments, devices, and languages. This is useful for comparing the same screenshots with different feature flags, dynamic text sizes, and different data sets.
|
data/lib/assets/SnapfileTemplate
CHANGED
@@ -18,7 +18,7 @@ languages([
|
|
18
18
|
])
|
19
19
|
|
20
20
|
# Arguments to pass to the app on launch. See https://github.com/fastlane/snapshot#launch-arguments
|
21
|
-
# launch_arguments("-favColor red")
|
21
|
+
# launch_arguments(["-favColor red"])
|
22
22
|
|
23
23
|
# The name of the scheme which contains the UI Tests
|
24
24
|
# scheme "SchemeName"
|
data/lib/snapshot/collector.rb
CHANGED
@@ -2,7 +2,7 @@ module Snapshot
|
|
2
2
|
# Responsible for collecting the generated screenshots and copying them over to the output directory
|
3
3
|
class Collector
|
4
4
|
# Returns true if it succeeds
|
5
|
-
def self.fetch_screenshots(output,
|
5
|
+
def self.fetch_screenshots(output, dir_name, device_type, launch_arguments_index)
|
6
6
|
# Documentation about how this works in the project README
|
7
7
|
containing = File.join(TestCommandGenerator.derived_data_path, "Logs", "Test")
|
8
8
|
attachments_path = File.join(containing, "Attachments")
|
@@ -22,7 +22,7 @@ module Snapshot
|
|
22
22
|
name = current[0]
|
23
23
|
filename = to_store[index]
|
24
24
|
|
25
|
-
language_folder = File.join(Snapshot.config[:output_directory],
|
25
|
+
language_folder = File.join(Snapshot.config[:output_directory], dir_name)
|
26
26
|
FileUtils.mkdir_p(language_folder)
|
27
27
|
|
28
28
|
device_name = device_type.delete(" ")
|
data/lib/snapshot/runner.rb
CHANGED
@@ -175,7 +175,10 @@ module Snapshot
|
|
175
175
|
end)
|
176
176
|
|
177
177
|
raw_output = File.read(TestCommandGenerator.xcodebuild_log_path)
|
178
|
-
|
178
|
+
|
179
|
+
dir_name = locale || language
|
180
|
+
|
181
|
+
return Collector.fetch_screenshots(raw_output, dir_name, device_type, launch_arguments.first)
|
179
182
|
end
|
180
183
|
|
181
184
|
def uninstall_app(device_type)
|
data/lib/snapshot/version.rb
CHANGED
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.
|
4
|
+
version: 1.11.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-
|
11
|
+
date: 2016-03-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: fastimage
|