Skip to content

Commit

Permalink
Merge pull request #13 from skysea04/dev
Browse files Browse the repository at this point in the history
FIX: Fix resp check
  • Loading branch information
skysea04 authored Mar 5, 2024
2 parents 5cb10dc + b986a33 commit 8aa36f7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/booking/constants/page_htmls.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,10 @@ class CompleteBookingPage:
class ErrorPage:
ERROR_FEEDBACK = {'class': 'feedbackPanelERROR'}
ERROR_MESSAGE = {'text': '抱歉,無法繼續提供您訂票的服務,可能發生原因及解決方法如下:'}
ERROR_MESSAGE_SYSTEM_BUSY = {'text': '系統忙碌中,請耐心等候,並請勿使用「重新整理」鍵或離開本頁面。'}
ERROR_CONTENT = {'class': 'error-content'}

ERROR_SECURITY_CODE = '檢測碼輸入錯誤,請確認後重新輸入,謝謝!'
ERROR_NO_TRAIN = '去程查無可售車次或選購的車票已售完,請重新輸入訂票條件。'

def server_busy(tag):
return tag.name == 'p' and '系統忙碌中,請耐心等候,並請勿使用「重新整理」鍵或離開本頁面。' in tag.text
2 changes: 1 addition & 1 deletion src/booking/services.py
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ def check_resp_ok(page: Tag) -> Tuple[bool, Optional[str]]:
if error_msg:
return False, 'ERROR__THSR_SYSTEM_DENY'

error_msg = page.find(**ErrorPage.ERROR_MESSAGE_SYSTEM_BUSY)
error_msg = page.find(ErrorPage.server_busy)
if error_msg:
return False, '系統忙碌中,請耐心等候,並請勿使用「重新整理」鍵或離開本頁面。'

Expand Down

0 comments on commit 8aa36f7

Please sign in to comment.