npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@shelex/cypress-wait-network

v1.0.3

Published

command for cypress to wait for network requests

Readme

@shelex/cypress-wait-network

SWUbanner

Deprecation notice

Users have reported that in recent Cypress versions (v12+) requests are not being tracked.
I can confirm that is happening due to internal changes in Cypress behavior and some functionality that this plugin relies on was removed.
Thus I see no reason in re-developing it.
In case you consider migrating to Cypress v12+ please replace this plugin with cypress-network-idle which utilizes intercept functionality instead of internals and should work fine and cover your use case.

Documentation

Plugin that adds cy.waitForNetwork command that ensures background network requests are finished You can also enable automatic waiting before every cy.get by setting env var waitForRequestsBeforeCyGet

Build Downloads semantic-release
version License

Installation

  • download package:

    • using yarn:
    yarn add -D @shelex/cypress-wait-network
    • using npm:
    npm i -D @shelex/cypress-wait-network
  • register command in cypress/support/index.js file:

    • with import:
    import '@shelex/cypress-wait-network';
    • or with require:
    require('@shelex/cypress-wait-network');
  • for IntelliSense (autocompletion) support in your IDE

    • add to your files:
    /// <reference types="@shelex/cypress-wait-network" />
    • or update your tsconfig.json include section:
    "include": [
        "cypress",
        "@shelex/cypress-wait-network",
    ]

Options

Command cy.waitForNetwork accepts an options object with such properties:

| property | description | default | | :-------- | :----------------------------------------------------- | :------------------------------------- | | timeout | timeout for requests loading (ms) | Cypress.config().responseTimeout (30s) | | idle | time to wait till network is recognized as idle (ms)* | 1000 ms |

* idle could be used to apply waiting strategy to your specific needs, as requests may be triggered after default idle is finished, usually caused by debouncing on front-end. By default command uses 1 second idle check which means in case there are no requests loading - it will wait minimum ~ 1s before finishing command, in case there are requests - it will reset timer until there would be at least 1 second when all responses are received, no other requests loading so we can treat network as idle.

Configuration

Plugin is customizable via Cypress environment variables:

| env variable name | description | default | | :--------------------------- | :------------------------------------------------- | :------ | | waitForRequestsBeforeCyGet | run waitForNetwork command before every cy.get | false |

This options could be passed:

  • via cypress.json

    {
        "env": {
            "waitForRequestsBeforeCyGet": true
        }
    }
  • via command line: as Cypress environment variables are used please take into account that cli should have only one argument --env or -e, otherwise values will not be passed

    ```bash
    yarn cypress run --env waitForRequestsBeforeCyGet=true
    
    # for windows:
    yarn cypress run --env  "waitForRequestsBeforeCyGet=true","otherEnvVar=value"
    ```

Credits

Inspired by Gleb Bahmutov [email protected] who made cypress-network-idle plugin that has same purpose. Moreover command cy.waitForNetworkIdle(2000) from cypress-network-idle is quite same as cy.waitForNetwork({ idle: 2000 }) from this package, first is based on interception and counters, this package just checks requests and responses from cy.state

License

Copyright 2021-2023 Oleksandr Shevtsov [email protected].
This project is licensed under the MIT License.