asayer-cli
Asayer CLI
Installation:
npm i -g @asayer/asayer-cli
Usage:
$ asayer --help
Usage: asayer [options] [command]
_ _ ____ _ ___
/ \ ___ __ _ _ _ ___ _ __(_) ___ / ___| | |_ _|
/ _ \ / __|/ _` | | | |/ _ \ '__| |/ _ \ | | | | | |
/ ___ \\__ \ (_| | |_| | __/ |_ | | (_) | | |___| |___ | |
/_/ \_\___/\__,_|\__, |\___|_(_)|_|\___/ \____|_____|___|
|___/
Options:
-V, --version output the version number
-t, --token <token> your user token from Asayer, override the configured token if present
-u, --url <url> custom test url
-T, --tests <test1,test2,...> a list containing test names or ids to be executed separated by comma ","
-r, --report <path> where to save your report (path to xml file)
-i, --interactive use interactive mode
-d, --debug debug console errors
-h, --help output usage information
Commands:
setup [options] Configure your Asayer CLI
local [options] Uses a local server for asayer onpremise
docker [options] Configure docker for local testing
Command's help:
$ asayer [command] --help
Examples:
$ asayer setup --help
$ asayer setup --help
Usage: setup [options]
Configure your Asayer CLI
Options:
-t, --token <token> your user token from Asayer
-h, --help output usage information
$ asayer local --help
Usage: local [options]
Uses a local server for asayer onpremise
Options:
-t, --token <token> your user token from Asayer
-T, --tests <test1,test2,...> a list containing test names or ids to be executed separated by comma ","
-u, --url <url> custom test url
-U, --update update images
-c, --clean clean residual containers
-S, --stop-all stop all running tests
-i, --interactive use interactive mode
-h, --help output usage information
$ asayer docker --help
Usage: docker [options]
Configure docker for local testing
Options:
-v, --verify verify if the current docker connection is valid
-h, --host <host> the docker host address (default: "127.0.0.1")
-p, --port <port> the docker host port (default: 2375)
-P, --protocol <protocol> the docker host protocol (default: "auto detect")
-c, --cert-dir <path> the docker host's certificate directory (default: "/etc/docker/certs.d/")
--cert <client cert> the path or name of the client's certificate file (default: "cert.pem")
--key <client key> the path or name of the client's key file (default: "key.pem")
--ca <certificate authority> the path or name of the certificate authority file (default: "ca.pem")
--no-check don't check the server identity
--docker-version <version> the docker version (default: "auto detect")
--show print the current configuration
-i, --interactive use interactive mode
-h, --help output usage information
Token configuration:
To start you have to get your token from Preferences
In order to configure your token with, use one of these steps:
- saving your token, so you don't have to write it with each command:
- interactive mode:
asayer setup
- direct method:
asayer setup --token "MY_TOKEN..."
- using the environment variable
ASAYER_TOKEN
- using the option
--token "MY_TOKEN..."
when executing each command
If more than 1 method is used at the same time, the token value will be as follow:
--token "MY_TOKEN..."
- the environment variable
- the saved token
Running tests:
- To run all tests:
asayer
- To sepecify which test to run:
asayer --tests "TEST_ID1,TEST_ID2"
- To change the test's URL:
asayer --url "https://asayer.io"
- To use interactive mode:
asayer -i
On premise:
require docker
to be installed on the host
Configure:
To start using asayer on premise you need to configure your cli in order to interact with docker,
to configure your CLI/docker you can use one of the following steps:
- Default configuration: to check if the default configuration works use
asayer docker --verify
- Interactive mode:
asayer docker -i
- Direct method:
asayer docker --host "127.0.0.1" --port 3000 --protocol "https"
- any missing option will be replaced by the default value
- the list of options:
-h, --host <host>
: the docker host address (default: "127.0.0.1")-p, --port <port>
: the docker host port (default: 2375)-P, --protocol <protocol>
: the docker host protocol (default: "auto detect")-c, --cert-dir <path>
: the docker host's certificate directory (default: "/etc/docker/certs.d/")--cert <client cert>
: the path or name of the client's certificate file (default: "cert.pem")--key <client key>
: the path or name of the client's key file (default: "key.pem")--ca <certificate authority>
:the path or name of the certificate authority file (default: "ca.pem")--no-check
: don't check the server identity--docker-version <version>
:the docker version (default: "auto detect")
In order to check if your configuration is valid, run asayer docker --verify
Running tests:
To run your tests on premise:
- Run all tests:
asayer local
- Run selected tests:
asayer local --tests "TEST_ID1,TEST_ID2"
- Change test's URL:
asayer local --url "https://asayer.io"
- Use interactive mode:
asayer local -i
Stopping tests:
In case you have lost the connection to the terminal or started the asayer local
command in the background, the test containers will keep running until the end of the test, but you can use asayer local --stop-all
to stop all the running containers