Skip to main content

Using crusher-cli within project

When running crusher-cli for the first time, we need to link your project. You can choose to create a new project or set it up with an existing project.

Crusher seamlessly integrates with git-enabled projects.

Setting up

To get started, the first thing you need to do is initialize and link your project with crusher. To do that, go to your project directory and run this command,

$npx crusher-cli init

Running this command will start the following process,

  • You'll be asked to log in/sign up to link your crusher account
  • CLI will download and extract the latest version of the recorder
  • If you run this command in a non-git directory/project, you'll be asked to select a project.
Note:

During the setup, we will save configuration files at ~/.crusher/config.json (global config) and [project-dir]/.crusher/config.json (project config)

Creating a test

$npx crusher-cli test:create

This will open up the recorder where you can start recording your test. When you are done click on "Verify & Save".

Recommended:

If it's your first time with the recorder, try and finish the recorder onboarding to get an idea of everything crusher has to offer.

To know more about this command, check out this doc.

Running tests

$npx crusher-cli test:run

This will run all the tests present in your project and return the results after they are finished. This will be how it'll look,

To know more about this command, check this out.

Get info about the authenticated user

$npx crusher-cli whoami

If you ever forget which account you are connected to, you can run this command to find out your identity ๐Ÿค”

Get Info about crusher project

$npx crusher-cli info

This command will return crusher project info if you are inside a project connected to the crusher.

Logout

$npx crusher-cli logout

To log out, simply run this command.

Was this doc helpful?
yes
could be better
by