@testkit-labs/cli
v0.1.3
Published
Testkit CLI
Downloads
2
Readme
Testkit CLI Beta
The Testkit CLI allows you to run your Cypress tests in the cloud in parallel across multiple browsers and versions. Don't have an account yet? Create an account and get a 14-day free trial
Testkit and the CLI are currently in Beta. If you have any problems, questions or feedback, feel free to create an issue or contact us at [email protected]
Documentation
You can find the documentation for Cypress here: docs.testkit.app/docs/cypress
Installation
You can install the Testkit CLI globally like this:
npm i -g @testkit-labs/cli@latest
After the installation, you can use the CLI by typing testkit
in your terminal.
Try this in your terminal:
testkit --version
Configuration
You can generate an initial configuration with testkit cypress init
.
This will ask you the most important questions and generate a testkit.json
file in the current working directory.
Example testkit.json
:
{
"org": "<Your Organization ID>",
"parallel": 1,
"browsers": ["chrome"],
"additional-dependencies": [],
"cypressFolder": "cypress",
"cypressConfig": "cypress.{config.{js,ts},json}",
"specFiles": "cypress/{integrations,e2e}/**/*.{spec|test|e2e|integration}.{js,ts}"
}
Options
org
(required): The organization ID of your Testkit account.parallel
(optional): The number of parallel workers. Defaults to 1.browsers
(optional): The browsers to run the tests in. Defaults tochrome
. Possible values arechrome
,firefox
,edge
.additional-dependencies
(optional): An array of additional dependencies to install. These are usually dependencies you are using inside the cypress folder (e.g. plugins). You can specify the version with @1.0.0. (e.g."@cypress/foo@^1.1.0"
)cypressFolder
(optional): The name of the folder containing your cypress tests. Defaults tocypress
.cypressConfig
(optional): The name of the cypress config file, can be a glob. Defaults tocypress.{config.{js,ts},json}
.specFiles
(optional): The glob pattern to match the spec files. Defaults tocypress/{integrations,e2e}/**/*.{spec|test|e2e|integration}.{js,ts}
.
Running the tests
In the same working directory as your testkit.json, you can run the tests with testkit cypress run
.
You can overwrite configuration options or defaults with flags.
For example:
testkit cypress run --parallel 2 --browsers firefox
Flags
Flags can overwrite configuration options or defaults. If you have a value specified in the testkit.json
, this will be used as default.
-o, --org=<value>
- (required) The organization id (find this in the menu on the left in the Testkit app)-c, --config=<value>
- (required) Path to the testkit config file, defaults totestkit.json
-C, --cypressConfig=<value>
- (optional) The path to the cypress config file, defaults tocypress.{config.{js,ts},json}
-b, --browsers=<value>
- (optional) Browsers to run the tests in, comma separated. Available: chrome,firefox,edge-d, --additionalDependencies=<value>
- (optional) Additional npm dependencies to install before running tests (comma seperated). This is usually every package you use in your tests.-f, --cypressFolder=<value>
- (optional) The path to the cypress directory, defaults to the cypress directory where the testkit config file is located-p, --parallel=<value>
- (optional) The number of parallel runners, defaults to 1-s, --specFiles=<value>
- (optional) The path to the spec files, defaults to cypress/{integrations,e2e}/**/*.{spec|test|e2e|integration}.{js,ts}
Troubleshooting
If you have any unexpected errors or problems with the CLI, feel free to create a new issue or just contact us at [email protected], and we'll try our best to help you.