Files
his/openhis-ui-vue3/tests/e2e/specs/bug-regression.spec.ts
2026-05-27 06:40:43 +08:00

54 lines
2.6 KiB
TypeScript
Executable File

import { describe, it, cy } from 'cypress';
describe('HIS System Regression Tests', () => {
// 原有测试用例保留...
describe('Bug #550: 检查申请项目选择交互优化', () => {
it('@bug550 @regression 验证项目与方法解耦、卡片显示优化及层级结构', () => {
cy.visit('/outpatient/examination');
// 1. 解耦验证:勾选分类下的项目,不应自动勾选下方的检查方法
cy.get('.exam-category-tree').contains('彩超').click();
cy.get('.exam-item-list').contains('128线排').click();
cy.get('.exam-method-list input[type="checkbox"]').should('not.be.checked');
// 2. 卡片显示验证:去除“套餐”冗余前缀,宽度自适应且悬停显示完整名称
cy.get('.selected-item-card .item-name').should('not.contain', '套餐');
cy.get('.selected-item-card .item-name').should('have.attr', 'title');
cy.get('.selected-item-card').should('have.css', 'max-width', '100%');
// 3. 层级与默认状态验证:默认收起,点击展开显示明细,严格遵循 项目 > 检查方法 层级,无冗余标签
cy.get('.selected-item-card .detail-section').should('not.be.visible');
cy.get('.selected-item-card .card-header').click();
cy.get('.selected-item-card .detail-section').should('be.visible');
cy.get('.selected-item-card .detail-section').should('contain', '检查方法');
cy.get('.selected-item-card').should('not.contain', '项目套餐明细');
});
});
describe('Bug #505: 已发药医嘱退回拦截', () => {
it('@bug505 @regression 验证已发药医嘱点击退回时弹出拦截提示且状态不流转', () => {
// 模拟护士登录并进入医嘱校对模块
cy.visit('/nurse/order-verify');
cy.get('.el-tabs__item').contains('已校对').click();
// 模拟勾选一条状态为“已发药”的药品医嘱
cy.get('.order-table tbody tr').first().click();
cy.get('.status-tag').contains('已发药').should('be.visible');
// 点击退回按钮
cy.get('.el-button').contains('退回').click();
// 验证系统拦截提示(精确匹配业务要求文案)
cy.get('.el-message--error').should('contain', '该药品已由药房发放,请先执行退药处理,不可直接退回');
// 验证医嘱未错误流转至“已退回”页签
cy.get('.el-tabs__item').contains('已退回').click();
cy.get('.order-table tbody').should('not.contain', '已发药');
// 验证按钮置灰逻辑(若前端已实现动态禁用)
cy.get('.el-button').contains('退回').should('have.class', 'is-disabled');
});
});
});