Skip to content

Conversation

@sunjae0902
Copy link
Collaborator

@sunjae0902 sunjae0902 commented Feb 3, 2026

연관된 이슈

작업 내용 및 고민 내용

스킬 업그레이드 버그 수정

  • 최고 레벨이 도달했음에도 여전히 구매 가격 버튼이 활성화되는 문제가 존재했습니다.
  • canUpgrade 로직을 추가하고, ItemState에 reachedMax 상태를 추가했습니다.
  • 최종 단계일 경우 가격 버튼은 구매불가 / 잠금 상태와 동일하게 비활성화되고, Max로 표시됩니다.

UITest

  • 해당 버그의 경우 개발자가 직접 100, 1000번의 버튼을 눌러보며 확인하면 번거롭기 때문에 UITest를 활용해볼 수 있다고 생각했습니다.

  • 테스트 구현 과정

    • 참고문서

    • Xcode에서 UI Testing Bundle을 추가하고, 빈 메서드를 생성합니다.

    • 테스트 타깃으로 스킴을 설정한 뒤 Xcode Editor > Start Recording UI Test를 클릭합니다.

    • 앱이 실행되면 화면 터치가 녹화되고, 자동으로 테스트가 상호작용하는 앱 내 요소를 찾아서 메서드에 기록해줍니다. 직접 요소 쿼리를 작성할 수는 있지만, UI 프레임워크의 요소 계층 구조에 익숙하지 않아 많은 시간이 소요되어 해당 방법을 사용했습니다.

    • 앱 실행 -> 스킬 탭 -> 최고레벨까지 업그레이드 플로우 녹화 후 자동 생성 결과

    스크린샷 2026-02-03 오후 3 04 31
  • 위 코드를 직접 정리하여 최종적으로 현재 상태의 테스트 코드를 작성했습니다.

장비 업그레이드 버그 수정

  • 최고 레벨이 도달했음에도 여전히 강화 버튼이 활성화되는 문제가 존재했습니다.
  • DisplayItem을 받아서 ItemState를 생성하는 생성자를 수정하여 reachedMax 상태 분기 처리 로직을 추가했습니다.
  • 또한 최고 레벨에서도 현재 초당 골드 획득량을 보여주어야 한다고 판단하여 기존의 descriotion을 "최고 단계" -> "초당 골드 획득량: ~"으로 수정했습니다.

Unit Test (오류 해결중)

  • 해당 개선 사항은 swift Testing의 파라메터라이징 테스트 기능을 사용해 국보급 장비 / 미만 장비에서 ItemState를 판별하는 로직을 검증하려고 했습니다.
  • Undefined Symbol ~ 오류를 해결하지 못해서 아직 테스트 결과는 확인하지 못했습니다 ㅠㅠ
  • 하지만 눈으로는 확인했습니다...

스크린샷

  • 편의를 위해 임시로 policy를 수정한 상태로 촬영했습니다!

  • uitest 결과
    Simulator Screen Recording - Clone 1 of iPhone 16 Pro - 2026-02-03 at 15 34 27\

  • 장비 최고 단계 도달시 표시 모습

Simulator Screenshot - iPhone 16 Pro - 2026-02-03 at 13 33 49

리뷰 요구사항

  • 변경 후 상태가 적절한지

@sunjae0902 sunjae0902 self-assigned this Feb 3, 2026
@sunjae0902 sunjae0902 added Bug 버그 발생 Fix 버그 수정 작업 Test 테스트 코드 작성 labels Feb 3, 2026
@sunjae0902 sunjae0902 requested review from dongglehada, snughnu and tomchoi95 and removed request for dongglehada and snughnu February 3, 2026 08:38
Copy link
Collaborator

@tomchoi95 tomchoi95 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

고생 많으셨어요 소피!! 👍 👍

UI테스트 돌려봤는데 신기하네요!

Copy link
Collaborator

@dongglehada dongglehada left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

수고 많으셨습니다 :>
UI테스트 신기하네요 👀

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

오 확실히 최종단계 보다는 이게 더 좋은 것 같아요

init(canUnlock: Bool, canAfford: Bool) {
if !canUnlock {
init(canUpgrade: Bool, canUnlock: Bool, canAfford: Bool) {
switch (canUpgrade, canUnlock, canAfford) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

switch 를 이렇게도 쓸 수 있군요

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

저도 처음 써보는 것 같네요 👀

app.tap()
app.buttons["스킬"].tap()

let element = app.images.matching(identifier: "icon_coin_bag").element(
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

이미지로 매칭하는거 신기하네요

Copy link
Collaborator

@snughnu snughnu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

수고하셨습니다 소피 💃

@snughnu snughnu merged commit b850e7f into dev Feb 3, 2026
1 check passed
@snughnu snughnu deleted the fix/#257-max-item-state branch February 3, 2026 11:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bug 버그 발생 Fix 버그 수정 작업 Test 테스트 코드 작성

Projects

None yet

Development

Successfully merging this pull request may close these issues.

최종 단계 관련 버그를 수정합니다.

4 participants