Files
smart-management-auto-test/Joyhub_ui_auto_test/tmp_probe_points.py
zhouqi a94eb5dbbe feat: 新增JoyHub UI自动化测试目录
1. 新增 Joyhub_ui_auto_test/ 目录:
   - tests/ - 测试用例目录
   - pages/ - 页面元素定位
   - config/ - 配置文件
   - utils/ - 工具类
   - test_data/ - 测试数据
   - reports/ - 测试报告
   - webapp-testing/ - WebApp测试相关

2. 配置文件:
   - pytest.ini - pytest配置
   - requirements.txt - 依赖列表
   - README.md - 项目说明
2026-05-13 16:01:25 +08:00

39 lines
1.3 KiB
Python
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
from playwright.sync_api import sync_playwright
base = 'https://joyhub-website-frontend-test.best-envision.com'
countries = [
'Kenya',
'Côte divoire',
'South Korea',
'Great Britain (United Kingdom; England)',
'Vatican City (The Holy See)',
'Singapore',
'Sweden',
'Poland',
'Netherlands',
'Japan',
'Italy',
'Spain',
'Germany',
'Canada',
'Australia',
'France',
]
with sync_playwright() as p:
browser = p.chromium.launch(headless=True)
page = browser.new_page(viewport={'width': 1920, 'height': 1080})
for country in countries:
try:
page.goto(base + '/points-redemption', wait_until='domcontentloaded')
page.wait_for_timeout(1500)
page.locator('header .relative.inline-block').nth(5).click(force=True)
page.wait_for_timeout(500)
page.get_by_text(country, exact=True).first.click(force=True, timeout=5000)
page.wait_for_timeout(2500)
body = page.locator('body').inner_text()
print(country, '| url=', page.url, '| redeem=', 'Redeem' in body, '| unsupported=', 'currently do not support delivery' in body, '| sample=', body[:300].replace('\n', ' | '))
except Exception as exc:
print(country, '| ERROR=', type(exc).__name__, str(exc)[:200])
browser.close()