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-parallel-extended-filtering

v0.3.0

Published

Fork of https://github.com/tnicola/cypress-parallel.git, Reduce up to 40% your Cypress suite execution time parallelizing the test run on the same machine.

Downloads

19

Readme

npm version

cypress-parallel

Fork of cypress-parallel:

  • Allows to disable included reporter when using mochawesome report generator, multi reporter and mochawesome-merge.
  • Adds spliting tests by text included in test file -S=@test,@second (grep tag, name...)

Reduce up to 40% your Cypress suite execution time parallelizing the test run on the same machine.

| cypress | cypress-parallel | | :-----------------------------------------------------------------------------------------------------------------------: | :-------------------------------------------------------------------------------------------------------------------------: | | cy-serial-small | cy-parallel_small |

Run your Cypress tests in parallel (locally)

How it works

🔍 - Search for existing Cypress tests
📄 - Read (if exists) a weight file
⚖️ - Split spec files into different threads
⚙️ - For each thread it runs the Cypress command you've passed as argument
📈 - Wait for all threads to finish and collects the result in a single report

How to use

Install

npm i cypress-parallel -D

or

yarn add cypress-parallel -D

Add a new script

In your package.json add a new script:

"scripts" :{
  ...
  "cy:run": "cypress run", // It can be any cypress command with any argument
  "cy:parallel" : "cypress-parallel -s cy:run -t 2 -d '<your-cypress-specs-folder>' -a '\"<your-cypress-cmd-args>\"'"
  ...
}

With Arguments

Sample:

-a '\"--config baseUrl=http://localhost:3000\"'

Launch the new script

npm run cy:parallel

or

Run with npx (no package installation needed)

npx cy:parallel -s cy:run -t 2 -d '<your-cypress-specs-folder>' -a '"<your-cypress-cmd-args>"'

Scripts options

| Option | Alias | Description | Type | | ----------------- | ----- | ---------------------------------- | ------ | | --help | | Show help | | | --version | | Show version number | | | --script | -s | Your npm Cypress command | string | | --args | -a | Your npm Cypress command arguments | string | | --threads | -t | Number of threads | number | | --specsDir | -d | Cypress specs directory | string | | --weightsJson | -w | Parallel weights json file | string | | --reporter | -r | Reporter to pass to Cypress. | string | | --reporterOptions | -o | Reporter options | string | | --reporterModulePath | -n | Specify the reporter module path | string | | --disableParallelReporter | -f | Disable included reporter | boolean | | --bail | -b | Exit on first failing thread | string | | --verbose | -v | Some additional logging | string | | --strictMode | -m | Add stricter checks after running the tests | boolean | | --splitByText | -S | Split test by text included in the file | string[] |

NB: If you use cypress-cucumber-preprocesor, please disable the strictMode to avoid possible errors:

"scripts" :{
  ...
  "cy:parallel" : "cypress-parallel -s cy:run -t 4 -m false"
  ...
}

NB: If your cypress-multi-reporters module is not found on the same level as your Cypress suite (e.g. in a mono-repo) then you can specify the module directory for Cypress to search within.

"scripts" :{
  ...
  "cy:parallel" : "cypress-parallel -s cy:run -t 4 -n .../../../node_modules/cypress-multi-reporters"
  ...
}

NB: If you disbaled included reporter, then use following config and actions after getting results in json from mochawesome reporter.

 reporterOptions: {
  ...
  saveJson: true
  saveHtml: false
  ...
}
"scripts" :{
  ...
  "cy:merge-json": "mocahwsome-merge <jsonsPath/*.json> -o <output>"
  "cy:generate-html": "marge <jsonPath> -o=<outputHTMLPath> -i" 
  ...
}

Env variables

CYPRESS_THREAD

You can get the current thread index by reading the CYPRESS_THREAD variable.

 const threadIndex = process.env.CYPRESS_THREAD;
 // return 1, 2, 3, 4, ...

Contributors

Looking for contributors.

License

This project is licensed under the MIT license. See LICENSE.