For the complete documentation index, see llms.txt. This page is also available as Markdown.

Running Tests

Start test cases and suites in CloudBeat from the command line and get JUnit XML reports

The commands on this page are typically used from a CI/CD pipeline; see CI/CD Pipeline for the pipeline setup. They expect the API key to be available as an option, an environment variable or a stored login.

start

Executes the specified test case or suite, waits for the run to finish, and produces an XML report in JUnit format. The exit code is 0 when the test execution succeeds and 1 otherwise.

cloudbeat-cli start <testType> <testId> [options]

Arguments:

  • testType - either case or suite.

  • testId - the id of the test case or suite. With --project, its name.

Options:

  • --project <projectName> - project name. If specified, <testId> is the case or suite name instead of an id.

  • --tags <tags> - comma separated tags; only tests marked with them are executed. Works with suites only, and overrides the tags selected in the CloudBeat UI.

  • -e, --env <environmentName> - the environment to use for the execution. It must already exist in CloudBeat for the project.

  • --envId <environmentId> - the same, by environment id.

  • -a, --attr <attributes> - comma separated name-value pairs passed to the test scripts, e.g. foo=bar,baz=qux. Available to the tests as the attributes property.

  • --release <releaseName> - name of the release or version to associate with the test result.

  • --build <buildName> - name of the build to associate with the test result. Requires --release.

  • --format <junit> - report format. Currently only junit is supported.

  • --suffix <time|id> - suffix for the report file name.

  • --folder <folder> - directory where the report is saved. Default: the current working directory.

  • --silent - do not print test progress details.

Examples:

Execute a test case by its id, using a named environment and passing attributes to the test:

Execute a test case by its name (the project name is required as well):

Execute only the tests of a suite which are marked with the given tags:

Pass the API key explicitly instead of using CB_API_KEY or a stored login:

run-status

Retrieves the status of a run which is currently executing:

run-result

Retrieves the result data of a finished run:

Last updated

Was this helpful?