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

65 lines
2.7 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');
});
});
/**
* @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', '项目套餐明细');
});
});
/**
* @bug574 @regression
* 验证预约签到缴费成功后,排班号状态流转为 3已取号
*/
describe('Bug #574: 预约签到缴费后排班号状态流转', () => {
it('缴费成功后应更新 adm_schedule_slot.status 为 3', () => {
const mockOrderId = 10086;
cy.intercept('POST', '/api/order/pay', { statusCode: 200, body: { success: true, orderId: mockOrderId } }).as('payOrder');
cy.intercept('GET', `/api/schedule/slot/status?orderId=${mockOrderId}`, { statusCode: 200, body: { status: '3' } }).as('checkSlotStatus');
cy.visit('/outpatient/registration');
// 模拟选择预约患者并执行签到缴费
cy.get('[data-testid="patient-search"]').type('预约测试患者');
cy.contains('预约签到').click();
cy.get('[data-testid="pay-btn"]').click();
cy.wait('@payOrder').then(() => {
// 验证支付成功后,系统自动查询排班号状态
cy.wait('@checkSlotStatus').its('response.body.status').should('eq', '3');
});
});
});