99 lines
4.6 KiB
TypeScript
Executable File
99 lines
4.6 KiB
TypeScript
Executable File
import { describe, it, cy } from 'cypress';
|
|
|
|
// 历史回归测试用例占位...
|
|
describe('Historical Regression Tests', () => {
|
|
it('should pass existing outpatient flow', () => {
|
|
cy.visit('/outpatient/dashboard');
|
|
cy.get('#patient-search').type('测试患者');
|
|
cy.contains('查询').click();
|
|
});
|
|
});
|
|
|
|
// @bug550 @regression
|
|
describe('Bug #550: 检查申请项目选择交互优化', () => {
|
|
beforeEach(() => {
|
|
cy.visit('/outpatient/examination-apply');
|
|
cy.intercept('GET', '/api/examination/categories', { fixture: 'categories.json' }).as('getCategories');
|
|
cy.intercept('GET', '/api/examination/items', { fixture: 'items.json' }).as('getItems');
|
|
cy.intercept('GET', '/api/examination/methods', { fixture: 'methods.json' }).as('getMethods');
|
|
});
|
|
|
|
it('1. 联动解耦:勾选项目不应自动勾选检查方法', () => {
|
|
cy.wait(['@getCategories', '@getItems', '@getMethods']);
|
|
cy.get('.category-tree').contains('彩超').click();
|
|
cy.get('.item-list').find('label').contains('128线排').click();
|
|
cy.get('.method-list').find('input[type="checkbox"]').each(($el) => {
|
|
cy.wrap($el).should('not.be.checked');
|
|
});
|
|
});
|
|
|
|
it('2. 卡片显示优化:名称完整提示、去除冗余前缀、默认收起', () => {
|
|
cy.wait(['@getCategories', '@getItems', '@getMethods']);
|
|
cy.get('.category-tree').contains('彩超').click();
|
|
cy.get('.item-list').find('label').contains('128线排').click();
|
|
cy.get('.selected-card .card-body').should('not.be.visible');
|
|
cy.get('.selected-card .card-title').should('not.contain', '套餐');
|
|
cy.get('.selected-card .card-title').should('have.attr', 'title', '128线排');
|
|
});
|
|
|
|
it('3. 结构化展示:严格遵循 项目 > 方法 层级,无冗余标签', () => {
|
|
cy.wait(['@getCategories', '@getItems', '@getMethods']);
|
|
cy.get('.category-tree').contains('彩超').click();
|
|
cy.get('.item-list').find('label').contains('128线排').click();
|
|
cy.get('.selected-card .card-header').click();
|
|
cy.get('.selected-card .card-body').should('be.visible');
|
|
cy.get('.selected-card .card-body .method-row').should('have.length.greaterThan', 0);
|
|
});
|
|
});
|
|
|
|
// @bug566 @regression
|
|
describe('Bug #566: 体温单数据录入后图表与表格同步渲染', () => {
|
|
beforeEach(() => {
|
|
cy.visit('/inpatient/vital-signs');
|
|
cy.intercept('POST', '/api/vital-signs/save', { statusCode: 200, body: { code: 200, msg: '保存成功' } }).as('saveVitalSigns');
|
|
cy.intercept('GET', '/api/vital-signs/list*', { fixture: 'vital-signs-data.json' }).as('fetchChartData');
|
|
});
|
|
|
|
it('1. 录入体征数据后,图表区应自动渲染数据点且表格同步', () => {
|
|
cy.get('.patient-selector').click();
|
|
cy.contains('123').click();
|
|
cy.get('.add-btn').click();
|
|
});
|
|
});
|
|
|
|
// @bug503 @regression
|
|
describe('Bug #503: 住院发退药明细与汇总单数据触发时机同步', () => {
|
|
beforeEach(() => {
|
|
cy.intercept('GET', '/api/pharmacy/dispensing/details*', { fixture: 'dispensing-empty.json' }).as('getDetails');
|
|
cy.intercept('GET', '/api/pharmacy/dispensing/summaries*', { fixture: 'dispensing-empty.json' }).as('getSummaries');
|
|
});
|
|
|
|
it('1. 护士执行医嘱后,药房明细与汇总单均不应显示(需申请模式)', () => {
|
|
cy.visit('/inpatient/nurse/execution');
|
|
cy.intercept('POST', '/api/orders/execute', { statusCode: 200, body: { code: 200, msg: '执行成功' } }).as('executeOrder');
|
|
cy.get('.order-row').first().find('.execute-btn').click();
|
|
cy.wait('@executeOrder');
|
|
|
|
cy.visit('/inpatient/pharmacy/dispensing');
|
|
cy.wait(['@getDetails', '@getSummaries']);
|
|
cy.get('.detail-table tbody').should('be.empty');
|
|
cy.get('.summary-table tbody').should('be.empty');
|
|
});
|
|
|
|
it('2. 护士提交汇总发药申请后,明细与汇总单应同时显示', () => {
|
|
cy.visit('/inpatient/nurse/summary-apply');
|
|
cy.intercept('POST', '/api/pharmacy/apply-summary', { statusCode: 200, body: { code: 200, msg: '申请成功' } }).as('applySummary');
|
|
cy.get('.apply-btn').click();
|
|
cy.wait('@applySummary');
|
|
|
|
cy.visit('/inpatient/pharmacy/dispensing');
|
|
cy.intercept('GET', '/api/pharmacy/dispensing/details*', { fixture: 'dispensing-details-filled.json' }).as('getDetails');
|
|
cy.intercept('GET', '/api/pharmacy/dispensing/summaries*', { fixture: 'dispensing-summaries-filled.json' }).as('getSummaries');
|
|
cy.wait(['@getDetails', '@getSummaries']);
|
|
|
|
cy.get('.detail-table tbody tr').should('have.length.greaterThan', 0);
|
|
cy.get('.summary-table tbody tr').should('have.length.greaterThan', 0);
|
|
cy.get('.detail-table tbody tr').first().find('.summary-id').should('not.be.empty');
|
|
});
|
|
});
|