Repository navigation
fix(foresttrip-vacancy): 로그인 실패를 안내 오류로 처리 (#699) - #703
Merged
Merged
Conversation
로그인 POST가 403을 반환해도 helper는 예약 페이지로 이동한 뒤 #srchSido가 있다고 가정했다. 로그인 실패 시 그 페이지에는 로그인 폼이 남아 있어 page.evaluate의 null.options가 처리되지 않은 Playwright TypeError로 터졌다. 제출 후 로그인 폼 잔존 여부로 실패를 판별해 자격증명 확인, CAPTCHA 수동 처리, --refresh-session 재시도를 안내하는 SystemExit으로 종료한다. 예약 페이지의 #srchSido·#srchInstt 존재도 조회 전에 검증하고, CSRF 토큰 부재 메시지에도 재시도 안내를 붙인다.
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #699
원인
bootstrap_session()은 로그인 성공 여부를 확인하지 않고/rep/or/sssn/monthRsrvtSmplStatus.do로 이동한 뒤#srchSido가 존재한다고 가정했습니다. 자격증명이 틀리면 로그인 POST가 403을 반환하고 예약 페이지에는 로그인 폼만 남아,page.evaluate("...document.querySelector('#srchSido').options")가 처리되지 않은 PlaywrightTypeError: Cannot read properties of null (reading 'options')로 종료됐습니다.변경
#mmberId) 잔존 여부로 로그인 실패를 판별합니다. 실패 시KSKILL_FORESTTRIP_ID·KSKILL_FORESTTRIP_PASSWORD확인, CAPTCHA/추가 인증은 공식 화면에서 처리 안내,--refresh-session재시도를 담은SystemExit으로 종료합니다.#srchSido·#srchInstt존재를 검증하고, 누락 시 원인(세션 만료/숲나들e 표면 변경)과 재시도 안내를 출력합니다.has_element/login_failure_message/reservation_page_failure_message로 분리해 네트워크 없이 테스트합니다.검증
foresttrip-vacancy/tests/test_foresttrip_session.py신규(fake Playwright surface 6 tests): 로그인 실패 안내, 예약 DOM 누락, CSRF 부재, 숲 목록 추출 실패, 정상 세션 구성.uv run --with playwright python foresttrip-vacancy/scripts/run_foresttrip_vacancy.py --forest-name 유명산 --dates 20261010 --json --refresh-session→TypeError없이 exit 1과 함께 위 안내 메시지 출력.#mmberId존재·#srchSido부재 → 새 판별 경로와 일치.체크
npm run sync:cli-skills반영, 기존foresttrip-vacancy/tests스위트 30 tests 통과.