Skip to content

Commit 266a9a3

Browse files
committed
[#234] fastlane으로 iPhone 16 Pro 스크린샷 촬영
1 parent 0d072cc commit 266a9a3

File tree

3 files changed

+53
-28
lines changed

3 files changed

+53
-28
lines changed

EATSSU/Tests/UITests/SampleTests.swift

-26
This file was deleted.
+51
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
//
2+
// SnapShotTests.swift
3+
// UITests
4+
//
5+
// Created by Jiwoong CHOI on 9/14/24.
6+
//
7+
8+
import XCTest
9+
10+
final class SnapShotTests: XCTestCase {
11+
var app: XCUIApplication!
12+
13+
@MainActor
14+
override func setUpWithError() throws {
15+
continueAfterFailure = false
16+
app = XCUIApplication()
17+
setupSnapshot(app) // fastlane snapshot 초기화
18+
app.launch()
19+
}
20+
21+
override func tearDownWithError() throws {}
22+
23+
/// 탭바의 각 화면에서 스크린샷을 촬영하는 테스트 예시입니다.
24+
/// 로그인이 되어있어야하고, 학과 역시 입력되어 있어야 합니다.
25+
@MainActor
26+
func testTabBarScreenshots() {
27+
// 1. "학식" 탭 선택 및 스크린샷 촬영
28+
let mealButton = app.tabBars.buttons["학식"]
29+
mealButton.tap()
30+
let mealPredicate = NSPredicate(format: "isSelected == true")
31+
expectation(for: mealPredicate, evaluatedWith: mealButton, handler: nil)
32+
waitForExpectations(timeout: 5, handler: nil)
33+
snapshot("01_Restaurant")
34+
35+
// 2. "지도" 탭 선택 및 스크린샷 촬영
36+
let mapButton = app.tabBars.buttons["지도"]
37+
mapButton.tap()
38+
let mapPredicate = NSPredicate(format: "isSelected == true")
39+
expectation(for: mapPredicate, evaluatedWith: mapButton, handler: nil)
40+
waitForExpectations(timeout: 5, handler: nil)
41+
snapshot("02_Map")
42+
43+
// 3. "마이" 탭 선택 및 스크린샷 촬영
44+
let myButton = app.tabBars.buttons["마이"]
45+
myButton.tap()
46+
let myPredicate = NSPredicate(format: "isSelected == true")
47+
expectation(for: myPredicate, evaluatedWith: myButton, handler: nil)
48+
waitForExpectations(timeout: 5, handler: nil)
49+
snapshot("03_MyPage")
50+
}
51+
}

Snapfile

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22

33
# A list of devices you want to take the screenshots from
44
devices([
5-
"iPhone 16 Pro",
5+
"iPhone 16 Pro"
66
# "iPhone 16 Pro Max",
77
# "iPhone 16",
88
# "iPhone 16 Plus",
9-
"iPhone SE (3rd generation)"
9+
# "iPhone SE (3rd generation)"
1010
# "iPhone 8",
1111
# "iPhone 8 Plus",
1212
# "iPhone SE",

0 commit comments

Comments
 (0)