Package Exports
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@knapsack-pro/cypress) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
@knapsack-pro/cypress
Speed up your tests
Run your 1-hour test suite in 2 minutes with optimal parallelisation on your existing CI infrastructure
Knapsack Pro wraps the Cypress.io test runner and works with your existing CI infrastructure to parallelize tests optimally:
- Dynamically splits your tests based on up-to-date test execution data
- Is designed from the ground up for CI and supports all of them
- Tracks your CI builds to detect bottlenecks
- Does not have access to your source code and collects minimal test data
- Enables you to export historical metrics about your CI builds
- Replaces local dependencies like Redis with an API and runs your tests regardless of network problems
Installation
See the docs to get started:
Contributing
Requirements
>= Node 18.13.0 LTSYou can use NVM to manage Node versions in development.
Dependencies
Setup
Setup the @knapsack-pro/core project.
Follow the steps below or use the
bin/setup_developmentscript to take care of steps 2-5.Install the dependencies:
npm install $(npm bin)/cypress install
In order to use the local version of
@knapsack-pro/corerun:npm link @knapsack-pro/core
Compile the TypeScript code to the
libdirectory by running:npm startRegister the
@knapsack-pro/cypresspackage globally in your local system. This way we will be able to develop other npm packages dependent on it:npm link
Set up your IDE:
Visual Studio Code
Install the following plugins:
Go to
File > Preferences > Settings > Text Editor > FormattingTurn on
Format On Savecheckbox.
From now on, every change in the codebase will be automatically formatted by Prettier. ESLint shows errors and warnings in VSCode.
Write some code.
Testing
CI
If your feature requires code changes in @knapsack-pro/core, please push the @knapsack-pro/core to GitHub first. Then you can push changes for @knapsack-pro/cypress to ensure the CI will use the latest @knapsack-pro/core.
Cypress example test suite
To test @knapsack-pro/cypress against a real test suite we use the cypress-example-test-suite project.
Publishing
Sign in to the npm registry with:
npm adduserEnsure you have the latest version of
@knapsack-pro/coreinpackage.json:{ "dependencies": { "@knapsack-pro/core": "^x.x.x" } }
Run
npm install. This way you will be able to test@knapsack-pro/coreinstalled from npm registry instead of the local one that was linked withnpm link @knapsack-pro/core.Commit the updated
package.jsonandpackage-lock.json:git commit -am "Update @knapsack-pro/core"
Before releasing a new version of the package, please update
CHANGELOG.mdwithgithub_changelog_generator:gem install github_changelog_generator # generate CHANGELOG.md github_changelog_generator --user KnapsackPro --project knapsack-pro-cypress git commit -am "Update CHANGELOG.md" git push origin master
If you have added new files to the repository, and they should be part of the released npm package, please ensure they are included in the
filesarray inpackage.json.Compile the project:
# Ensure you use the local version of @knapsack-pro/core npm link @knapsack-pro/core npm run build
In order to bump the version of the package run the command below. It will also create a version commit and tag for the release:
# Bump patch version 0.0.x npm version patch # Bump minor version 0.x.0 npm version minor
Push the commit and tag:
git push origin master --tags
When the git tag is on Github, you can update
CHANGELOG.md:github_changelog_generator --user KnapsackPro --project knapsack-pro-cypress git commit -am "Update CHANGELOG.md" git push origin master
Publish the package to the npm registry:
npm publishUpdate the latest available library version in:
TestSuiteClientVersionCheckerfor the Knapsack Pro API repository.- cypress-example-test-suite