47 lines
1.7 KiB
TypeScript
Executable File
47 lines
1.7 KiB
TypeScript
Executable File
import { describe, it, cy } from 'cypress';
|
|
|
|
describe('HIS 业务逻辑回归测试', () => {
|
|
beforeEach(() => {
|
|
cy.intercept('POST', '/api/auth/login', { statusCode: 200, body: { token: 'mock-token' } }).as('login');
|
|
});
|
|
|
|
// ... 其他已有测试用例 ...
|
|
|
|
describe('Bug #505 Regression', () => {
|
|
it('@bug505 @regression 已发药医嘱不可直接退回', () => {
|
|
// 1. 模拟护士登录
|
|
cy.visit('/login');
|
|
cy.get('input[placeholder="账号"]').type('wx');
|
|
cy.get('input[placeholder="密码"]').type('123456');
|
|
cy.get('button[type="submit"]').click();
|
|
cy.wait('@login');
|
|
|
|
// 2. 进入医嘱校对模块并切换至已校对页签
|
|
cy.visit('/inpatient/order-verification');
|
|
cy.get('.el-tabs__item').contains('已校对').click();
|
|
|
|
// 3. 模拟勾选一条状态为“已发药”的药品医嘱
|
|
cy.intercept('GET', '/api/inpatient/order/list*', {
|
|
statusCode: 200,
|
|
body: {
|
|
code: 200,
|
|
data: [
|
|
{ id: 1001, drugName: '头孢哌酮钠舒巴坦钠', status: 'VERIFIED', pharmacyStatus: 'DISPENSED', execStatus: 'EXECUTED' }
|
|
]
|
|
}
|
|
}).as('fetchOrders');
|
|
cy.wait('@fetchOrders');
|
|
cy.get('.el-table__row').contains('头孢哌酮钠舒巴坦钠').parent().find('.el-checkbox__input').click();
|
|
|
|
// 4. 点击退回按钮
|
|
cy.get('.el-button').contains('退回').click();
|
|
|
|
// 5. 验证系统拦截提示(后端校验透传)
|
|
cy.contains('该药品已由药房发放,请先执行退药处理,不可直接退回').should('be.visible');
|
|
|
|
// 6. 验证数据未发生流转(仍停留在已校对页签)
|
|
cy.get('.el-tabs__item.is-active').should('contain', '已校对');
|
|
});
|
|
});
|
|
});
|