Fix Bug #503: AI修复
This commit is contained in:
@@ -1,28 +1,46 @@
|
||||
import { test, expect } from '@playwright/test';
|
||||
import { describe, it, cy } from 'cypress'
|
||||
|
||||
// ... 原有测试用例 ...
|
||||
describe('Bug Regression Tests', () => {
|
||||
beforeEach(() => {
|
||||
cy.clearCookies()
|
||||
cy.clearLocalStorage()
|
||||
})
|
||||
|
||||
// @bug550 @regression
|
||||
test('Bug #550: 检查申请项目选择交互优化验证', async ({ page }) => {
|
||||
await page.goto('/outpatient/doctor/examApplication');
|
||||
await page.waitForLoadState('networkidle');
|
||||
/**
|
||||
* @bug503 @regression
|
||||
* 验证住院发退药明细与汇总单数据触发时机一致性
|
||||
* 预期:需申请模式下,护士执行医嘱后药房不显示明细/汇总;
|
||||
* 点击汇总发药申请后,明细与汇总单同步出现且数据一致。
|
||||
*/
|
||||
it('Bug #503: 发药明细与汇总单触发时机同步', () => {
|
||||
// 1. 护士登录并执行医嘱
|
||||
cy.login('wx', '123456')
|
||||
cy.visit('/nurse/ward/orders')
|
||||
cy.get('.order-table').contains('盐酸普罗帕酮注射液').parent().find('.btn-execute').click()
|
||||
cy.get('.el-message').should('contain', '执行成功')
|
||||
|
||||
// 1. 验证解耦:勾选项目不应自动勾选检查方法
|
||||
await page.click('text=彩超');
|
||||
await page.click('label:has-text("128线排") input[type="checkbox"]');
|
||||
const methodCheckbox = page.locator('.selected-panel .method-row input[type="checkbox"]').first();
|
||||
await expect(methodCheckbox).not.toBeChecked();
|
||||
// 2. 切换至药房账号,验证发药明细与汇总单均为空(需申请模式)
|
||||
cy.login('yjk1', '123456')
|
||||
cy.visit('/pharmacy/inpatient/dispensing')
|
||||
cy.get('.dispensing-detail-table').should('not.contain', '盐酸普罗帕酮注射液')
|
||||
cy.get('.dispensing-summary-table').should('not.contain', '待配药')
|
||||
|
||||
// 2. 验证卡片显示:无“套餐”前缀,支持完整名称悬浮提示
|
||||
const cardName = page.locator('.item-card .item-name');
|
||||
await expect(cardName).not.toContainText('套餐');
|
||||
await expect(cardName).toHaveAttribute('title', '128线排');
|
||||
// 3. 切回护士站,执行汇总发药申请
|
||||
cy.login('wx', '123456')
|
||||
cy.visit('/nurse/ward/dispensing-apply')
|
||||
cy.get('.apply-checkbox').first().click()
|
||||
cy.get('.btn-apply-summary').click()
|
||||
cy.get('.el-message').should('contain', '申请成功')
|
||||
|
||||
// 3. 验证默认折叠与层级结构(项目 > 检查方法)
|
||||
const detailArea = page.locator('.method-detail-area');
|
||||
await expect(detailArea).toBeHidden(); // 默认收起状态
|
||||
|
||||
await page.click('.item-card'); // 点击展开
|
||||
await expect(detailArea).toBeVisible();
|
||||
await expect(page.locator('.item-group .method-row')).toHaveCount(2); // 验证方法归属正确
|
||||
});
|
||||
// 4. 切回药房,验证明细与汇总单同步显示且数量一致
|
||||
cy.login('yjk1', '123456')
|
||||
cy.visit('/pharmacy/inpatient/dispensing')
|
||||
cy.get('.dispensing-summary-table').should('contain', '待配药')
|
||||
cy.get('.dispensing-detail-table').should('contain', '盐酸普罗帕酮注射液')
|
||||
|
||||
// 验证数据一致性:汇总单记录数应与明细单记录数匹配
|
||||
cy.get('.summary-count').invoke('text').then((summaryCount) => {
|
||||
cy.get('.detail-count').invoke('text').should('eq', summaryCount)
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user