1.0.3 • Published 1 year ago

parallel-testing v1.0.3

Weekly downloads
-
License
MIT
Repository
-
Last release
1 year ago

parallel-testing

Build Status

parallel-testing allows the execution of any test frameworks in parallel, dramatically reducing the execution time.

Usage

Install parallel-testing package

npm install parallel-testing --save-dev

Add parallel-testing command to package.json scripts

{
    ...,
    scripts: {
        ...,
        "e2e": "parallel-testing --threads=<NUMBER> --test-cmd='<STRING>' --task-prefix='<STRING>' --specs='<STRING>' --specs-separator='<STRING>' --after-all-cmd='<STRING>'",
    },
    ....
}
            [KEY_TASK_PREFIX]: '',
            [KEY_SPECS]: '',
            [KEY_THREADS]: '',
            [KEY_MAX_THREADS]: '',
            [KEY_AFTER_ALL_COMMAND]: ''

parallel-testing args options

OptionDescription
--test-cmdCommand used to run tests.

Add @SPECS as a placeholder in the command; it will be replaced with a comma-separated list of specs. Add @INSTANCE as a placeholder in the command; it will be replaced with a thread instance ID, useful for report directory names. | | --task-prefix | Prefix used for the logs. | | --specs | Test specs pattren, e.g: e2e/**/**.spec.js. | | --specs-separator |Test spec files separator delimiter, e.g: ,. | --threads | Number of parallel threads (Optional). | | --max-threads | Maximum number of parallel threads (Optional). | | --after-all-cmd | Command that runs after all tests are done. |


parallel-testing with

Cypress

Running Cypress e2e tests parallel, please check Cypress Demo. The demo covers how to generate HTML report with screenshots and videos.

TypeTotalThreads
Serial57.8171s1
Parallel24.9825s5

cypress-e2e

Puppeteer

Running Puppeteer e2e tests parallel, please check Puppeteer Demo. The demo covers how to generate HTML report with screenshots.

TypeTotalThreads
Serial16.6492s1
Parallel8.8565s5

puppeteer-e2e

NOTE: Tests for each framework are different; please don't use these numbers to compare between these testing frameworks.

The demo statistics are generated using the Gnomon tool.