-
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
61 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
51 changes: 51 additions & 0 deletions
51
app/xcode/App/VCamUIPreviewUITests/LaunchScreenshotTests.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
// | ||
// LaunchScreenshotTests.swift | ||
// VCamUIPreviewUITests | ||
// | ||
// Created by Tatsuya Tanaka on 2023/10/18. | ||
// | ||
|
||
import XCTest | ||
import VCamLocalization | ||
|
||
final class LaunchScreenshotTests: XCTestCase { | ||
|
||
override class var runsForEachTargetApplicationUIConfiguration: Bool { | ||
true | ||
} | ||
|
||
override func setUpWithError() throws { | ||
continueAfterFailure = false | ||
LocalizationEnvironment.currentLocale = { "en_US" } | ||
} | ||
|
||
func testLaunch() throws { | ||
let app = XCUIApplication() | ||
app.launch() | ||
|
||
XCTContext.runActivity(named: "Launch Screen") { activity in | ||
add(.keepAlways(screenshot: app.screenshot(), activity: activity)) | ||
} | ||
|
||
XCTContext.runActivity(named: "\(L10n.recording.text) Screen") { activity in | ||
app.buttons[L10n.recording.text].click() | ||
_ = app.staticTexts[L10n.whiteBalance.text].waitForExistence(timeout: 5) | ||
add(.keepAlways(screenshot: app.screenshot(), activity: activity)) | ||
} | ||
|
||
XCTContext.runActivity(named: "\(L10n.screenEffect.text) Screen") { activity in | ||
app.buttons[L10n.screenEffect.text].click() | ||
_ = app.staticTexts[L10n.startRecording.text].waitForExistence(timeout: 5) | ||
add(.keepAlways(screenshot: app.screenshot(), activity: activity)) | ||
} | ||
} | ||
} | ||
|
||
private extension XCTAttachment { | ||
static func keepAlways(screenshot: XCUIScreenshot, activity: XCTActivity) -> XCTAttachment { | ||
let attachment = XCTAttachment(screenshot: screenshot) | ||
attachment.name = activity.name | ||
attachment.lifetime = .keepAlways | ||
return attachment | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 0 additions & 29 deletions
29
app/xcode/App/VCamUIPreviewUITests/VCamUIPreviewUITestsLaunchTests.swift
This file was deleted.
Oops, something went wrong.