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

64 lines
2.6 KiB
TypeScript
Executable File

import { describe, it, cy } from 'cypress';
describe('门诊医生站-检查申请模块回归测试', () => {
beforeEach(() => {
cy.visit('/outpatient/examination/apply');
cy.wait(500);
});
it('should load examination categories and items correctly', () => {
cy.get('.category-tree').should('be.visible');
cy.contains('彩超').click();
cy.get('.item-list').should('contain', '128线排');
});
// ... 其他已有测试用例 ...
// @bug550 @regression
describe('Bug #550: 检查申请项目选择交互优化', () => {
it('should decouple item and method selection, show full names, and render hierarchical details', () => {
// 1. 展开彩超分类并勾选项目
cy.get('.category-tree').contains('彩超').click();
cy.get('.item-list').contains('128线排').click();
// 2. 验证检查方法未被自动勾选(解耦)
cy.get('.method-list .el-checkbox').should('not.have.class', 'is-checked');
// 3. 验证已选卡片无"套餐"前缀,且支持悬停显示全名
cy.get('.selected-card .item-name').should('not.contain', '套餐');
cy.get('.selected-card .item-name').trigger('mouseover');
cy.get('.el-tooltip__popper').should('contain', '128线排');
// 4. 验证默认收起状态
cy.get('.method-detail-panel').should('not.be.visible');
// 5. 点击展开,验证层级结构(项目 > 检查方法)
cy.get('.selected-card .expand-btn').click();
cy.get('.method-detail-panel').should('be.visible');
cy.get('.method-item').first().should('have.css', 'padding-left').and('match', /16px|20px/);
// 6. 验证可独立勾选检查方法
cy.get('.method-item').first().find('.el-checkbox').click();
cy.get('.method-item').first().find('.el-checkbox').should('have.class', 'is-checked');
cy.get('.selected-card .item-name').parent().find('.el-checkbox').should('not.have.class', 'is-checked');
});
});
});
// @bug562 @regression
describe('Bug #562: 待写病历加载性能优化', () => {
it('should load pending medical records within 2 seconds and clear loading state', () => {
cy.visit('/clinic/outpatient/medicalrecord/pending');
cy.intercept('GET', '**/api/clinic/medical-record/pending*').as('getPendingRecords');
// 验证 loading 状态出现
cy.get('.el-loading-mask').should('be.visible');
// 拦截请求并模拟正常响应,验证响应时间 < 2000ms
cy.wait('@getPendingRecords').its('response.statusCode').should('eq', 200);
// 验证 loading 状态已清除
cy.get('.el-loading-mask').should('not.exist');
});
});