Skip to content

Commit

Permalink
✨ generating screenshots in both EN and SK
Browse files Browse the repository at this point in the history
  • Loading branch information
igorkulman committed Oct 3, 2018
1 parent 69e9c7c commit aec679f
Show file tree
Hide file tree
Showing 12 changed files with 41 additions and 9 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ Sample iOS app written the way I write iOS apps because I cannot share the app I
* Using (multiple) Storyboards just as glorified XIBs
* Using static UITableView cells in a typed way with enums
* Image literals
* Automated AppStore screenshots taking (using [Fastlane](https://fastlane.tools/))
* Automated AppStore screenshots taking in multiple languages (using [Fastlane](https://fastlane.tools/))

### Requirements

Expand Down
1 change: 1 addition & 0 deletions fastlane/Snapfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

languages([
"en-US",
"sk-SK"
])

# The name of the scheme which contains the UI Tests
Expand Down
12 changes: 6 additions & 6 deletions fastlane/SnapshotHelper.swift
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ open class Snapshot: NSObject {
}

open class func setupSnapshot(_ app: XCUIApplication) {

Snapshot.app = app

do {
Expand All @@ -88,7 +88,7 @@ open class Snapshot: NSObject {
print("CacheDirectory is not set - probably running on a physical device?")
return
}

let path = cacheDirectory.appendingPathComponent("language.txt")

do {
Expand All @@ -105,7 +105,7 @@ open class Snapshot: NSObject {
print("CacheDirectory is not set - probably running on a physical device?")
return
}

let path = cacheDirectory.appendingPathComponent("locale.txt")

do {
Expand All @@ -125,7 +125,7 @@ open class Snapshot: NSObject {
print("CacheDirectory is not set - probably running on a physical device?")
return
}

let path = cacheDirectory.appendingPathComponent("snapshot-launch_arguments.txt")
app.launchArguments += ["-FASTLANE_SNAPSHOT", "YES", "-ui_testing"]

Expand Down Expand Up @@ -154,12 +154,12 @@ open class Snapshot: NSObject {
#if os(OSX)
XCUIApplication().typeKey(XCUIKeyboardKeySecondaryFn, modifierFlags: [])
#else

guard let app = self.app else {
print("XCUIApplication is not set. Please call setupSnapshot(app) before snapshot().")
return
}

let window = app.windows.firstMatch
let screenshot = window.screenshot()
guard let simulator = ProcessInfo().environment["SIMULATOR_DEVICE_NAME"], let screenshotsDir = screenshotsDirectory else { return }
Expand Down
Binary file modified fastlane/screenshots/en-US/iPhone 7 Plus-1-Setup.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified fastlane/screenshots/en-US/iPhone 7 Plus-2-List.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified fastlane/screenshots/en-US/iPhone 7 Plus-3-Detail.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified fastlane/screenshots/en-US/iPhone 7 Plus-4-About.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
35 changes: 33 additions & 2 deletions fastlane/screenshots/screenshots.html
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,12 @@
</style>
</head>
<body>
<h1 class="language">en-US</h1>
<h1 id="en-US" class="language">en-US</h1>
<hr>
<table>
<tr>
<th colspan="4">
<span class="deviceName">iPhone 7 Plus (5.5-Inch)</span>
<a id="en-US-iPhone 7 Plus (5.5-Inch)" class="deviceName" href="#en-US-iPhone 7 Plus (5.5-Inch)">iPhone 7 Plus (5.5-Inch)</a>
</th>
</tr>
<tr>
Expand All @@ -96,6 +96,37 @@ <h1 class="language">en-US</h1>
</td>
</tr>
</table>
<h1 id="sk-SK" class="language">sk-SK</h1>
<hr>
<table>
<tr>
<th colspan="4">
<a id="sk-SK-iPhone 7 Plus (5.5-Inch)" class="deviceName" href="#sk-SK-iPhone 7 Plus (5.5-Inch)">iPhone 7 Plus (5.5-Inch)</a>
</th>
</tr>
<tr>
<td>
<a href="./sk-SK/iPhone 7 Plus-1-Setup.png" target="_blank" class="screenshotLink">
<img class="screenshot" src="./sk-SK/iPhone 7 Plus-1-Setup.png" style="width: 100%;" alt="sk-SK iPhone 7 Plus (5.5-Inch)" data-counter="5">
</a>
</td>
<td>
<a href="./sk-SK/iPhone 7 Plus-2-List.png" target="_blank" class="screenshotLink">
<img class="screenshot" src="./sk-SK/iPhone 7 Plus-2-List.png" style="width: 100%;" alt="sk-SK iPhone 7 Plus (5.5-Inch)" data-counter="6">
</a>
</td>
<td>
<a href="./sk-SK/iPhone 7 Plus-3-Detail.png" target="_blank" class="screenshotLink">
<img class="screenshot" src="./sk-SK/iPhone 7 Plus-3-Detail.png" style="width: 100%;" alt="sk-SK iPhone 7 Plus (5.5-Inch)" data-counter="7">
</a>
</td>
<td>
<a href="./sk-SK/iPhone 7 Plus-4-About.png" target="_blank" class="screenshotLink">
<img class="screenshot" src="./sk-SK/iPhone 7 Plus-4-About.png" style="width: 100%;" alt="sk-SK iPhone 7 Plus (5.5-Inch)" data-counter="8">
</a>
</td>
</tr>
</table>
<div id="overlay">
<img id="imageDisplay" src="" alt="" />
<div id="imageInfo"></div>
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit aec679f

Please sign in to comment.