Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 62 additions & 0 deletions fastfive-auto-app-dev/pages/my_account_page.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
from selenium.webdriver.common.by import By
from .base_page import BasePage


class MyAccountPage(BasePage):
ANDROID = {
'my_account_tab': (By.XPATH, '//*[@content-desc="내 계정" or @text="내 계정"]'),
'edit_profile_btn': (By.XPATH, '//*[@content-desc="편집" or @content-desc="프로필 편집"]'),
'withdraw_btn': (By.XPATH, '//*[@text="회원 탈퇴"]'),
'withdraw_checkbox': (By.XPATH, '//*[contains(@content-desc, "회원탈퇴 유의")]'),
'confirm_btn': (By.XPATH, '//*[@text="탈퇴하기"]'),
}

IOS = {
'my_account_tab': (By.XPATH, '//XCUIElementTypeButton[contains(@label, "내 계정")]'),
'edit_profile_btn': (By.XPATH, '//XCUIElementTypeButton[contains(@label, "편집")]'),
'withdraw_btn': (By.XPATH, '//XCUIElementTypeOther[@name="회원 탈퇴"]'),
'withdraw_checkbox': (By.XPATH, '//XCUIElementTypeOther[@name="WithdrawalCheckBox"]'),
'confirm_btn': (By.XPATH, '//XCUIElementTypeOther[@name="탈퇴하기"]'),
}

def get_selector(self, key):
return self.ANDROID[key] if self.is_android() else self.IOS[key]

def go_to_my_account_tab(self):
self.click(self.get_selector('my_account_tab'))
print("내 계정 탭 클릭")
self.wait_seconds(2)

def click_edit_profile(self):
window = self.driver.get_window_size()
tap_x = int(window['width'] * 0.57)
tap_y = int(window['height'] * 0.18)
print(f"편집 버튼 탭 (x={tap_x}, y={tap_y})")
self.tap(tap_x, tap_y)
print("프로필 편집 아이콘 클릭")
self.wait_seconds(2)

def click_withdraw(self):
if self.is_ios():
# 페이지소스 기준 고정 좌표: x=327+27=354, y=776+5=781 (탭바 경계 위)
self.driver.execute_script('mobile: tap', {'x': 354, 'y': 781})
else:
self.click(self.get_selector('withdraw_btn'))
print("회원탈퇴 클릭")
self.wait_seconds(2)

def click_checkbox(self):
if self.is_android():
with open("page_source_android_checkbox2.xml", "w", encoding="utf-8") as f:
f.write(self.driver.page_source)
self.click(self.get_selector('withdraw_checkbox'))
print("체크박스 선택")
self.wait_seconds(1)

def full_withdraw_flow(self):
self.go_to_my_account_tab()
self.click_edit_profile()
self.click_withdraw()
self.click_checkbox()
print("✅ 회원탈퇴 테스트 완료")
return True