snapshot 1.5.0 → 1.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +3 -2
- data/lib/assets/SnapfileTemplate +1 -1
- data/lib/assets/SnapshotHelper.swift +10 -6
- data/lib/snapshot/detect_values.rb +1 -1
- data/lib/snapshot/error_handler.rb +2 -0
- data/lib/snapshot/options.rb +1 -0
- data/lib/snapshot/setup.rb +1 -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: 6ad2e98962df5f2e97ec3c33bede4babdce30168
|
4
|
+
data.tar.gz: bc9ac35cf07d90461d297c20aa3977f5c137e7dc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 756b6e5a499083e7dee9a325fb41e7b3820311e18b3f7de6bc61c6be325ccef38a406d3f749e073b5bdc26768a259c8240db630e688348e3af8097466c9082a1
|
7
|
+
data.tar.gz: 9cd8d9b921a58da4bd3333f9be6c40b966c00b2285adb178e9d1eea96c6449aeaf44aed345e6f4ab9a0e8eaa0979d039232a341dad80eac73b99f83cc0dbe15a
|
data/README.md
CHANGED
@@ -350,8 +350,6 @@ ALL_LANGUAGES = ["da", "de-DE", "el", "en-AU", "en-CA", "en-GB", "en-US", "es-ES
|
|
350
350
|
## Use a clean status bar
|
351
351
|
You can use [SimulatorStatusMagic](https://github.com/shinydevelopment/SimulatorStatusMagic) to clean up the status bar.
|
352
352
|
|
353
|
-
If you enable a clean status bar, you have to remove the `waitForLoadingIndicatorToDisappear` from the `SnapshotHelper.swift` code, as it doesn't detect when the loading indicator disappears.
|
354
|
-
|
355
353
|
## Editing the `Snapfile`
|
356
354
|
Change syntax highlighting to *Ruby*.
|
357
355
|
|
@@ -373,6 +371,9 @@ You can access the language using the `deviceLanguage` variable.
|
|
373
371
|
# Need help?
|
374
372
|
Please submit an issue on GitHub and provide information about your setup
|
375
373
|
|
374
|
+
# Code of Conduct
|
375
|
+
Help us keep `snapshot` open and inclusive. Please read and follow our [Code of Conduct](https://github.com/fastlane/code-of-conduct).
|
376
|
+
|
376
377
|
# License
|
377
378
|
This project is licensed under the terms of the MIT license. See the LICENSE file.
|
378
379
|
|
data/lib/assets/SnapfileTemplate
CHANGED
@@ -16,7 +16,7 @@ languages([
|
|
16
16
|
"it-IT"
|
17
17
|
])
|
18
18
|
|
19
|
-
# Arguments to pass to the app on launch. See https://github.com/fastlane/snapshot#
|
19
|
+
# Arguments to pass to the app on launch. See https://github.com/fastlane/snapshot#launch-arguments
|
20
20
|
# launch_arguments("-favColor red")
|
21
21
|
|
22
22
|
# The name of the scheme which contains the UI Tests
|
@@ -20,7 +20,7 @@ func setupSnapshot(app: XCUIApplication) {
|
|
20
20
|
Snapshot.setupSnapshot(app)
|
21
21
|
}
|
22
22
|
|
23
|
-
func snapshot(name: String, waitForLoadingIndicator: Bool =
|
23
|
+
func snapshot(name: String, waitForLoadingIndicator: Bool = true) {
|
24
24
|
Snapshot.snapshot(name, waitForLoadingIndicator: waitForLoadingIndicator)
|
25
25
|
}
|
26
26
|
|
@@ -61,7 +61,7 @@ class Snapshot: NSObject {
|
|
61
61
|
}
|
62
62
|
}
|
63
63
|
|
64
|
-
class func snapshot(name: String, waitForLoadingIndicator: Bool =
|
64
|
+
class func snapshot(name: String, waitForLoadingIndicator: Bool = true) {
|
65
65
|
if waitForLoadingIndicator {
|
66
66
|
waitForLoadingIndicatorToDisappear()
|
67
67
|
}
|
@@ -75,15 +75,19 @@ class Snapshot: NSObject {
|
|
75
75
|
class func waitForLoadingIndicatorToDisappear() {
|
76
76
|
let query = XCUIApplication().statusBars.childrenMatchingType(.Other).elementBoundByIndex(1).childrenMatchingType(.Other)
|
77
77
|
|
78
|
-
|
79
|
-
|
80
|
-
while (query.count > UInt(expectedCount)) {
|
78
|
+
while (0..<query.count).map({ query.elementBoundByIndex($0) }).contains({ $0.isLoadingIndicator }) {
|
81
79
|
sleep(1)
|
82
|
-
print("
|
80
|
+
print("Waiting for loading indicator to disappear...")
|
83
81
|
}
|
84
82
|
}
|
85
83
|
}
|
86
84
|
|
85
|
+
extension XCUIElement {
|
86
|
+
var isLoadingIndicator: Bool {
|
87
|
+
return self.frame.size == CGSize(width: 10, height: 20)
|
88
|
+
}
|
89
|
+
}
|
90
|
+
|
87
91
|
// Please don't remove the lines below
|
88
92
|
// They are used to detect outdated configuration files
|
89
93
|
// SnapshotHelperVersion [[1.0]]
|
@@ -17,6 +17,8 @@ module Snapshot
|
|
17
17
|
case output
|
18
18
|
when /com\.apple\.CoreSimulator\.SimError/
|
19
19
|
print "The simulator failed to launch - retrying..."
|
20
|
+
when /is not configured for Running/
|
21
|
+
raise TestsFailedException.new, "Scheme is not properly configured, make sure to check out the snapshot README"
|
20
22
|
end
|
21
23
|
end
|
22
24
|
|
data/lib/snapshot/options.rb
CHANGED
@@ -60,6 +60,7 @@ module Snapshot
|
|
60
60
|
default_value: output_directory),
|
61
61
|
FastlaneCore::ConfigItem.new(key: :ios_version,
|
62
62
|
description: "By default, the latest version should be used automatically. If you want to change it, do it here",
|
63
|
+
short_option: "-i",
|
63
64
|
default_value: Snapshot::LatestIosVersion.version),
|
64
65
|
FastlaneCore::ConfigItem.new(key: :stop_after_first_error,
|
65
66
|
env_name: 'SNAPSHOT_BREAK_ON_FIRST_ERROR',
|
data/lib/snapshot/setup.rb
CHANGED
@@ -17,7 +17,7 @@ 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 ./SnapshotHelper.swift to your UI Test target".yellow
|
20
|
+
puts "1) Add the ./fastlane/SnapshotHelper.swift to your UI Test target".yellow
|
21
21
|
puts " You can move the file anywhere you want".yellow
|
22
22
|
puts "2) Call `setupSnapshot(app)` when launching your app".yellow
|
23
23
|
puts ""
|
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.6.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-01
|
11
|
+
date: 2016-02-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: fastimage
|