import { test, expect } from '@playwright/test'; import { LoginPage } from '../pages/LoginPage'; import { DoctorStationPage } from '../pages/DoctorStationPage'; import { TEST_USERS, TEST_URLS } from '../utils/test-data'; test.describe('🏥 门诊医生站', () => { let loginPage: LoginPage; let doctorPage: DoctorStationPage; test.beforeEach(async ({ page }) => { loginPage = new LoginPage(page); doctorPage = new DoctorStationPage(page); await loginPage.goto(); await loginPage.login(TEST_USERS.admin.username, TEST_USERS.admin.password); await loginPage.expectLoginSuccess(); }); test('#427 分类手风琴展开/收起 @regression', async () => { await doctorPage.goto(); const items = doctorPage.categoryItems; const count = await items.count(); if (count >= 2) { // 展开第一个 await doctorPage.expandCategory(0); // 展开第二个,第一个应收起 await doctorPage.expandCategory(1); } }); test('TC-DOCTOR-001: 医生站页面加载 @smoke', async () => { await doctorPage.goto(); await expect(doctorPage.page).toHaveURL(/.*doctorstation.*/); }); });