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

62 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('基础功能回归', () => {
it('应能正常加载门诊医生站首页', () => {
cy.visit('/outpatient/doctor');
cy.get('.doctor-workbench').should('exist');
});
});
/**
* @bug562 @regression
* 验证门诊医生工作站-待写病历列表加载性能优化:响应时间<2s分页正常
*/
describe('Bug #562: 待写病历数据加载性能优化', () => {
it('待写病历列表应在2秒内完成加载并正确分页', () => {
cy.visit('/outpatient/doctor/pending-records');
// 拦截API请求验证请求参数包含分页信息
cy.intercept('GET', '/api/medical-record/pending*').as('getPendingRecords');
// 验证加载指示器在2秒内消失
cy.get('.el-loading-mask', { timeout: 2000 }).should('not.exist');
// 验证数据表格渲染成功
cy.get('.medical-record-table').should('be.visible');
cy.get('.el-table__body tr').should('have.length.greaterThan', 0);
});
});
/**
* @bug550 @regression
* 验证检查申请项目选择交互优化:解耦勾选、卡片显示优化、明细结构化展示
*/
describe('Bug #550: 检查申请项目选择交互优化', () => {
it('应解耦项目与方法勾选,优化卡片显示并结构化展示明细', () => {
cy.visit('/outpatient/doctor/exam-apply');
// 1. 展开分类并勾选项目
cy.contains('检查项目分类').parent().find('.el-tree-node__content').first().click();
cy.contains('128线排').click();
// 2. 验证检查方法未自动勾选(解耦验证)
cy.get('.method-checkbox-group').find('.el-checkbox__input.is-checked').should('not.exist');
// 3. 验证已选卡片显示完整名称且无“套餐”前缀
cy.get('.selected-card .item-title').should('contain.text', '128线排').and('not.contain.text', '套餐');
cy.get('.selected-card .item-title').should('have.attr', 'title', '128线排');
// 4. 验证明细默认收起
cy.get('.selected-card .card-detail').should('not.be.visible');
// 5. 点击展开验证层级结构(项目 > 检查方法)
cy.get('.selected-card .card-header').click();
cy.get('.selected-card .card-detail').should('be.visible');
cy.get('.selected-card .hierarchy-row').should('exist');
// 6. 验证无冗余“项目套餐明细”标签
cy.get('.selected-card').should('not.contain.text', '项目套餐明细');
});
});