snapshot 1.0.5 → 1.1.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 +14 -1
- data/lib/assets/SnapshotHelper.swift +2 -2
- data/lib/snapshot/options.rb +6 -0
- data/lib/snapshot/reports_generator.rb +1 -1
- data/lib/snapshot/test_command_generator.rb +1 -1
- data/lib/snapshot/version.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 792893b8ea91ff1cb73ea41fe88538e359f7f369
|
4
|
+
data.tar.gz: 081698de2c4c976898f3824403c04ac2d1e66dd8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ce10a14b5f6d145fce00854da09148aa9657cf5a9a9f8e410a9abeffcd83d039b13315ea5a01b603ad1935a779c85952b40d4c83aecf674d9abde092870f34e1
|
7
|
+
data.tar.gz: 054ae2477fcf77d586c3f6df3d2b3a5a384be2bbd663713ae5717e5dc3515cced46772b818ed890f5f3f1da85a816606856e487fe705ce2ab12c62ec4aa1fd91
|
data/README.md
CHANGED
@@ -138,16 +138,29 @@ Here a few links to get started:
|
|
138
138
|
- 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))
|
139
139
|
- Run `snapshot init` in your project folder
|
140
140
|
- Add the ./SnapshotHelper.swift to your UI Test target (You can move the file anywhere you want)
|
141
|
+
- (Objective C only) add the bridging header to your test class.
|
142
|
+
- `#import “MYUITests-Swift.h"`
|
143
|
+
- The bridging header is named after your test target with -Swift.h appended.
|
141
144
|
- In your UI Test class, click the `Record` button on the bottom left and record your interaction
|
142
|
-
-
|
145
|
+
- To take a snapshot, call the following between interactions
|
146
|
+
- Swift: `snapshot("01LoginScreen")`
|
147
|
+
- Objective C: `[Snapshot snapshot:@"01LoginScreen" waitForLoadingIndicator:YES];`
|
143
148
|
- Add the following code to your `setUp()` method
|
144
149
|
|
150
|
+
**Swift**
|
145
151
|
```swift
|
146
152
|
let app = XCUIApplication()
|
147
153
|
setLanguage(app)
|
148
154
|
app.launch()
|
149
155
|
```
|
150
156
|
|
157
|
+
**Objective C**
|
158
|
+
```objective-c
|
159
|
+
XCUIApplication *app = [[XCUIApplication alloc] init];
|
160
|
+
[Snapshot setLanguage:app];
|
161
|
+
[app launch];
|
162
|
+
```
|
163
|
+
|
151
164
|

|
152
165
|
|
153
166
|
You can take a look at the example project to play around with it.
|
@@ -31,8 +31,8 @@ func snapshot(name: String, waitForLoadingIndicator: Bool = true)
|
|
31
31
|
|
32
32
|
do {
|
33
33
|
let locale = try NSString(contentsOfFile: path, encoding: NSUTF8StringEncoding) as String
|
34
|
-
deviceLanguage = locale
|
35
|
-
app.launchArguments = ["-AppleLanguages", "(\(
|
34
|
+
deviceLanguage = locale.substringToIndex(locale.startIndex.advancedBy(2, limit:locale.endIndex))
|
35
|
+
app.launchArguments = ["-AppleLanguages", "(\(deviceLanguage))", "-AppleLocale", "\"\(locale)\"","-ui_testing"]
|
36
36
|
} catch {
|
37
37
|
print("Couldn't detect/set language...")
|
38
38
|
}
|
data/lib/snapshot/options.rb
CHANGED
@@ -77,6 +77,12 @@ module Snapshot
|
|
77
77
|
env_name: "SNAPSHOT_BUILDLOG_PATH",
|
78
78
|
description: "The directory where to store the build log",
|
79
79
|
default_value: "~/Library/Logs/snapshot"),
|
80
|
+
FastlaneCore::ConfigItem.new(key: :clean,
|
81
|
+
short_option: "-c",
|
82
|
+
env_name: "SNAPSHOT_CLEAN",
|
83
|
+
description: "Should the project be cleaned before building it?",
|
84
|
+
is_string: false,
|
85
|
+
default_value: false),
|
80
86
|
FastlaneCore::ConfigItem.new(key: :configuration,
|
81
87
|
short_option: "-q",
|
82
88
|
env_name: "SNAPSHOT_CONFIGURATION",
|
@@ -35,7 +35,7 @@ module Snapshot
|
|
35
35
|
|
36
36
|
export_path = File.expand_path(export_path)
|
37
37
|
Helper.log.info "Successfully created HTML file with an overview of all the screenshots: '#{export_path}'".green
|
38
|
-
system("open '#{export_path}'") unless
|
38
|
+
system("open '#{export_path}'") unless Snapshot.config[:skip_open_summary]
|
39
39
|
end
|
40
40
|
|
41
41
|
private
|
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.0
|
4
|
+
version: 1.1.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: 2015-10-
|
11
|
+
date: 2015-10-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: fastimage
|
@@ -50,14 +50,14 @@ dependencies:
|
|
50
50
|
requirements:
|
51
51
|
- - ">="
|
52
52
|
- !ruby/object:Gem::Version
|
53
|
-
version:
|
53
|
+
version: 0.2.1
|
54
54
|
type: :runtime
|
55
55
|
prerelease: false
|
56
56
|
version_requirements: !ruby/object:Gem::Requirement
|
57
57
|
requirements:
|
58
58
|
- - ">="
|
59
59
|
- !ruby/object:Gem::Version
|
60
|
-
version:
|
60
|
+
version: 0.2.1
|
61
61
|
- !ruby/object:Gem::Dependency
|
62
62
|
name: plist
|
63
63
|
requirement: !ruby/object:Gem::Requirement
|