Skip to content

fix(foresttrip-vacancy): 로그인 실패를 안내 오류로 처리 (#699) - #703

Merged
vkehfdl1 merged 1 commit into
devfrom
fix/699-foresttrip-login-failure
Oct 6, 2026
Merged

vkehfdl1 merged 1 commit into
devfrom
fix/699-foresttrip-login-failure

Conversation

@vkehfdl1

@vkehfdl1 vkehfdl1 commented Oct 6, 2026

Copy link
Copy Markdown
Member

Fixes #699

원인

bootstrap_session()은 로그인 성공 여부를 확인하지 않고 /rep/or/sssn/monthRsrvtSmplStatus.do로 이동한 뒤 #srchSido가 존재한다고 가정했습니다. 자격증명이 틀리면 로그인 POST가 403을 반환하고 예약 페이지에는 로그인 폼만 남아, page.evaluate("...document.querySelector('#srchSido').options")가 처리되지 않은 Playwright TypeError: Cannot read properties of null (reading 'options')로 종료됐습니다.

변경

  • 제출 후 로그인 폼(#mmberId) 잔존 여부로 로그인 실패를 판별합니다. 실패 시 KSKILL_FORESTTRIP_ID·KSKILL_FORESTTRIP_PASSWORD 확인, CAPTCHA/추가 인증은 공식 화면에서 처리 안내, --refresh-session 재시도를 담은 SystemExit으로 종료합니다.
  • 조회 전에 예약 페이지의 #srchSido·#srchInstt 존재를 검증하고, 누락 시 원인(세션 만료/숲나들e 표면 변경)과 재시도 안내를 출력합니다.
  • CSRF 토큰 부재 메시지에도 재시도 안내를 추가합니다.
  • 판별 로직을 has_element/login_failure_message/reservation_page_failure_message로 분리해 네트워크 없이 테스트합니다.

검증

  • foresttrip-vacancy/tests/test_foresttrip_session.py 신규(fake Playwright surface 6 tests): 로그인 실패 안내, 예약 DOM 누락, CSRF 부재, 숲 목록 추출 실패, 정상 세션 구성.
  • live QA(placeholder 자격증명): uv run --with playwright python foresttrip-vacancy/scripts/run_foresttrip_vacancy.py --forest-name 유명산 --dates 20261010 --json --refresh-session → TypeError 없이 exit 1과 함께 위 안내 메시지 출력.
  • 실제 숲나들e DOM 확인: 실패 시 URL은 예약 페이지지만 #mmberId 존재·#srchSido 부재 → 새 판별 경로와 일치.
  • 예약·결제·CAPTCHA 우회는 수행하지 않았습니다.

체크

  • npm run sync:cli-skills 반영, 기존 foresttrip-vacancy/tests 스위트 30 tests 통과.

로그인 POST가 403을 반환해도 helper는 예약 페이지로 이동한 뒤
#srchSido가 있다고 가정했다. 로그인 실패 시 그 페이지에는 로그인 폼이
남아 있어 page.evaluate의 null.options가 처리되지 않은 Playwright
TypeError로 터졌다.

제출 후 로그인 폼 잔존 여부로 실패를 판별해 자격증명 확인, CAPTCHA
수동 처리, --refresh-session 재시도를 안내하는 SystemExit으로 종료한다.
예약 페이지의 #srchSido·#srchInstt 존재도 조회 전에 검증하고, CSRF
토큰 부재 메시지에도 재시도 안내를 붙인다.
@vkehfdl1
vkehfdl1 merged commit ed8d55e into dev Oct 6, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant