Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | 6 | 7 |
8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 | 16 | 17 | 18 | 19 | 20 | 21 |
22 | 23 | 24 | 25 | 26 | 27 | 28 |
29 | 30 |
Tags
- HealthKit
- layoutSubviews
- HIG
- authentication
- YGEnums.h
- rc
- garbage collection
- pagination
- Automatic Reference Count
- Tuist-Action
- fetchSignInMethods
- arc
- Nan
- content-type
- Tuist
- FlexLayout
- ios
- Firebase
- human interface guidelines
- Xcode
- AppStore
- SPM
- retain cycle
- App Connect
- 회고
- Github-Action
- Swift
- alamofire
- UITest
- playground
Archives
- Today
- Total
멋있게걷는방법
[UITest] password textFiled 에 tap 이 안 될 때? 본문
이걸로 하루의 절반을 날렸습니다..
private let inputPasswordTextField = UITextField().then {
$0.accessibilityIdentifier = "inputPasswordTextField"
$0.placeholder = "비밀번호"
$0.layer.borderColor = UIColor.clear.cgColor
$0.layer.borderWidth = 1
$0.setPlaceholder(color: UIColor.gray)
$0.layer.cornerRadius = 8
$0.isSecureTextEntry = true
$0.backgroundColor = .blue
}
현재 제 passwordTextField 는 이렇습니다.
이를 바탕으로 UITest 를 시도했습니다.
override func setUpWithError() throws {
// Put setup code here. This method is called before the invocation of each test method in the class.
// In UI tests it is usually best to stop immediately when a failure occurs.
continueAfterFailure = false
app = XCUIApplication()
app.launch()
skipButton = app.buttons["Skip"]
emailTF = app.textFields["inputEmailTextField"]
passwordTF = app.textFields["inputPasswordTextField"]
signInButton = app.buttons["signInButton"]
}
func testSignInViewController_notRegistedUser_isVisibleWarningLabel() {
skipButton.tap()
emailTF.tap()
emailTF.typeText("asdf123@naver.com")
app.tap()
passwordTF.tap()
passwordTF.typeText("12345678")
XCTAssertEqual(signInButton.isEnabled, true)
}
하지만 이러한 에러를 마주했습니다ㅠㅠ..
이유는..
inputPasswordTextField 의 isSecureTextEntry 가 True 이기 때문입니다.
해결 방법은
passwordTF = app.secureTextFields["inputPasswordTextField"]
이렇게 isSecureTextEntry 가 True 라면 secureTextFields 로 설정해주면 에러를 해결할 수 있습니다.
이런걸로 삽질했다는게 너무 허무하네요..
'iOS' 카테고리의 다른 글
[Swift] 지금 바로 Pagination 을 적용해야 하는 이유 (0) | 2023.06.08 |
---|---|
[Swift] firebase - 이메일 중복 검사 (0) | 2023.04.12 |
[Swift] Alamofire 를 쓴다면 꼭 알아야 하는 내용 (0) | 2023.03.23 |
[Swift] HealthKit 설정과 데이터 요청 (distanceWalkingRunning, activeEnergyBurned, appleExerciseTime) (0) | 2023.03.07 |
[Swift] 값이 NaN 으로 변한다구요? (0) | 2023.01.09 |