Skip to content

Commit 30aadcb

Browse files
FFQAHwangclaude
andcommitted
fix: 오버레이를 클릭하지 않고 JS로 DOM에서 직접 제거
- 이전 방식(클릭): 오버레이 클릭 시 새 팝업이 열리며 재등장 → 무한 루프 - 새 방식(제거): JS로 tw-bg-v2-trans-black, cursor-pointer, popupWrap 요소를 DOM에서 삭제 - CI에서 오버레이/배너로 인한 메뉴 클릭 차단 문제 해결 Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
1 parent 8d787e9 commit 30aadcb

1 file changed

Lines changed: 28 additions & 16 deletions

File tree

fastfive-web-e2e/pages/base_page.py

Lines changed: 28 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -44,24 +44,36 @@ def close_today_popup_if_exists(self):
4444
except Exception:
4545
pass
4646

47-
def dismiss_overlay_if_exists(self, max_attempts: int = 5, wait_each: int = 2000):
48-
"""전면 오버레이 팝업(tw-bg-v2-trans-black) 반복 닫기.
47+
def dismiss_overlay_if_exists(self, wait_ms: int = 2000):
48+
"""전면 오버레이/팝업 제거.
4949
50-
CI에서 로그인 후 오버레이가 지연 렌더링될 수 있으므로 재시도.
50+
배너/공지 오버레이가 클릭으로 닫히지 않고 다시 뜨는 경우가 있어
51+
JS로 DOM에서 직접 제거한다.
5152
"""
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):
54-
try:
55-
overlay = self.page.locator(overlay_selector).first
56-
overlay.wait_for(state="visible", timeout=wait_each)
57-
overlay.click(force=True)
58-
self.page.wait_for_timeout(500)
59-
print(f"[오버레이] 닫기 성공 ({attempt + 1}회)")
60-
except Exception:
61-
# 오버레이가 없으면 종료
62-
if attempt == 0:
63-
return
64-
break
53+
# 잠시 기다려 오버레이가 렌더링되도록 유도
54+
self.page.wait_for_timeout(wait_ms)
55+
56+
removed = self.page.evaluate(
57+
"""() => {
58+
let count = 0;
59+
// tw-bg-v2-trans-black 계열 딤드 배경 전부 제거
60+
document.querySelectorAll('div.tw-fixed[class*="tw-bg-v2-trans-black"]').forEach(el => {
61+
el.remove(); count++;
62+
});
63+
// 전면 fixed 오버레이(cursor-pointer) 제거
64+
document.querySelectorAll('div.tw-fixed.tw-cursor-pointer').forEach(el => {
65+
el.remove(); count++;
66+
});
67+
// 배너/팝업 컨테이너 제거
68+
document.querySelectorAll('div[class*="popupWrap"], div[class*="PopupWrap"], div[class*="bannerWrap"], div[class*="BannerWrap"]').forEach(el => {
69+
el.remove(); count++;
70+
});
71+
return count;
72+
}"""
73+
)
74+
if removed > 0:
75+
print(f"[오버레이] DOM에서 {removed}개 요소 제거")
76+
self.page.wait_for_timeout(300)
6577

6678
# ── API 응답 수집 ──
6779

0 commit comments

Comments
 (0)