Files
zentao-flow/tmp/pw_9130_doctab.py
T

27 lines
1.4 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.
# -*- coding: utf-8 -*-
"""9130 需求文档 tab 验证(CHG-063)"""
import io, sys
from playwright.sync_api import sync_playwright
sys.stdout = io.TextIOWrapper(sys.stdout.buffer, encoding='utf-8')
BASE = 'http://localhost:8088'
with sync_playwright() as p:
browser = p.chromium.launch(channel='chrome', headless=True, args=['--disable-gpu'])
page = browser.new_page(viewport={'width': 1500, 'height': 950})
page.goto(BASE, wait_until='domcontentloaded'); page.wait_for_timeout(2500)
if 'login' in page.url:
page.locator('input[placeholder="用户名"]').fill('admin')
page.locator('input[placeholder="密码"]').fill('123456')
page.locator('text="登录"').first.click(); page.wait_for_timeout(6000)
page.goto(f'{BASE}/#/product-story-info/9130', wait_until='domcontentloaded')
page.wait_for_timeout(6000)
# tab 存在性
tabs = page.locator('.el-tabs__item').all_inner_texts()
print('tabs:', tabs)
page.locator('.el-tabs__item:has-text("需求文档")').first.click(); page.wait_for_timeout(2000)
body = page.inner_text('body')
for t in ['测试用例/测试报告模版', '提交测试报告', '其他测试文档', '代码审查报告', '工作日志', 'AI项目文档更新记录']:
print(t, '✓' if t in body else '✗缺失')
print('左栏交付物在:', '✓' if '交付物' in body else '✗')
page.screenshot(path='tmp/pw_9130_doctab.png', full_page=False)
browser.close()