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

43 lines
1.9 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, expect } from 'vitest';
import { mount } from '@vue/test-utils';
// 假设项目已配置 Cypress 或 Playwright 用于 E2E此处使用标准 Cypress 语法结构
// 实际运行环境请根据项目测试框架调整断言语法
describe('HIS System Regression Tests', () => {
// ... 原有测试用例 ...
// 新增 Bug #566 回归测试
describe('Bug #566 Regression', { tags: ['@bug566', '@regression'] }, () => {
it('should render vital signs data points on temperature chart and sync table after save', () => {
// 1. 登录并进入模块
cy.login('wx', '123456');
cy.visit('/inpatient/nurse/temperature-chart');
// 2. 选择患者并打开录入弹窗
cy.get('[data-testid="patient-select"]').click();
cy.contains('123').click();
cy.get('[data-testid="add-vital-sign-btn"]').click();
// 3. 录入生命体征数据
cy.get('[data-testid="vital-date"]').type('2026-05-20');
cy.get('[data-testid="vital-time"]').select('06:00');
cy.get('[data-testid="vital-temp"]').type('38.6');
cy.get('[data-testid="vital-hr"]').type('89');
cy.get('[data-testid="vital-pulse"]').type('45');
// 4. 保存并验证成功提示
cy.get('[data-testid="save-btn"]').click();
cy.get('.el-message--success').should('contain', '保存成功');
// 5. 验证图表区域渲染ECharts Canvas 存在且可见)
cy.get('[data-testid="temperature-chart"]').should('be.visible');
cy.get('canvas').should('exist');
// 6. 验证下方表格区域同步显示录入数值
cy.get('[data-testid="vital-table"]').contains('38.6').should('be.visible');
cy.get('[data-testid="vital-table"]').contains('89').should('be.visible');
cy.get('[data-testid="vital-table"]').contains('45').should('be.visible');
});
});
});