import { describe, it, expect } from 'cypress'; describe('HIS 系统回归测试集', () => { // 原有测试用例占位... it('基础登录流程验证', () => { cy.visit('/login'); cy.get('input[name="username"]').type('admin'); cy.get('input[name="password"]').type('123456'); cy.get('button[type="submit"]').click(); cy.url().should('include', '/dashboard'); }); // ========================================== // 新增 Bug #561 回归测试 // ========================================== it('医嘱录入后总量单位应正确显示诊疗目录配置值而非null', { tags: ['@bug561', '@regression'] }, () => { // 1. 医生登录 cy.login('doctor1', '123456'); cy.visit('/outpatient/doctor-station'); // 2. 选择患者并进入手术申请 cy.get('.patient-list .patient-item').first().click(); cy.get('[data-testid="btn-surgery-order"]').click(); // 3. 搜索并添加已配置使用单位为“次”的诊疗项目 cy.get('[data-testid="catalog-search-input"]').type('超声切骨刀辅助操作'); cy.get('.catalog-search-result .item').first().click(); cy.get('[data-testid="btn-add-order"]').click(); // 4. 保存并校验医嘱列表中的总量单位显示 cy.get('[data-testid="btn-save-order"]').click(); cy.get('.order-table tbody tr').first().within(() => { // 验证总量字段不包含 "null" cy.get('[data-testid="cell-total-quantity"]').should('not.contain', 'null'); // 验证总量字段包含配置的单位 "次" cy.get('[data-testid="cell-total-quantity"]').should('contain', '次'); }); }); });