Skip to content

mandric/mainflux-e2e-bats

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 

Repository files navigation

Setup

  1. Install bats-core test runner, this provides the bats executable.

  2. Install Mainflux via Docker or use BASE_URL to point to an existing installation.

  3. Clone this repository and cd into it.

Run tests

Create random user profile and export TOKEN env variable:

export TOKEN="$(./register)"

Then run all tests in the current directory:

bats .

Environment Variables

Variable Description Default
BASE_URL Base URL of the HTTP API https://localhost
TOKEN Authorization token for HTTP API empty string

Example specifying base URL on command line:

BASE_URL=https://localhost:8000 bats .

Register Usage

The register script can be used to create specific account and get an authorization token. By default the email and password will be randomly generated.

$ ./register
eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE1NTc5MDMwMjksImlhdCI6MTU1Nzg2NzAyOSwiaXNzIjoibWFpbmZsdXgiLCJzdWIiOiJtZUBleGFtcGxlLmNvbSJ9.McLnP2hf676POaLvu5UI1O6b_ZFOiGxDIgJaMwIXmm8

Then export token to use in tests:

export TOKEN=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE1NTc5MDMwMjksImlhdCI6MTU1Nzg2NzAyOSwiaXNzIjoibWFpbmZsdXgiLCJzdWIiOiJtZUBleGFtcGxlLmNvbSJ9.McLnP2hf676POaLvu5UI1O6b_ZFOiGxDIgJaMwIXmm8

Environment Variables

Variable Description Default
EMAIL Email address [10 random characters]@example.com
PASS Password 10 random characters

Example specifying email and password on command line:

[email protected] PASS=secret ./register

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages