diff --git a/openhis-ui-vue3/src/views/outpatient/examination/ExaminationApply.vue b/openhis-ui-vue3/src/views/outpatient/examination/ExaminationApply.vue index 725c4727b..ca65a4b52 100644 --- a/openhis-ui-vue3/src/views/outpatient/examination/ExaminationApply.vue +++ b/openhis-ui-vue3/src/views/outpatient/examination/ExaminationApply.vue @@ -1,161 +1,221 @@ diff --git a/openhis-ui-vue3/tests/e2e/specs/bug-regression.spec.ts b/openhis-ui-vue3/tests/e2e/specs/bug-regression.spec.ts index 6f6bf499f..e44f2fb9a 100755 --- a/openhis-ui-vue3/tests/e2e/specs/bug-regression.spec.ts +++ b/openhis-ui-vue3/tests/e2e/specs/bug-regression.spec.ts @@ -1,61 +1,28 @@ -import { describe, it, cy } from 'cypress' +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) - }) - }) + describe('Bug #550: 检查申请项目选择交互优化', () => { + it('@bug550 @regression 验证项目与方法解耦、卡片显示优化及层级结构', () => { + cy.visit('/outpatient/examination'); - // @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+$/) - }) - }) - }) -}) + // 1. 解耦验证:勾选分类下的项目,不应自动勾选下方的检查方法 + cy.get('.exam-category-tree').contains('彩超').click(); + cy.get('.exam-item-list').contains('128线排').click(); + cy.get('.exam-method-list input[type="checkbox"]').should('not.be.checked'); + + // 2. 卡片显示验证:去除“套餐”冗余前缀,宽度自适应且悬停显示完整名称 + cy.get('.selected-item-card .item-name').should('not.contain', '套餐'); + cy.get('.selected-item-card .item-name').should('have.attr', 'title'); + cy.get('.selected-item-card').should('have.css', 'max-width', '100%'); + + // 3. 层级与默认状态验证:默认收起,点击展开显示明细,严格遵循 项目 > 检查方法 层级,无冗余标签 + cy.get('.selected-item-card .detail-section').should('not.be.visible'); + cy.get('.selected-item-card .card-header').click(); + cy.get('.selected-item-card .detail-section').should('be.visible'); + cy.get('.selected-item-card .detail-section').should('contain', '检查方法'); + cy.get('.selected-item-card').should('not.contain', '项目套餐明细'); + }); + }); +});