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

cypress-daywalker

v0.2.1

Published

Shadow dom support for cypress

Downloads

20

Readme

Cypress Daywalker

Gitter

Use Cypress Daywalker to test your web components (Polymer, lit-html, ...) app.

Please star this repo if you use this plugin. This helps me to understand how many people it is useful for and motivates me to continue improving it.

Installation

1. Install the dependency

Add the plugin to your devDependencies

npm install -D cypress-daywalker

2. Add daywalker commands

At the top of cypress/support/commands.js:

import 'cypress-daywalker/commands'

3. Add the Daywalker script

You need to inject cypress-daywalker.js into your application's entrypoint. This can happen by manually or dynamically adding a script tag to your entrypoint file. (If you test a built app, don't forget to add 'node_modules/cypress-daywalker/cypress-daywalker.js' as an extra dependency.)

Via a static script tag

This is the easiest way: At the top of your entrypoint file e.g. index.html add the following script tag.

  <!-- Eventually adjust the path to your node modules -->
  <script src="./node_modules/cypress-daywalker/cypress-daywalker.js"></script>

Via a dynamic script tag

You might want to avoid that the script tag ends up in a production environment. Therefore, you can inject the script tag into your document before any other javascript gets executed by listening to the window:before:load event.

context('Default', () => {
  before(() => {

    // INJECT THE SCRIPT LIKE THIS:
    cy.on('window:before:load', (w) => {
      const script = w.document.createElement('script');
      
      // Eventually adjust the path to your node modules
      script.src = '/node_modules/cypress-daywalker/cypress-daywalker.js';
      
      // // If you cannot reach your node_modules folder easily (e.g. in a Java application), try to load it via a cdn.
      // script.src = 'https://cdn.jsdelivr.net/gh/jaysunsyn/[email protected]/cypress-daywalker.js';
      
      
      w.document.querySelector('head').appendChild(script);
    });

    cy.visit('http://localhost:3000/');
  });
  it('input gets filled', () => {
    // Test stuff
  });
});

Usage

Find an example here.

Not all CSS selectors are supported yet, so do not use it as you would use jQuery or the usual querySelector command. Please create issues of use cases where you would like better querying functionalities. For the apps this plugin was developed for, the current functionalities worked pretty well.

Query

By default, cy.dwGet returns the first found node. If you want it to return any other one, there are two options:

nth

  1. cy.dwGet('my-element', {nth: 2})
  2. cy.dwGet(paper-input:nth(3) input')

If you want to retrieve all results, add the all flag like this cy.dwGet('my-element', {all: true}).

By Tag

This works very well.

cy.dwGet('paper-button')

By ID

This works very well.

cy.dwGet('#submit')
cy.dwGet('paper-button#submit')

By Class

Find custom elements everywhere in the app or native elements at root level.

cy.dwGet('.foo')
cy.dwGet('.foo.moo')

By Direct Parent

<div class="find-me">
  <paper-button></paper-button>
</div>
<paper-button></paper-button>
cy.dwGet('.find-me > paper-button')

By path

Starting from the root level:

cy.dwGet('div my-element paper-input#important')

or starting from any custom element:

cy.dwGet('my-element div#jay')

Starting a path with a native element which is inside a shadow root is not supported.

Lazy loaded components

If you lazy load some components, you can, for example, add a .wait(500) to your .visit() command to wait for them to get available.

Commands

Not all cypress commands can be used yet. For some, there are replacements below.

Click

Instead of .click() use:

cy.dwGet('paper-button').dwDispatch('click') // Results in Event('click')
cy.dwGet('paper-button').dwDispatch(new MouseEvent('click')) // Or pass in any other event

Type

Instead of .type('Hello world') use:

cy.dwGet('paper-input').dwSetProp('moto moto') // Results in the value property gets set
cy.dwGet('paper-input').dwSetProp('Question', 'label') // Or specify the property name

Invoke

Instead of .invoke() use:

cy.dwGet('my-el').dwCall('close')

Should

Before using .should() you need to attach the node.

When a node gets attached, it gets cloned and appended to the body. When detatching, this clone gets removed.

Be aware that after attaching, you interact with a cloned node and not with the original one.

cy.dwGet('div > paper-button span').dwAttach().should('have.text', 'Click').dwDetach();

Contributors

CI

See the latest tests of the example https://travis-ci.com/JaySunSyn/cypress-daywalker/builds/