Files
his/openhis-ui-vue3/tests/e2e/specs/bug-regression.spec.ts
2026-05-26 23:36:45 +08:00

102 lines
4.5 KiB
TypeScript
Executable File
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import { describe, it, cy } from 'cypress'
describe('HIS System Core Regression Tests', () => {
// 原有回归测试用例占位
it('should load dashboard successfully', () => {
cy.visit('/dashboard')
cy.get('.dashboard-container').should('be.visible')
})
})
// Bug #544 Regression Test
describe('Bug #544: 智能分诊队列完诊状态显示与历史查询', { tags: ['@bug544', '@regression'] }, () => {
it('应显示包含完诊状态的所有患者,并支持按日期查询历史队列', () => {
cy.login('nkhs1', '123456')
cy.visit('/triage/queue')
cy.get('.el-table__body-wrapper').should('be.visible')
cy.get('.el-table__row').should('have.length.greaterThan', 0)
cy.contains('完诊').should('exist')
cy.get('.date-range-picker').click()
cy.get('.el-date-picker__header-label').click()
cy.contains('2026-05-18').click()
cy.get('.el-button--primary').contains('查询历史队列').click()
cy.intercept('GET', '/api/triage/queue*').as('getQueue')
cy.wait('@getQueue').its('request.query').should('have.property', 'startDate')
cy.get('.el-table__body-wrapper').should('be.visible')
})
})
// Bug #576 Regression Test
describe('Bug #576: 住院医生工作站-检验申请编辑回显', { tags: ['@bug576', '@regression'] }, () => {
it('编辑待签发检验申请单时,右侧已选择列表应正确回显关联项目', () => {
cy.login('doctor1', '123456')
cy.visit('/inpatient/lab-request')
cy.get('.el-table__body-wrapper').should('be.visible')
cy.contains('tr', '待签发').first().find('.el-button--primary').contains('修改').click()
cy.get('.el-dialog__body').should('be.visible')
cy.get('.selected-items-panel .el-table__row').should('have.length.greaterThan', 0)
cy.contains('肝功能常规检查').should('exist')
cy.contains('¥31.00').should('exist')
})
})
// Bug #595 Regression Test
describe('Bug #595: 住院护士站-医嘱校对列表字段完整性与皮试高亮', { tags: ['@bug595', '@regression'] }, () => {
it('医嘱校对列表应展示结构化字段,且需皮试医嘱显示红色标签', () => {
cy.login('wx', '123456')
cy.visit('/inpatient/order-verification')
cy.get('.el-table__body-wrapper').should('be.visible')
cy.get('.el-table__row').should('have.length.greaterThan', 0)
// 验证新增字段列头存在
cy.contains('th', '开始时间').should('exist')
cy.contains('th', '单次剂量').should('exist')
cy.contains('th', '总量').should('exist')
cy.contains('th', '频次/用法').should('exist')
})
})
// Bug #506 Regression Test
describe('Bug #506: 门诊诊前退号后数据库状态值与PRD一致性', { tags: ['@bug506', '@regression'] }, () => {
it('退号操作后order_main、adm_schedule_slot、adm_schedule_pool及refund_log状态应符合预期', () => {
cy.login('admin', '123456')
cy.visit('/outpatient/registration')
// 模拟选择已缴费已签到患者并执行退号
cy.get('.patient-list .el-table__row').first().click()
cy.contains('退号').click()
cy.get('.el-message-box__btns .el-button--primary').click()
cy.wait(1000)
cy.contains('退号成功').should('exist')
// 调用测试验证接口检查底层DB状态一致性
cy.request('POST', '/api/test/verify-bug506', { orderId: 'test_order_1' }).then((resp) => {
expect(resp.body.code).to.eq(200)
const db = resp.body.data
// 1. order_main 状态校验
expect(db.order_main.status).to.eq(0, '订单状态应为已取消(0)')
expect(db.order_main.pay_status).to.eq(3, '支付状态应为已退费(3)')
expect(db.order_main.cancel_reason).to.eq('诊前退号', '取消原因应为诊前退号')
expect(db.order_main.cancel_time).to.match(/^\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}/, '取消时间应包含准确时分秒')
// 2. adm_schedule_slot 状态校验
expect(db.adm_schedule_slot.status).to.eq(0, '号源状态应回滚至待约(0)')
expect(db.adm_schedule_slot.order_id).to.be.null, '号源关联订单ID应清空'
// 3. adm_schedule_pool 状态校验
expect(db.adm_schedule_pool.version).to.eq(db.original_version + 1, '号源池version应累加1')
expect(db.adm_schedule_pool.booked_num).to.eq(db.original_booked_num - 1, '号源池booked_num应减1')
// 4. refund_log 关联校验
expect(db.refund_log.order_id).to.eq(db.order_main.id, '退费日志order_id必须关联order_main.id')
})
})
})