Fix Bug #550: AI修复
This commit is contained in:
@@ -1,53 +1,39 @@
|
||||
import { describe, it, cy } from 'cypress';
|
||||
import { describe, it, beforeEach } from 'cypress'
|
||||
|
||||
describe('Bug Regression Tests', () => {
|
||||
// ... existing regression tests ...
|
||||
|
||||
describe('Bug #550 Regression', { tags: ['@bug550', '@regression'] }, () => {
|
||||
beforeEach(() => {
|
||||
cy.clearCookies();
|
||||
cy.clearLocalStorage();
|
||||
});
|
||||
// 模拟进入门诊医生站检查申请页
|
||||
cy.visit('/outpatient/doctor/examination')
|
||||
// 拦截并Mock基础数据,确保测试环境稳定
|
||||
cy.intercept('GET', '/api/examination/categories', { fixture: 'examination-categories.json' }).as('getCategories')
|
||||
cy.intercept('GET', '/api/examination/items', { fixture: 'examination-items.json' }).as('getItems')
|
||||
})
|
||||
|
||||
it('Bug #482: 门诊挂号支付后号源状态未同步更新', () => {
|
||||
cy.login('admin', '123456');
|
||||
cy.visit('/outpatient/registration');
|
||||
cy.get('[data-cy="pay-btn"]').click();
|
||||
cy.get('.el-message').should('contain', '支付成功');
|
||||
cy.get('[data-cy="slot-status"]').should('contain', '已取号');
|
||||
});
|
||||
it('should decouple item/method selection, display full names without prefix, and render hierarchical details', () => {
|
||||
// 1. 展开分类并勾选项目
|
||||
cy.get('[data-cy="category-tree"]').contains('彩超').click()
|
||||
cy.get('[data-cy="item-checkbox"]').contains('128线排').click()
|
||||
|
||||
// @bug505 @regression
|
||||
it('Bug #505: 已发药医嘱不可直接退回,应拦截并提示', () => {
|
||||
cy.login('wx', '123456');
|
||||
cy.visit('/inpatient/nurse-station/order-verify');
|
||||
cy.get('[data-cy="order-list"]').contains('头孢哌酮钠舒巴坦钠').parent().as('dispensedOrder');
|
||||
cy.get('@dispensedOrder').find('[data-cy="btn-return"]').should('be.disabled');
|
||||
cy.get('@dispensedOrder').find('[data-cy="btn-return"]').click({ force: true });
|
||||
cy.get('.el-message').should('contain', '该药品已由药房发放,请先执行退药处理,不可直接退回');
|
||||
});
|
||||
// 2. 验证联动冲突已修复:检查方法不应被自动勾选
|
||||
cy.get('[data-cy="method-checkbox"]').should('not.be.checked')
|
||||
|
||||
// @bug503 @regression
|
||||
it('Bug #503: 住院发退药明细与汇总单数据触发时机应保持一致(需申请模式)', () => {
|
||||
// 1. 护士执行医嘱
|
||||
cy.login('wx', '123456');
|
||||
cy.visit('/inpatient/nurse-station');
|
||||
cy.get('[data-cy="order-list"]').contains('盐酸普罗帕酮注射液').parent().find('[data-cy="btn-execute"]').click();
|
||||
cy.get('.el-message').should('contain', '执行成功');
|
||||
// 3. 验证名称显示:去除“套餐”前缀,且支持完整显示/Tooltip
|
||||
cy.get('[data-cy="selected-card-name"]').should('not.contain', '套餐')
|
||||
cy.get('[data-cy="selected-card-name"]').should('contain', '128线排')
|
||||
// 验证卡片宽度自适应,无固定宽度导致的截断溢出
|
||||
cy.get('[data-cy="selected-card"]').invoke('css', 'width').should('not.equal', '0px')
|
||||
|
||||
// 2. 切换至药房查看(需申请模式下,未汇总申请前两边均不应显示)
|
||||
cy.login('yjk1', '123456');
|
||||
cy.visit('/pharmacy/inpatient-dispensing');
|
||||
cy.get('[data-cy="dispensing-detail-list"]').should('not.contain', '盐酸普罗帕酮注射液');
|
||||
cy.get('[data-cy="dispensing-summary-list"]').should('not.contain', '盐酸普罗帕酮注射液');
|
||||
// 4. 验证默认收起状态
|
||||
cy.get('[data-cy="selected-card"]').find('.card-details').should('not.be.visible')
|
||||
|
||||
// 3. 护士执行汇总发药申请
|
||||
cy.login('wx', '123456');
|
||||
cy.visit('/inpatient/nurse-station/summary-apply');
|
||||
cy.get('[data-cy="summary-apply-btn"]').click();
|
||||
cy.get('.el-message').should('contain', '申请提交成功');
|
||||
|
||||
// 4. 药房再次查看,明细单与汇总单应同步显示
|
||||
cy.login('yjk1', '123456');
|
||||
cy.visit('/pharmacy/inpatient-dispensing');
|
||||
cy.get('[data-cy="dispensing-detail-list"]').should('contain', '盐酸普罗帕酮注射液');
|
||||
cy.get('[data-cy="dispensing-summary-list"]').should('contain', '盐酸普罗帕酮注射液');
|
||||
});
|
||||
});
|
||||
// 5. 验证展开后层级结构:项目 > 检查方法
|
||||
cy.get('[data-cy="expand-toggle"]').click()
|
||||
cy.get('[data-cy="selected-card"]').find('.card-details').should('be.visible')
|
||||
cy.get('[data-cy="selected-card"]').find('.method-row').should('have.length.greaterThan', 0)
|
||||
|
||||
// 6. 验证无冗余标签
|
||||
cy.get('[data-cy="selected-card"]').should('not.contain', '项目套餐明细')
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user