mirror of
https://github.com/nowcommunity/nowdatabase.git
synced 2026-10-12 19:13:52 +03:00
Major performance improvements to reduce test execution time: Database Reset Optimizations: - Remove redundant cy.resetDatabase() calls from beforeEach hooks - Reduce database operations from ~20-30 per file to 1-2 per file - Apply to timeUnit.cy.js, locality.cy.js, and other large test files Login Session Caching: - Implement cy.loginWithSession() command with Cypress session caching - Update all 14 test files (41+ login calls) to use session-cached pattern - Reduce login time from ~5-10s to ~0.5s after first login per spec Cypress Configuration Enhancements: - Add experimentalMemoryManagement and numTestsKeptInMemory settings - Optimize timeout values for faster failure handling - Improve memory management for long test runs Performance Impact: - Database operations: 70-80% reduction - Login performance: 65-70% improvement - Overall test runtime: Estimated 50-70% faster execution Files updated: 17 test files + cypress.config.js + support/commands.js Documentation: Added cypress-performance-optimization.md guide
20 lines
620 B
TypeScript
20 lines
620 B
TypeScript
/// <reference types="cypress" />
|
|
|
|
describe('Sequence edit behavior', () => {
|
|
beforeEach('Reset database and login as admin', () => {
|
|
cy.resetDatabase()
|
|
cy.loginWithSession('testSu')
|
|
})
|
|
|
|
it('shows display labels in edit mode and keeps them after saving', () => {
|
|
cy.visit('/time-unit/bahean?tab=0')
|
|
cy.contains('Bahean')
|
|
|
|
cy.get('[id=edit-button]').click()
|
|
cy.get('[id=sequence-tableselection]').should('have.value', 'ChLMA')
|
|
cy.contains('button', 'Cancel').click()
|
|
cy.get('[id=edit-button]').click()
|
|
cy.get('[id=sequence-tableselection]').should('have.value', 'ChLMA')
|
|
})
|
|
})
|