- CLI + Web 双平台,基于 LLM 的 TDD+DDD 自动化测试生成 - 集成 unified-test-platform 903 个 D-Cloud 用例 + 13 个 Robogo 场景 - Agent 5 步流水线: 扫描 -> DDD -> LLM 生成测试 - 精确回归 + UI 变更检查 - 可视化 HTML 测试报告 - 暗色/亮色主题切换 - 19 个 API 端点 + 6 个 SPA 页面 - 15/15 项 TDD+DDD 合规
69 lines
2.5 KiB
Python
69 lines
2.5 KiB
Python
import pytest
|
|
from tests.dev_machine.dev_machine_page import DevMachinePage
|
|
|
|
|
|
@pytest.mark.ui
|
|
@pytest.mark.dev_machine
|
|
class TestDevMachinePageLoad:
|
|
"""开发机页面加载 UI 测试"""
|
|
|
|
def test_page_loads(self, authenticated_page):
|
|
"""
|
|
描述:导航到开发机页面并验证 URL
|
|
预期:当前 URL 包含 'dev-machine',页面正常加载
|
|
"""
|
|
page = DevMachinePage(authenticated_page)
|
|
page.navigate()
|
|
assert "dev-machine" in page.get_url()
|
|
|
|
def test_apply_machine_button_visible(self, authenticated_page):
|
|
"""
|
|
描述:检查开发机页面顶部「申请开发机」按钮是否显示
|
|
预期:「申请开发机」按钮可见
|
|
"""
|
|
page = DevMachinePage(authenticated_page)
|
|
page.navigate()
|
|
assert page.is_visible("button:has-text('申请开发机')")
|
|
|
|
|
|
@pytest.mark.ui
|
|
@pytest.mark.dev_machine
|
|
class TestMachineTable:
|
|
"""开发机列表表格列头 UI 测试"""
|
|
|
|
def test_name_id_column_visible(self, authenticated_page):
|
|
"""
|
|
描述:检查开发机列表表格中「名称/ID」列头是否可见
|
|
预期:表格加载后「名称/ID」列头存在于表头中
|
|
"""
|
|
page = DevMachinePage(authenticated_page)
|
|
page.navigate()
|
|
page.smart_wait(".ant-table-thead", timeout=10000)
|
|
assert authenticated_page.get_by_role(
|
|
"columnheader", name="名称/ID"
|
|
).count() > 0 or page.is_visible("th:has-text('名称')")
|
|
|
|
def test_status_column_visible(self, authenticated_page):
|
|
"""
|
|
描述:检查开发机列表表格中「状态」列头是否可见
|
|
预期:表格加载后「状态」列头存在于表头中
|
|
"""
|
|
page = DevMachinePage(authenticated_page)
|
|
page.navigate()
|
|
page.smart_wait(".ant-table-thead", timeout=10000)
|
|
assert authenticated_page.get_by_role(
|
|
"columnheader", name="状态"
|
|
).count() > 0 or page.is_visible("th:has-text('状态')")
|
|
|
|
def test_spec_column_visible(self, authenticated_page):
|
|
"""
|
|
描述:检查开发机列表表格中「规格信息」列头是否可见
|
|
预期:表格加载后「规格信息」列头存在于表头中
|
|
"""
|
|
page = DevMachinePage(authenticated_page)
|
|
page.navigate()
|
|
page.smart_wait(".ant-table-thead", timeout=10000)
|
|
assert authenticated_page.get_by_role(
|
|
"columnheader", name="规格信息"
|
|
).count() > 0 or page.is_visible("th:has-text('规格')")
|