This package has been archived and is no longer maintained. While we will not provide any updates or support, the code is still available for reference. If you need this package for your project, we encourage you to fork & republish the code following the license terms.
Installation • Usage • Contributors • License
- Install the package
yarn add --dev @devoxa/cypress-wait-for-network-idle
The package also has a peer dependency on cypress@^7.3.0
.
- Import the command in
cypress/support/commands.ts
:
import { addWaitForNetworkIdleCommand } from '@devoxa/cypress-wait-for-network-idle/command'
addWaitForNetworkIdleCommand()
describe('SignInPage', () => {
it('waits for network requests', () => {
cy.waitForNetworkIdlePrepare()
cy.visit('/sign-in')
cy.waitForNetworkIdle()
})
it('waits for network requests that have a delay between them', () => {
cy.waitForNetworkIdlePrepare()
cy.visit('/sign-in')
cy.waitForNetworkIdle({ minIdleTime: 500 })
})
})
Additional available options:
timeout
: The maximum time (in ms) to wait for the network to idle, defaults to2000
minIdleTime
: The time (in ms) to wait for another request after network activity ceases, defaults to200
Thanks goes to these wonderful people (emoji key):
David Reeß 💻 📖 |
This project follows the all-contributors specification. Contributions of any kind welcome!
MIT