Metadata-Version: 2.4
Name: testery
Version: 1.17.3
Summary: Testery CLI
Home-page: https://github.com/testery/testery-cli
Author: Testery
Author-email: chris.harbert@testery.io
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: Click
Requires-Dist: requests>=2.28.0
Requires-Dist: requests_toolbelt
Requires-Dist: python-dateutil
Requires-Dist: python-dotenv
Dynamic: author
Dynamic: author-email
Dynamic: classifier
Dynamic: description
Dynamic: description-content-type
Dynamic: home-page
Dynamic: license-file
Dynamic: requires-dist
Dynamic: summary

# Testery CLI

To install you must have Python 3 and pip installed, then run:

`pip install testery`

Upgrade via

`pip install testery --upgrade`

## Authentication

Most commands need a Testery API token. The CLI resolves it in this order:

1. `--token <value>` on the command line
2. The profile named by `--profile <name>` in `~/.testery/credentials`
3. The `[default]` profile in `~/.testery/credentials`
4. The `TESTERY_API_TOKEN` environment variable

The credentials file is INI-style:

```
[default]
token = your-token-here

[dev]
token = a-different-token
```

### Login

The easiest way to populate the credentials file is the `login` command, which
opens the Testery app in your browser. Navigate to **Settings > Integrations**
to find or create an API token, then paste it back into the prompt (a URL
containing `?token=...` is also accepted):

```bash
testery login                  # saves to [default]
testery login --profile dev    # saves to [dev]
```

## Create Test Run

Starts a test run.

```bash
testery create-test-run --token <yourTesteryApiToken> --project <projectKeyFromTestery> --build-id <uniqueBuildIdOfYourChoice> --environment <environmentToBeTested> --wait-for-results
```

When set, `--fail-on-failure`, will return an exit code of 1 if there are test failures.

### Output Formats

- teamcity
- pretty
- json
- appveyor
- octopus

## Create Test Environment

Creates an environment where tests may be run.

```bash
testery create-environment --token "<your_Testery_Api_Token>" --key "<key>" --name "<name>" --variable "KEY1=FOO1" --variable "KEY2=FOO2" --variable "secure:KEY3=SECRET" --pipeline-stage "<pipeline_stage_name>"
```

## Update Test Environment

Updates an environment where tests are run with some new variables or pipeline stage.

```bash
testery update-environment --token "<your_Testery_Api_Token>" --key "<key>" --name "<name>" --variable "KEY1=FOO1" --variable "KEY2=FOO2" --pipeline-stage "<pipeline_stage_name>"
```

## Add environment variables from .env file

Takes in a .env file and adds or overwrites variables in target environment.

```bash
testery add-env-vars-from-file --token "<your_Testery_Api_Token>" --environment-key "<key>" --env-file "<path/to/file/.env>" --overwrite
```

## Update Test Stage

Updates or creates a pipeline stage where tests are run with some new variables.

```bash
testery update-pipeline-stage --token "<your_Testery_Api_Token>" --name "<name>" --variable "KEY1=FOO1" --variable "KEY2=FOO2" --create-if-not-exists
```

## Add Pipeline Stage variables from .env file

Takes in a .env file and adds or overwrites variables in target Pipeline.

```bash
testery add-stage-vars-from-file --token "<your_Testery_Api_Token>" --name "<name>" --env-file "<path/to/file/.env>" --overwrite
```
