File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -44,15 +44,23 @@ def close_today_popup_if_exists(self):
4444 except Exception :
4545 pass
4646
47- def dismiss_overlay_if_exists (self , max_attempts : int = 3 ):
48- """전면 오버레이 팝업(tw-bg-v2-trans-black) 반복 닫기"""
49- for _ in range (max_attempts ):
47+ def dismiss_overlay_if_exists (self , max_attempts : int = 5 , wait_each : int = 2000 ):
48+ """전면 오버레이 팝업(tw-bg-v2-trans-black) 반복 닫기.
49+
50+ CI에서 로그인 후 오버레이가 지연 렌더링될 수 있으므로 재시도.
51+ """
52+ overlay_selector = "div.tw-fixed.tw-cursor-pointer.tw-bg-v2-trans-black-70, div.tw-fixed.tw-cursor-pointer"
53+ for attempt in range (max_attempts ):
5054 try :
51- overlay = self .page .locator ("div.tw-fixed.tw-cursor-pointer" )
52- overlay .wait_for (state = "visible" , timeout = 2000 )
53- overlay .click ()
55+ overlay = self .page .locator (overlay_selector ). first
56+ overlay .wait_for (state = "visible" , timeout = wait_each )
57+ overlay .click (force = True )
5458 self .page .wait_for_timeout (500 )
59+ print (f"[오버레이] 닫기 성공 ({ attempt + 1 } 회)" )
5560 except Exception :
61+ # 오버레이가 없으면 종료
62+ if attempt == 0 :
63+ return
5664 break
5765
5866 # ── API 응답 수집 ──
Original file line number Diff line number Diff line change @@ -10,15 +10,7 @@ def __init__(self, page: Page):
1010
1111 def goto_community (self ):
1212 """커뮤니티 메뉴 클릭"""
13- # 전면 오버레이 팝업 닫기
14- try :
15- overlay = self .page .locator ("div.tw-fixed.tw-cursor-pointer" )
16- overlay .wait_for (state = "visible" , timeout = 3000 )
17- overlay .click ()
18- self .page .wait_for_timeout (500 )
19- except Exception :
20- pass
21-
13+ self .dismiss_overlay_if_exists ()
2214 self .page .locator ('a[href="/community"]' ).first .click ()
2315 self .page .locator ("div[class*='FeedPreview_container']" ).first .wait_for (
2416 state = "visible" , timeout = 10_000
@@ -50,6 +42,7 @@ def click_first_feed(self):
5042
5143 def goto_benefits (self ):
5244 """제휴 혜택 메뉴 클릭"""
45+ self .dismiss_overlay_if_exists ()
5346 self .page .locator ('a[href="/benefits"]' ).first .click ()
5447 self .page .locator ("#app > div:first-child > div:nth-child(3)" ).wait_for (
5548 state = "visible" , timeout = 10_000
Original file line number Diff line number Diff line change @@ -10,15 +10,7 @@ def __init__(self, page: Page):
1010
1111 def goto_request (self ):
1212 """1:1 문의하기 버튼 클릭"""
13- # 전면 오버레이 팝업 닫기
14- try :
15- overlay = self .page .locator ("div.tw-fixed.tw-cursor-pointer" )
16- overlay .wait_for (state = "visible" , timeout = 3000 )
17- overlay .click ()
18- self .page .wait_for_timeout (500 )
19- except Exception :
20- pass
21-
13+ self .dismiss_overlay_if_exists ()
2214 btn = self .page .locator ("button" , has_text = "1:1 문의하기" )
2315 btn .scroll_into_view_if_needed ()
2416 btn .click ()
Original file line number Diff line number Diff line change @@ -29,15 +29,7 @@ def _dismiss_confirm_popups(self, max_attempts: int = 5):
2929
3030 def goto_reservation (self ):
3131 """예약하기 메뉴 클릭"""
32- # 전면 오버레이 팝업 닫기 (배너/공지 등)
33- try :
34- overlay = self .page .locator ("div.tw-fixed.tw-cursor-pointer" )
35- overlay .wait_for (state = "visible" , timeout = 3000 )
36- overlay .click ()
37- self .page .wait_for_timeout (500 )
38- except Exception :
39- pass
40-
32+ self .dismiss_overlay_if_exists ()
4133 menu_btn = self .page .locator (
4234 '#app >> div >> a:has(span)' , has_text = "예약"
4335 ).first
You can’t perform that action at this time.
0 commit comments