Automated Functional Testing
Here are the steps to take to start using the automated test script
developed by your TA.
-
Download and
install
the Postman application. Documentation is available
here
-
Launch Postman. Go to "File > Import" and then select "Import from link",
enter the following link:
https://www.getpostman.com/collections/90a68ffa2a0ef82a751c
and then press "Import". On the left pane select the "Collections" tab: you
should see a collection called API_TESTS. There are four sets of tests in
this collection, the first three correspond to tests for "Accounts",
"Rides", and "Reports"; they are grouped by resource type for convenience
and you can run them in any order you want.
The last set of tests, named "Automated Tests" includes all
the tests described in the
Project Functional
Testing
document, in the same order; as the name says, this is the automated test
suite that you can execute by just pressing a button. When all the tests
pass you know that you're done. NOTE: this is the same test suite we'll be
using when grading your project.
-
Create an environment in which to run the automated suite:
-
Press the "New" button in the upper left corner of the main Postmans
screen and select "Environment" for the menu.
-
Choose a name for the new environment, such as
"cs445 project - automated test suite", then press "Add".
-
Close the "MANAGE ENVIRONMENTS" window.
-
Start the server that accepts and responds to REST requests for your
application. The test script assumes that the server is running locally
and listening for requests on port 8080
( http://localhost:8080/sar ).
-
Run the automated test suite:
-
Press the "Runner" button on the top left side of the main Postman
screen: this will open a "Collection Runner" window; you should see the
API_TESTS in the left pane, under "All Collections", click on it
and then click on "Automated Tests".
-
Select the newly created environment from the "Environment" pull down
menu.
-
Click on the big blue "Run API_TESTS" at the bottom of the left pane
and find out how many of the tests are passing.
Any questions/commments about the script? Please let the
TA and your instructor know.
|