47 lines
1.9 KiB
TypeScript
Executable File
47 lines
1.9 KiB
TypeScript
Executable File
import { describe, it, cy } from 'cypress'
|
|
|
|
describe('Bug Regression Tests', () => {
|
|
beforeEach(() => {
|
|
cy.clearCookies()
|
|
cy.clearLocalStorage()
|
|
})
|
|
|
|
/**
|
|
* @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', '执行成功')
|
|
|
|
// 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', '待配药')
|
|
|
|
// 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', '申请成功')
|
|
|
|
// 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)
|
|
})
|
|
})
|
|
})
|