Start a New Test Suite

Starting a new test suite for testing API endpoints involves only a few steps to create and populate with initial lines a file named bat.yaml. This file explains the structure of your test suite to the BAT CLI.

To Start a New Test Suite

  1. Create a directory in your computer’s filesystem.

  2. Change to the new directory.

  3. Create a file named bat.yaml.

  4. Open the file for editing.

  5. Add these five lines to specify the name of the test suite:

      name: "name_of_suite_of_tests"

    Specify the name that you want to give the suite of tests that you plan to write.

  6. Save the file.

  7. Create a folder in your directory in which to create tests.

    You can give the folder any name.

  8. Optional: Create a folder named config.

    In this folder, you create configuration files to use for your tests. Configuration files contain variables that are injected to tests at runtime. You can refer to those variables in tests by using the config variable.

    For example, to refer to a variable named url in a configuration file, you use this reference: '$(config.url)'. When you run the bat command to execute a test, you specify the configuration file to use by including the --config=file.dwl option, where file.dwl is the path and name of the configuration file in the folder for your test suite.

What to Do Next

You can start writing tests.

Was this article helpful?

💙 Thanks for your feedback!

Edit on GitHub