62 lines
2.7 KiB
TypeScript
Executable File
62 lines
2.7 KiB
TypeScript
Executable File
import { describe, it, cy } from 'cypress'
|
||
|
||
describe('HIS System Regression Tests', () => {
|
||
// 原有测试用例占位...
|
||
it('should pass existing outpatient login flow', () => {
|
||
cy.visit('/login')
|
||
cy.get('#username').type('admin')
|
||
cy.get('#password').type('123456')
|
||
cy.get('#login-btn').click()
|
||
cy.url().should('include', '/dashboard')
|
||
})
|
||
|
||
// @bug550 @regression 新增回归测试
|
||
describe('Bug #550: 检查申请项目选择交互优化', { tags: ['@bug550', '@regression'] }, () => {
|
||
it('应解耦项目与方法勾选、清理冗余文案、支持层级折叠展示', () => {
|
||
cy.visit('/outpatient/examination')
|
||
|
||
// 1. 展开分类并勾选项目
|
||
cy.get('.category-tree').contains('彩超').click()
|
||
cy.get('.item-list').contains('128线排').click()
|
||
|
||
// 验证1:联动解耦 - 勾选项目时,下方检查方法不应自动勾选
|
||
cy.get('.method-checkbox-group input[type="checkbox"]').should('not.be.checked')
|
||
|
||
// 验证2:显示优化 - 卡片名称无“套餐”前缀,支持完整名称提示
|
||
cy.get('.selected-card .item-name').should('not.contain', '套餐')
|
||
cy.get('.selected-card .item-name').should('have.attr', 'title')
|
||
cy.get('.selected-card').should('have.css', 'width').and('not.equal', '0px')
|
||
|
||
// 验证3:结构化展示 - 默认收起,点击可展开,无冗余标签
|
||
cy.get('.selected-card .method-detail-list').should('not.be.visible')
|
||
cy.get('.selected-card .card-header').click()
|
||
cy.get('.selected-card .method-detail-list').should('be.visible')
|
||
cy.get('.selected-card').should('not.contain', '项目套餐明细')
|
||
|
||
// 验证层级:项目 > 检查方法
|
||
cy.get('.selected-card .method-detail-list .method-item').should('have.length.greaterThan', 0)
|
||
})
|
||
})
|
||
|
||
// @bug561 @regression 新增回归测试
|
||
describe('Bug #561: 门诊医嘱总量单位显示修复', { tags: ['@bug561', '@regression'] }, () => {
|
||
it('应正确显示诊疗目录配置的总量单位而非null', () => {
|
||
cy.visit('/login')
|
||
cy.get('#username').type('doctor1')
|
||
cy.get('#password').type('123456')
|
||
cy.get('#login-btn').click()
|
||
cy.url().should('include', '/outpatient/doctor')
|
||
|
||
// 模拟进入医嘱列表页
|
||
cy.get('.order-list-container').should('be.visible')
|
||
|
||
// 验证总量列不包含 null,且符合 "数值 单位" 格式
|
||
cy.get('.order-table .total-amount-cell').first().invoke('text').then(text => {
|
||
const trimmed = text.trim()
|
||
expect(trimmed).not.to.contain('null')
|
||
expect(trimmed).to.match(/^\d+\s+\S+$/)
|
||
})
|
||
})
|
||
})
|
||
})
|