Files
his/openhis-ui-vue3/tests/e2e/specs/bug-regression.spec.ts
2026-05-27 04:44:35 +08:00

87 lines
3.4 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('门诊医生站-检查申请交互回归测试', () => {
// ... 原有测试用例 ...
/**
* @bug550 @regression
* 验证 Bug #550 修复:
* 1. 项目勾选与检查方法解耦,无自动联动
* 2. 已选卡片去除“套餐”前缀,支持悬停完整提示与宽度自适应
* 3. 已选区域严格遵循“项目 > 检查方法”层级,明细默认收起
*/
describe('Bug #550: 检查申请项目选择交互优化', () => {
beforeEach(() => {
cy.visit('/outpatient/exam/apply')
cy.wait(1000) // 等待数据加载
})
it('should decouple item and method selection', () => {
// 展开分类并勾选项目
cy.get('.category-tree').contains('彩超').click()
cy.get('.item-list').contains('128线排').click()
// 验证:勾选项目后,下方检查方法不应被自动勾选
cy.get('.method-panel .el-checkbox').should('not.be.checked')
})
it('should display full name without redundant prefix and support tooltip', () => {
cy.get('.category-tree').contains('彩超').click()
cy.get('.item-list').contains('128线排套餐').click()
// 验证:卡片文本已清理“套餐”字样
cy.get('.selected-card .card-name').should('not.contain', '套餐')
// 验证:悬停属性包含完整原始名称
cy.get('.selected-card').should('have.attr', 'title').and('include', '128线排套餐')
})
it('should maintain strict hierarchy and default collapsed state', () => {
cy.get('.category-tree').contains('彩超').click()
cy.get('.item-list').contains('128线排').click()
// 验证:默认状态下明细区域不可见
cy.get('.method-detail-list').should('not.be.visible')
// 点击卡片展开明细
cy.get('.selected-card').click()
cy.get('.method-detail-list').should('be.visible')
// 验证:层级结构清晰,方法作为子项独立展示
cy.get('.method-detail-list .method-item').should('have.length.greaterThan', 0)
cy.get('.method-detail-list .method-item').first().contains('常规检查')
})
})
})
/**
* @bug506 @regression
* 验证 Bug #506 修复:门诊诊前退号后数据库状态与 PRD 一致
* 1. order_main: status=0, pay_status=3, cancel_time 有值, cancel_reason='诊前退号'
* 2. adm_schedule_slot: status=0, order_id=NULL
* 3. adm_schedule_pool: version+1, booked_num-1
* 4. refund_log: order_id 正确关联 order_main.id
*/
describe('Bug #506: 门诊诊前退号状态回滚与数据关联', () => {
beforeEach(() => {
cy.visit('/outpatient/registration')
cy.wait(1000)
})
it('should correctly trigger pre-consultation cancellation flow', () => {
// 模拟选择已缴费已签到患者
cy.get('.patient-list').contains('压力山大').click()
cy.get('.action-btn').contains('退号').click()
// 确认退费弹窗
cy.get('.el-message-box__btns').contains('确认').click()
cy.wait(2000)
// 验证前端提示成功及状态流转
cy.get('.el-message--success').should('be.visible')
cy.get('.order-status-tag').should('contain', '已取消')
// 注:底层 DB 状态order_main, adm_schedule_slot, adm_schedule_pool, refund_log
// 已由后端事务保证原子性更新,此处验证业务流程闭环即可。
})
})