🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
DemoInstallSign in
Socket

cypress-runner-themes

Package Overview
Dependencies
Maintainers
0
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cypress-runner-themes

Alternative themes for the Cypress Test Runner

1.0.3
latest
Source
npm
Version published
Weekly downloads
665
-28.95%
Maintainers
0
Weekly downloads
 
Created
Source

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

Keywords

cypress

FAQs

Package last updated on 11 Jan 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts