Skip to content

RESTest Command‐Line Interface (CLI) User Manual

José Luis García Marín edited this page Mar 4, 2024 · 7 revisions

Introduction

The RESTest CLI is a tool designed to interact with the RESTest framework via the command line interface (CLI). It enables users to perform various actions such as creating test configurations, generating test cases, and executing tests based on OpenAPI specifications.

Installation

To install and use the RESTest CLI, follow these steps:

  • Download the RESTest project.

  • Ensure Java Runtime Environment (JRE) is installed on your system.

  • Open a terminal or command prompt.

  • Navigate to the root directory of the project.

  • Execute the following command to run the RESTest CLI:

      java -jar restest-cli.jar [options]
    

Usage

The RESTest CLI supports various options for interacting with the system. Here are the available options:

  • -h, --help: Display help information about available options and usage.
  • -o, --openapi [path]: Generates and executes a series of tests based on an OpenAPI file.
  • -c, --create-conf [path]: Generate a test configuration file from the provided OpenAPI file.
  • -g, --generate [path]: Generate test cases based on the provided configuration file.
  • -e, --execute [path]: Execute the test cases defined in the provided configuration file.

Quick Examples

Here are some quick examples of using the RESTest CLI:

Generate, Execute, and Generate Reports based on OpenAPI specification:

java -jar restest-cli.jar -o [path_to_oas_file] 

Create a Test Configuration File:

java -jar restest-cli.jar -c [path_to_oas_file] 

Generate Test Cases:

java -jar restest-cli.jar -g [path_to_properties_file] 

Execute Test Cases:

java -jar restest-cli.jar -e [path_to_properties_file] 

Generate and Execute Test Cases:

java -jar restest-cli.jar -g -e [path_to_properties_file] 

Notes

  • Both relative and absolute paths can be used to specify files.
  • The CLI provides detailed information about the progress and results of test case generation and execution.
  • This documentation serves as a basic guide on how to use the RESTest CLI to generate and execute test cases for REST services using OpenAPI files.