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

59 lines
2.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('HIS System Regression Tests', () => {
it('should pass baseline health check', () => {
cy.visit('/')
cy.get('#app').should('be.visible')
})
})
// ==========================================
// Bug #550 回归测试用例
// ==========================================
describe('Bug #550: 检查申请项目选择交互优化', { tags: ['@bug550', '@regression'] }, () => {
it('应解耦项目与方法勾选,去除套餐前缀,且默认收起明细', () => {
cy.visit('/outpatient/exam/apply')
// 1. 验证联动解耦:勾选项目时,下方检查方法不应被自动勾选
cy.get('.item-row').contains('128线排').click()
cy.get('.method-container .el-checkbox').should('not.have.class', 'is-checked')
// 2. 验证卡片显示:去除“套餐”冗余字样,支持完整名称提示
cy.get('.collapse-title').should('not.contain', '套餐')
cy.get('.collapse-title').trigger('mouseenter')
cy.get('.el-tooltip__popper').should('be.visible')
// 3. 验证默认状态:已选套餐面板默认收起,不直接展开明细
cy.get('.el-collapse-item__content').should('not.be.visible')
// 4. 验证结构化展示:点击可展开查看明细,层级清晰(项目 > 检查方法)
cy.get('.el-collapse-item__header').click()
cy.get('.el-collapse-item__content').should('be.visible')
cy.get('.method-row').should('have.length.greaterThan', 0)
cy.get('.method-name').first().should('be.visible')
})
})
// ==========================================
// Bug #561 回归测试用例
// ==========================================
describe('Bug #561: 医嘱总量单位显示修复', { tags: ['@bug561', '@regression'] }, () => {
it('应正确显示诊疗目录配置的总量单位而非null', () => {
cy.visit('/outpatient/doctor/order')
// 等待医嘱列表加载完成
cy.get('.order-table .el-table__body-wrapper').should('be.visible')
// 验证总量列不包含 'null' 字符串
cy.get('.order-table').find('td').each(($el) => {
const text = $el.text()
if (text.includes('总量') || text.match(/^\d+\s/)) {
expect(text).not.to.contain('null')
}
})
// 验证单位正确回显(以“次”为例,兼容其他配置单位)
cy.get('.order-table').find('td').contains('次').should('exist')
})
})