Installing BAT
The Blackbox Automated Testing (BAT) CLI wrapper is a command line wrapper that you install to execute API tests.
Prerequisite for Linux and MacOS Systems
Before installing the BAT CLI, ensure that AdoptOpenJDK’s OpenJDK 8 is installed on your system.
Prerequisites for Windows 10 Systems
-
Install Windows Subsystem for Linux (WSL)
The instructions are at https://docs.microsoft.com/en-us/windows/wsl/install-win10.
-
Install Java 8, curl, and the application "unzip" into the Linux distribution that you installed in your WSL.
-
Ensure that the
JAVA_HOME
variable in your environment is set to the location of your Java installation. -
Add the
bat
executable to yourPATH
environment variable:-
Open the
~/.bashrc
file (if you are usingbash
) or the~/.zshrc
file (if you are usingzsh
) for editing. For example, to use thevi
editor, enter either of these commands:vi ~/.bashrc
vi ~/.zshrc
-
Add the following line to the end of the file and then save the file:
export PATH=$PATH:~/.bat/bat/bin
-
Install BAT
You can install BAT CLI on Linux, MacOS, and Windows.
Linux and MacOS Systems
-
Ensure that the user under which you are installing has write and execute permissions for the directory into which you plan to install BAT CLI and to
/usr/local/bin
. -
Run the following command to install BAT CLI:
curl -o- 'https://s3.amazonaws.com/bat-wrapper/install.sh' | bash
This installs BAT CLI into the
$HOME/.bat/bat/bin
directory. The installation script automatically adds abat
file to the/usr/local/bin
directory that points to the actual BAT CLI installation directory. If this does not work, you can manually add$HOME/.bat/bat/bin
to your shell environment’s path to execute BAT CLI or rerun the installation under a user with write permission for/usr/local/bin
. -
Run the command
bat -version
to verify that BAT CLI is installed.
Windows
-
Click here to automatically download the ZIP file of the BAT wrapper for Windows.
-
Unzip the ZIP file to install BAT CLI in your Windows environment.
-
Run the command
bat -version
to verify that BAT CLI is installed.