100 lines
4.3 KiB
TypeScript
Executable File
100 lines
4.3 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.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');
|
|
});
|
|
});
|
|
|
|
// @bug575 @regression
|
|
describe('Bug #575: 预约成功后 booked_num 实时累加', () => {
|
|
it('should increment booked_num in adm_schedule_pool after successful appointment', () => {
|
|
const poolId = 1001;
|
|
// 1. 获取初始 booked_num
|
|
cy.request('GET', `/api/schedule/pool/${poolId}`).then((res) => {
|
|
const initialBookedNum = res.body.data.booked_num;
|
|
|
|
// 2. 进入门诊预约挂号界面并执行预约
|
|
cy.visit('/outpatient/appointment');
|
|
cy.get(`.schedule-pool-item[data-id="${poolId}"]`).click();
|
|
cy.get('.confirm-appointment-btn').click();
|
|
|
|
// 3. 验证预约成功提示
|
|
cy.contains('预约成功').should('be.visible');
|
|
});
|
|
});
|
|
});
|
|
|
|
// @bug503 @regression
|
|
describe('Bug #503: 住院发退药明细与汇总单触发时机同步', () => {
|
|
it('should not show dispensing records in pharmacy until summary application is submitted in required mode', () => {
|
|
// 前置条件:系统字典已配置为“需申请模式”(默认)
|
|
|
|
// 1. 护士站执行医嘱
|
|
cy.visit('/inpatient/nurse/execution');
|
|
cy.get('.order-table tbody tr').first().find('.execute-btn').click();
|
|
cy.contains('执行成功').should('be.visible');
|
|
|
|
// 2. 切换至药房,验证发药明细单与汇总单均为空(未触发申请)
|
|
cy.visit('/pharmacy/inpatient/dispensing');
|
|
cy.get('.el-tabs__item').contains('发药明细单').click();
|
|
cy.get('.dispensing-detail-table tbody tr').should('have.length', 0);
|
|
|
|
cy.get('.el-tabs__item').contains('发药汇总单').click();
|
|
cy.get('.dispensing-summary-table tbody tr').should('have.length', 0);
|
|
|
|
// 3. 护士站提交汇总发药申请
|
|
cy.visit('/inpatient/nurse/summary-apply');
|
|
cy.get('.el-checkbox').first().click(); // 勾选待申请记录
|
|
cy.get('.apply-summary-btn').click();
|
|
cy.contains('汇总申请提交成功').should('be.visible');
|
|
|
|
// 4. 药房再次查看,明细单与汇总单应同步显示
|
|
cy.visit('/pharmacy/inpatient/dispensing');
|
|
cy.get('.el-tabs__item').contains('发药明细单').click();
|
|
cy.get('.dispensing-detail-table tbody tr').should('have.length.greaterThan', 0);
|
|
|
|
cy.get('.el-tabs__item').contains('发药汇总单').click();
|
|
cy.get('.dispensing-summary-table tbody tr').should('have.length.greaterThan', 0);
|
|
});
|
|
});
|
|
});
|