Executing Test Cases via command line

Run command of vrest-ng-cli binary is used for running the API test cases on command line that are stored in a project directory.

Usage Instructions

vrest-ng-cli run --projectdir="<path_to_tc_directory>" 
            [--testsuitenames="<comma_separated_test_suite_names>"]
           [--tags="<comma_separated_tag_names>"]
           [--env=<environment_name>] [--nosslcheck=<boolean_value>]
           [--consoleLogging=<boolean_value>]
           [--logger=<one_of_available_loggers>] 
           [--logfilepath="<path_of_log_file_for_logger>"]
           [--record=<boolean_value>]
           [--token=<cli_token>]

Example

vrest-ng-cli run --projectdir=/path/to/your/project/directory 
            --testsuitenames="Sample\ Test\ Suite"
            --logger=xunit 
            --logfilepath=/path/to/directory/for/vrest-logs/logs.xml

And if you would like to record the test execution results in the vREST NG Dashboard Service then

vrest-ng-cli run --projectdir=/path/to/your/project/directory 
            --testsuitenames="Sample\ Test\ Suite"
            --logger=xunit 
            --logfilepath=/path/to/directory/for/vrest-logs/logs.xml
            --record=true
            --token="paste the generated CLI Token here"

Note: For information on generating CLI Token, you may look at our guide on CLI Token.

Options

    --projectdir     : Provide the path of the project directory which 
                       contains the testsuites.json file.
                       
                       If you dont provide any filter, then it will execute
                       all the testcases available in the project.

    --testsuitenames  : Optional Filter: Provide the comma separated list of 
                        test suites which you want to execute in double quotes.
    --tags            : Optional Filter: Provide the comma separated list of 
                        tags which you want to execute in double quotes.
    --methods         : Optional Filter: Provide the comma separated list of 
                        method names which you want to execute in double quotes.

    -T, --timeout     : How much to wait for response after execution 
                        of test case.
                       
                        It should be provided in unit of seconds.
                        e.g. -T=3 will wait for 3 seconds for response

    -N, --env         : Provide the environment name to initialize 
                        the global variables.
                       
                        By default environment `Default` is used.
    
    --token           : Provide the authentication token to store the test 
                        run results on vREST NG Dashboard Service.

    --record          : If this argument is `true`, then the runner will
                        record and store the test run results in vREST NG
                        Dashboard Service.     [boolean] [default: false]

    -S, --nosslcheck  : If this argument is `true`, vREST NG CLI will process
                        all requests, without Secure Certificate Check.
                       
                        By default Secure Certificate Check is enabled. 
                       
                        This option is useful in self-signed certificate 
                        issues.
            
    -C, --consoleLogging: If this argument is `false`, then the runner will not
                        log the results on console.

    -L, --logger      : Your desired logging of the vREST NG CLI execution 
                        process and result.

                        This can be either `console` or `json` or 
                        `csv` or `xunit`.

                        By default `console` logger is used.

    -F, --logfilepath : Valid if other than `console` logger 
                        is selected.

                        Absolute path of the log file, into which 
                        execution process and result logs will be dumped.

                        If path/file is not present, tool will try 
                        to setup that path, and create file automatically.

                        Please note that if file already exists, 
                        that will be overwritten.

                        By default it will be the `vrest/logs.[json|xml|csv]` 
                        in current directory.

    -H, --help        : To see this help.

When you execute this command, then this will execute the tests and will show you the following report on the command line: