# Delphi's Automation Repository (delphi-api-qa-automation)

## Available Params
The following are available overrides for running test suites. You can pass them using `-J`:

```bash
jmeter -n -t ${TEST_SUITE_FILE} -Jenv=${ENV} -JhostName=${ENV_HOST}
```

### delphi-api-testsuite-v3.jmx

  - `env` (default: `stage`)
  - `hostName` (default: `stage-delphi-api-ext.delphiplatform.io`)
  - `credentialsFile` (default: `envs/auth-credentials.stage.csv`)

## Running Shell Files
### Prerequisites
You'll need to have your public key on the box (devops).

### Prerequisites
#### Create an SSH config file
Edit (or create) an `~/.ssh/config` file with a host named `delphi-qa`.

Example:

```bash
Host delphi-qa
    HostName 3.87.110.40
    User ubuntu
    IdentityFile ~/.ssh/YOUR_KEY_FILE_NAME.pem
```

#### Create auth-credentials.csv file
1. Copy the file in `envs/` named `auth-credentials.stage.example.csv` to a new file `auth-credentials.stage.csv` 
(just remove `.example`).
2. Update the fields with credentials for the environment you are testing.

### Run the test suite locally
You'll want to check the suite file name set in the `run-tests.sh` file first,
or pass the test suite name you want to run as the first argument:

```bash
./run-tests.sh sma-api-test-suite-v3.1.0.jmx
```

### Run the test suite remotely
This script will:

  1. Upload config, test suite, test runner, and credentials files to the QA box
  2. Run the test suite
  3. Download the reports to your machine


```bash
./run-tests-remote.sh sma-api-test-suite-v3.1.0.jmx
```

## Reporting
If you have completed the Prerequisites in Running Shell Files below, you can download the reports for each run:

```bash
./download-reports.sh
```
