30 lines
999 B
TypeScript
Executable File
30 lines
999 B
TypeScript
Executable File
import { describe, it, beforeEach } from 'cypress'
|
|
|
|
describe('Bug Regression Tests', () => {
|
|
beforeEach(() => {
|
|
cy.clearCookies()
|
|
cy.clearLocalStorage()
|
|
})
|
|
|
|
// ... 其他已有回归测试用例 ...
|
|
|
|
// @bug562 @regression
|
|
it('Bug #562: 待写病历数据加载时间应小于2秒且无持续加载状态', () => {
|
|
cy.login('doctor1', '123456')
|
|
cy.visit('/outpatient/pending-medical-record')
|
|
|
|
const startTime = Date.now()
|
|
|
|
// 验证加载状态出现后迅速消失
|
|
cy.get('[data-cy="pending-record-table"]').should('be.visible')
|
|
cy.get('[data-cy="loading-spinner"]').should('not.exist')
|
|
|
|
const loadTime = Date.now() - startTime
|
|
expect(loadTime).to.be.lessThan(2000, `加载耗时 ${loadTime}ms 超过 2 秒限制`)
|
|
|
|
// 验证分页组件已渲染,说明数据已按需加载
|
|
cy.get('.el-pagination').should('be.visible')
|
|
cy.get('[data-cy="pending-record-table"] tbody tr').should('have.length.greaterThan', 0)
|
|
})
|
|
})
|