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 🙏

© 2024 – Pkg Stats / Ryan Hefner

cypress-runner-themes

v1.0.1

Published

Alternative themes for the Cypress Test Runner

Downloads

281

Readme

cypress-runner-themes

Alternative themes for the Cypress Test Runner for Cypress v10+.

Currently supports dark-mode, light-mode and colorblind-mode.

Heavily inspired by cypress-dark and cypress-light-theme but all in one package.

Feel free to suggest/create additional themes. As the test runner changes over-time, the themes may break unexpectedly. For any issues please let us know. Thanks!

Themes

Dark

Light

Colorblind (Red/Green)

The three main types of color blindness are

  • Deutan (red/green)
  • Protan (red/green)
  • Tritan (blue/green and yellow/red)

By replacing green with yellow, now the Cypress test results will show up as

  • Yellow (passing)
  • Red (failing)
  • Blue (skipped)

This color combination addresses those with Deutan and Protan color-blindness. Those with sensitivity to red/yellow should keep the default Cypress test result colors.

If there is another case that isn't covered please let me know and I will add a theme for it.

Install

npm install --save-dev cypress-runner-themes

Use

To enable any of the themes, set the theme env var in your cypress.config.js file.

The acceptable theme values are dark, light, and colorblind.

"env": {
    "theme": "dark",
}

After, require the plugin in your support/e2e.js file

import "cypress-runner-themes";

Finally, the next time you run a test the theme will be applied.

Unfortunately, there's no hook to inject the theme into the test runner without running a test first. Hoping that changes in the future.

Development

For local development, install all dependencies (npm install) and change the getThemesFolder under src/utils to point toward the local css files.

const getThemesFolder = () => "src/themes"; // Enable for local development

Next, change the theme env var within the cypress.config.js to whatever you are testing.

Finally, run the cypress test runner npm run cy:open.

TODO

  • [ ] Apply theme on runner load, not before a test begins
  • [ ] Support cypress-plugin-api
  • [ ] Remove "Colorblind" as explicit theme and allow toggle ability within runner
  • [ ] Migrate over the fun Halloween mode from cypress-dark