fix: 修正Playwright登录页选择器 - 使用实际placeholder '账号'/'密码'

This commit is contained in:
2026-04-25 22:29:23 +08:00
parent 34ba7cae6a
commit 8fb1d3e583
6 changed files with 49 additions and 81 deletions

View File

@@ -1,36 +1,34 @@
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();
test('#427 分类手风琴展开/收起 @regression', async ({ page }) => {
await page.goto(TEST_URLS.doctorStation);
await page.waitForLoadState('networkidle');
const items = doctorPage.categoryItems;
const items = page.locator('.el-collapse-item, .category-item');
const count = await items.count();
if (count >= 2) {
// 展开第一个
await doctorPage.expandCategory(0);
// 展开第二个,第一个应收起
await doctorPage.expandCategory(1);
await items.nth(0).click();
await page.waitForTimeout(500);
await items.nth(1).click();
await page.waitForTimeout(500);
}
});
test('TC-DOCTOR-001: 医生站页面加载 @smoke', async () => {
await doctorPage.goto();
await expect(doctorPage.page).toHaveURL(/.*doctorstation.*/);
test('TC-DOCTOR-001: 医生站页面加载 @smoke', async ({ page }) => {
await page.goto(TEST_URLS.doctorStation);
await expect(page).toHaveURL(/.*doctorstation.*/);
});
});