In this section, we learn about how to use Postman to write system tests, and how to run them in the command line with Newman.
Here's an overview of how the PyCharm Run Configuration flow goes:
In the videos we use the Bash Support extension of PyCharm to interact with the command line. Specifically, we use it to create Run Configurations so that we can hit the "Play" button and that runs a command-line script.
This is no longer necessary, as PyCharm now ships with Shell Script. You can skip installing Bash Support, and where we use Bash Support in the videos, you can use Shell Script.
Key Takeaway: don't use Bash Support, instead use the built-in Shell Script.
In the videos we install Node Version Manager (nvm) to install a specific version of NodeJS. We use that to install Newman, which we can use to run Postman tests in the command line.
If you are using Windows, you'll want to install nvm-windows instead. There's a Windows installer you can use: github.com/coreybutler/nvm-windows/releases . Download the nvm-setup.exe file and execute it. Once it has finished installing, you'll be able to run nvm in your cmd.exe application.
Other alternatives include nodeenv, nodist, or nvs.
There, you can see the available NodeJS versions by running:
nvm list availableThen you can install the latest LTS (Long-Term Support) version:
nvm install ltsOnce installed, you can use:
nvm use ltsThen, install newman:
npm install newmanFinally, you'll need to know where the newman executable has been placed. You can find out its location with this command:
where newmanCopy the path to the newman executable, as you'll need it in PyCharm when you create a Shell Script Run Configuration. Use the path in the Script text field of the Run Configuration.
- Enable the Shell Script Plugin by going into your Settings -> Plugins -> Shell Script.
- Create a new Run Configuration by going to the top right dropdown, clicking it, and then clicking on "Edit Configurations..."
- Create a new Run Configuration of type Shell Script and give it a name, such as "Run Newman tests"
- Select "Script Text"
- In the Script text field, type your path to newman followed by
run stores-rest-api.postman_collection.json.- Important if your path to newman contains spaces, then write it in this format:
& 'path to your newman' - The final value of the Script text field will be something like this:
& 'path to your newman' run stores-rest-api.postman_collection.json.
- Important if your path to newman contains spaces, then write it in this format:
- Press OK
You can follow the videos as normal for using the Multirun Run Configuration to start the app and run the tests.

