snapshot 1.0.4 → 1.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +16 -16
- data/lib/assets/SnapshotHelper.swift +39 -24
- data/lib/snapshot/test_command_generator.rb +1 -0
- 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: 151fb2b63c45fbd4f2a3b504b54ed939100e5077
|
4
|
+
data.tar.gz: 51dc88520b4b87f6e47b40fd8dc38388e309407c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b079c02208bde8f19e36852913b28d3358e9c1b225aaf04aa20c10ef27bd85c8cac8e46bcd19d02a9b6ca7437aa87491ff58cafc18be780f9c0d6a43a69e1e9a
|
7
|
+
data.tar.gz: e4c04be3a68e162cd46426671cded11335db414cd3c8fc05748b166a29815921abe361e781eef0004513afb9c0ab4ce48a6c3e997ee58526b03664bce67b8bed
|
data/README.md
CHANGED
@@ -1,18 +1,18 @@
|
|
1
1
|
<h3 align="center">
|
2
|
-
<a href="https://github.com/
|
2
|
+
<a href="https://github.com/fastlane/fastlane">
|
3
3
|
<img src="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/
|
9
|
+
<a href="https://github.com/fastlane/deliver">deliver</a> •
|
10
10
|
<b>snapshot</b> •
|
11
|
-
<a href="https://github.com/
|
12
|
-
<a href="https://github.com/
|
13
|
-
<a href="https://github.com/
|
14
|
-
<a href="https://github.com/
|
15
|
-
<a href="https://github.com/
|
11
|
+
<a href="https://github.com/fastlane/frameit">frameit</a> •
|
12
|
+
<a href="https://github.com/fastlane/PEM">PEM</a> •
|
13
|
+
<a href="https://github.com/fastlane/sigh">sigh</a> •
|
14
|
+
<a href="https://github.com/fastlane/produce">produce</a> •
|
15
|
+
<a href="https://github.com/fastlane/cert">cert</a> •
|
16
16
|
<a href="https://github.com/fastlane/spaceship">spaceship</a> •
|
17
17
|
<a href="https://github.com/fastlane/pilot">pilot</a> •
|
18
18
|
<a href="https://github.com/fastlane/boarding">boarding</a> •
|
@@ -29,7 +29,7 @@ snapshot
|
|
29
29
|
============
|
30
30
|
|
31
31
|
[![Twitter: @KauseFx](https://img.shields.io/badge/contact-@KrauseFx-blue.svg?style=flat)](https://twitter.com/KrauseFx)
|
32
|
-
[![License](
|
32
|
+
[![License](https://img.shields.io/badge/license-MIT-green.svg?style=flat)](https://github.com/fastlane/snapshot/blob/master/LICENSE)
|
33
33
|
[![Gem](https://img.shields.io/gem/v/snapshot.svg?style=flat)](http://rubygems.org/gems/snapshot)
|
34
34
|
|
35
35
|
###### Automate taking localized screenshots of your iOS app on every device
|
@@ -42,7 +42,7 @@ It's hard to get everything right!
|
|
42
42
|
- No loading indicators
|
43
43
|
- Same content / screens
|
44
44
|
- [Clean Status Bar](#use-a-clean-status-bar)
|
45
|
-
- Uploading screenshots ([`deliver`](https://github.com/
|
45
|
+
- Uploading screenshots ([`deliver`](https://github.com/fastlane/deliver) is your friend)
|
46
46
|
|
47
47
|
More information about [creating perfect screenshots](https://krausefx.com/blog/creating-perfect-app-store-screenshots-of-your-ios-app).
|
48
48
|
|
@@ -86,7 +86,7 @@ Please check out the [MigrationGuide to 1.0](/MigrationGuide.md) :+1:
|
|
86
86
|
- Create hundreds of screenshots in multiple languages on all simulators
|
87
87
|
- Configure it once, store the configuration in git
|
88
88
|
- Do something else, while the computer takes the screenshots for you
|
89
|
-
- Integrates with [`fastlane`](https://fastlane.tools) and [`deliver`](https://github.com/
|
89
|
+
- Integrates with [`fastlane`](https://fastlane.tools) and [`deliver`](https://github.com/fastlane/deliver)
|
90
90
|
- Generates a beautiful web page, which shows all screenshots on all devices. This is perfect to send to Q&A or the marketing team
|
91
91
|
- `snapshot` automatically waits for network requests to be finished before taking a screenshot (we don't want loading images in the App Store screenshots)
|
92
92
|
|
@@ -258,12 +258,12 @@ Also, feel free to duplicate radar [23062925](https://openradar.appspot.com/rada
|
|
258
258
|
## [`fastlane`](https://fastlane.tools) Toolchain
|
259
259
|
|
260
260
|
- [`fastlane`](https://fastlane.tools): Connect all deployment tools into one streamlined workflow
|
261
|
-
- [`deliver`](https://github.com/
|
262
|
-
- [`frameit`](https://github.com/
|
263
|
-
- [`PEM`](https://github.com/
|
264
|
-
- [`sigh`](https://github.com/
|
265
|
-
- [`produce`](https://github.com/
|
266
|
-
- [`cert`](https://github.com/
|
261
|
+
- [`deliver`](https://github.com/fastlane/deliver): Upload screenshots, metadata and your app to the App Store
|
262
|
+
- [`frameit`](https://github.com/fastlane/frameit): Quickly put your screenshots into the right device frames
|
263
|
+
- [`PEM`](https://github.com/fastlane/pem): Automatically generate and renew your push notification profiles
|
264
|
+
- [`sigh`](https://github.com/fastlane/sigh): Because you would rather spend your time building stuff than fighting provisioning
|
265
|
+
- [`produce`](https://github.com/fastlane/produce): Create new iOS apps on iTunes Connect and Dev Portal using the command line
|
266
|
+
- [`cert`](https://github.com/fastlane/cert): Automatically create and maintain iOS code signing certificates
|
267
267
|
- [`spaceship`](https://github.com/fastlane/spaceship): Ruby library to access the Apple Dev Center and iTunes Connect
|
268
268
|
- [`pilot`](https://github.com/fastlane/pilot): The best way to manage your TestFlight testers and builds from your terminal
|
269
269
|
- [`boarding`](https://github.com/fastlane/boarding): The easiest way to invite your TestFlight beta testers
|
@@ -13,38 +13,53 @@ var deviceLanguage = ""
|
|
13
13
|
|
14
14
|
func setLanguage(app: XCUIApplication)
|
15
15
|
{
|
16
|
-
|
17
|
-
|
18
|
-
do {
|
19
|
-
let locale = try NSString(contentsOfFile: path, encoding: NSUTF8StringEncoding) as String
|
20
|
-
deviceLanguage = locale
|
21
|
-
app.launchArguments = ["-AppleLanguages", "(\(locale))", "-AppleLocale", "\"\(locale)\"","-ui_testing"]
|
22
|
-
} catch {
|
23
|
-
print("Couldn't detect/set language...")
|
24
|
-
}
|
16
|
+
Snapshot.setLanguage(app)
|
25
17
|
}
|
26
18
|
|
27
19
|
func snapshot(name: String, waitForLoadingIndicator: Bool = true)
|
28
20
|
{
|
29
|
-
|
30
|
-
{
|
31
|
-
waitForLoadingIndicatorToDisappear()
|
32
|
-
}
|
33
|
-
print("snapshot: \(name)") // more information about this, check out https://github.com/krausefx/snapshot
|
34
|
-
|
35
|
-
let view = XCUIApplication()
|
36
|
-
let start = view.coordinateWithNormalizedOffset(CGVectorMake(32.10, 30000))
|
37
|
-
let finish = view.coordinateWithNormalizedOffset(CGVectorMake(31, 30000))
|
38
|
-
start.pressForDuration(0, thenDragToCoordinate: finish)
|
39
|
-
sleep(1)
|
21
|
+
Snapshot.snapshot(name, waitForLoadingIndicator: waitForLoadingIndicator)
|
40
22
|
}
|
41
23
|
|
42
|
-
|
24
|
+
|
25
|
+
|
26
|
+
@objc class Snapshot: NSObject
|
43
27
|
{
|
44
|
-
|
28
|
+
class func setLanguage(app: XCUIApplication)
|
29
|
+
{
|
30
|
+
let path = "/tmp/language.txt"
|
31
|
+
|
32
|
+
do {
|
33
|
+
let locale = try NSString(contentsOfFile: path, encoding: NSUTF8StringEncoding) as String
|
34
|
+
deviceLanguage = locale
|
35
|
+
app.launchArguments = ["-AppleLanguages", "(\(locale))", "-AppleLocale", "\"\(locale)\"","-ui_testing"]
|
36
|
+
} catch {
|
37
|
+
print("Couldn't detect/set language...")
|
38
|
+
}
|
39
|
+
}
|
45
40
|
|
46
|
-
|
41
|
+
class func snapshot(name: String, waitForLoadingIndicator: Bool = false)
|
42
|
+
{
|
43
|
+
if (waitForLoadingIndicator)
|
44
|
+
{
|
45
|
+
waitForLoadingIndicatorToDisappear()
|
46
|
+
}
|
47
|
+
print("snapshot: \(name)") // more information about this, check out https://github.com/krausefx/snapshot
|
48
|
+
|
49
|
+
let view = XCUIApplication()
|
50
|
+
let start = view.coordinateWithNormalizedOffset(CGVectorMake(32.10, 30000))
|
51
|
+
let finish = view.coordinateWithNormalizedOffset(CGVectorMake(31, 30000))
|
52
|
+
start.pressForDuration(0, thenDragToCoordinate: finish)
|
47
53
|
sleep(1)
|
48
|
-
|
54
|
+
}
|
55
|
+
|
56
|
+
class func waitForLoadingIndicatorToDisappear()
|
57
|
+
{
|
58
|
+
let query = XCUIApplication().statusBars.childrenMatchingType(.Other).elementBoundByIndex(1).childrenMatchingType(.Other)
|
59
|
+
|
60
|
+
while (query.count > 4) {
|
61
|
+
sleep(1)
|
62
|
+
print("Number of Elements in Status Bar: \(query.count)... waiting for status bar to disappear")
|
63
|
+
}
|
49
64
|
}
|
50
65
|
}
|
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.0.5
|
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-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: fastimage
|