This repository is to make request to SWAPI API. All the data is accessible through HTTP web API. https://swapi.dev
This repository is also configured for Continuos Integration (CI) with GithubActions .
Click in the Action tab and you will see the latest workflow run. Select the latest run and click on it.
At the bottom of the workflow summary page, there is a dedicated section for artifacts.
The report produced by the runtime, is under the Artifacts section
Below a basic guide on how to install the tests, run, architecture folder structure and useful resources.
- .github > workflows > TestBuild.yml This file contains the configuration for CI with githubActions
- reportFormatter > template-default-colored.hbs Contains the report used for command line run
- SWAPI.postman_collection.json Collection of request made in postman
- SWAPI.postman_environment.json Environment used within the collection
There's also a .travis.yml file that was used previously to connect with Travis CI, but now is disconnected
Postman application is open source software, a Javascript application designed to load test functional behavior. Postman's features simplify each step of building an API and streamline collaboration so you can create better APIs—faster. The tool can be downloaded at: https://www.postman.com/downloads/
Postman test can be run from command line using node.js https://nodejs.org/es/
- Install Postman
- Double click to open postman
- In the top menu go to File > Import
- Locate in your local machine the file with the postman_collection extension (SWAPI.postman_collection.json)
- Click on the gear in the right top "manage environments" and choose from your local machine the file with the environent extension
- Click on "Import" button
- There are two ways to send request: The first one is click on each request and then click button "send". The other one is to click button in the top menu "Runner"
- The first one is click on each request and then click button "send". The other one is to click button in the top menu "Runner"
- Once selected the collection and environment to run, click button "Start Run". Within this option the number of iterations can be set up manually so the runner will be exceuted "n" times. This option also allows to add delays between each request.
- To run the testplan from the command line you need to open a command prompt of Node.js
- Traverse locally until folder where postman test are located
- Run the command: newman run with the following parameters:
- Parameters:
- - Path to the collection name
- - folder name to run (if applies)
- - environment to use
- - the last part is the one where you will store the report formatter (the formatter is located in this repo for your convenience)
finally the last part has the name of the html file where you will find the results of the test.
- Example: newman run C:\git\Projects\SWAPI.postman_collection.json -e C:\git\Projects\environments\SWAPI.postman_environment.json --delay-request 2000 --reporters cli,html --reporter-html-export PostmanResult.html
- Note: the postman files must have the extension .json in order to be used with newman, otherwise will not be recognized