65 lines
2.7 KiB
TypeScript
Executable File
65 lines
2.7 KiB
TypeScript
Executable File
import { describe, it, cy } from 'cypress'
|
|
|
|
describe('Bug Regression Tests', () => {
|
|
// 历史回归用例占位...
|
|
it('should pass existing regression tests', () => {
|
|
cy.log('Existing regression suite placeholder')
|
|
})
|
|
})
|
|
|
|
// @bug562 @regression
|
|
describe('Bug #562: 门诊医生工作站-待写病历加载性能', () => {
|
|
it('待写病历列表应在2秒内完成加载并渲染', () => {
|
|
// 拦截待写病历接口,模拟真实网络请求
|
|
cy.intercept('GET', '/api/orders/pending*').as('getPendingOrders')
|
|
|
|
cy.login('doctor1', '123456')
|
|
cy.visit('/outpatient/doctor-workstation')
|
|
|
|
// 点击待写病历Tab
|
|
cy.get('[data-cy="tab-pending-records"]').click()
|
|
|
|
// 记录开始时间并等待接口响应
|
|
const startTime = Date.now()
|
|
cy.wait('@getPendingOrders', { timeout: 2000 }).then((interception) => {
|
|
const loadTime = Date.now() - startTime
|
|
expect(interception.response?.statusCode).to.eq(200)
|
|
expect(loadTime).to.be.lessThan(2000, `接口响应耗时 ${loadTime}ms 超过2秒阈值`)
|
|
})
|
|
|
|
// 验证数据渲染完成且加载状态已清除
|
|
cy.get('[data-cy="records-table"]').should('be.visible')
|
|
cy.get('[data-cy="loading-spinner"]').should('not.exist')
|
|
})
|
|
})
|
|
|
|
// @bug503 @regression
|
|
describe('Bug #503: 住院发退药明细与汇总单数据同步', () => {
|
|
it('需申请模式下,执行医嘱后明细与汇总均不显示;提交汇总申请后两者同步显示', () => {
|
|
// 1. 护士执行医嘱
|
|
cy.login('wx', '123456')
|
|
cy.visit('/nurse-station/ward-orders')
|
|
cy.get('[data-cy="execute-order-btn"]').first().click()
|
|
cy.get('[data-cy="confirm-execute"]').click()
|
|
|
|
// 2. 切换至药房验证:需申请模式下,执行后明细和汇总均应为空
|
|
cy.login('yjk1', '123456')
|
|
cy.visit('/pharmacy/inpatient-dispensing')
|
|
cy.get('[data-cy="dispensing-detail-table"]').should('not.contain.text', '盐酸普罗帕酮注射液')
|
|
cy.get('[data-cy="dispensing-summary-table"]').should('not.contain.text', '盐酸普罗帕酮注射液')
|
|
|
|
// 3. 切换回护士站提交汇总发药申请
|
|
cy.login('wx', '123456')
|
|
cy.visit('/nurse-station/summary-dispensing')
|
|
cy.get('[data-cy="select-all-orders"]').click()
|
|
cy.get('[data-cy="submit-summary-btn"]').click()
|
|
cy.get('[data-cy="submit-success-toast"]').should('be.visible')
|
|
|
|
// 4. 再次切换至药房验证:提交申请后,明细单与汇总单必须同步出现
|
|
cy.login('yjk1', '123456')
|
|
cy.visit('/pharmacy/inpatient-dispensing')
|
|
cy.get('[data-cy="dispensing-detail-table"]').should('contain.text', '盐酸普罗帕酮注射液')
|
|
cy.get('[data-cy="dispensing-summary-table"]').should('contain.text', '盐酸普罗帕酮注射液')
|
|
})
|
|
})
|