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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 151fb2b63c45fbd4f2a3b504b54ed939100e5077
4
- data.tar.gz: 51dc88520b4b87f6e47b40fd8dc38388e309407c
3
+ metadata.gz: 792893b8ea91ff1cb73ea41fe88538e359f7f369
4
+ data.tar.gz: 081698de2c4c976898f3824403c04ac2d1e66dd8
5
5
  SHA512:
6
- metadata.gz: b079c02208bde8f19e36852913b28d3358e9c1b225aaf04aa20c10ef27bd85c8cac8e46bcd19d02a9b6ca7437aa87491ff58cafc18be780f9c0d6a43a69e1e9a
7
- data.tar.gz: e4c04be3a68e162cd46426671cded11335db414cd3c8fc05748b166a29815921abe361e781eef0004513afb9c0ab4ce48a6c3e997ee58526b03664bce67b8bed
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
- - Add `snapshot("01LoginScreen")` method calls inbetween your interactions to take new screenshots
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
  ![assets/snapshot.gif](assets/snapshot.gif)
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", "(\(locale))", "-AppleLocale", "\"\(locale)\"","-ui_testing"]
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
  }
@@ -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 ENV["SNAPSHOT_SKIP_OPEN_SUMMARY"]
38
+ system("open '#{export_path}'") unless Snapshot.config[:skip_open_summary]
39
39
  end
40
40
 
41
41
  private
@@ -44,7 +44,7 @@ module Snapshot
44
44
 
45
45
  def actions
46
46
  actions = []
47
- # actions << :clean if config[:clean]
47
+ actions << :clean if Snapshot.config[:clean]
48
48
  actions << :build # https://github.com/fastlane/snapshot/issues/246
49
49
  actions << :test
50
50
 
@@ -1,4 +1,4 @@
1
1
  module Snapshot
2
- VERSION = "1.0.5"
2
+ VERSION = "1.1.0"
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.0.5
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-28 00:00:00.000000000 Z
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: '0'
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: '0'
60
+ version: 0.2.1
61
61
  - !ruby/object:Gem::Dependency
62
62
  name: plist
63
63
  requirement: !ruby/object:Gem::Requirement