Postman Test Suite
The FaceTec Postman Test Suite is a collection of tests included in the FaceTec Server package. This guide steps through the initial setup to enable and run the Postman Test Suite on the FaceTec Server.
Download & Setup
Serve The FaceTec Test Data
To run the Postman Tests, you need to serve the Test Data files over HTTP.
The FaceTec Test Data contains FaceScans, FaceMaps, Audit Trail Images, and more. The FaceTec Postman Tests are configured to read these larger data files via GET requests. The recommended setup is to install and run a simple HTTP server that serves the FaceTec Test Data on localhost so that Postman can access it.
To host the FaceTec Test Data, we recommend installing simplehttpserver and running it via the commands below. Make sure to run this from the root directory of the downloaded and extracted FaceTec Test Suite zip, FaceTecSDK-postman-testing-suite-x.x.x/:
npm install -g simplehttpserver
simplehttpserver
If you are having problems running the above command, either of the following commands may work for you to run the SimpleHTTPServer.
python -m SimpleHTTPServer 8000
// or
python3 -m http.server
Enable Postman Test Suite on FaceTec Server
There are 3 ways to enable the Postman Test Suite.
1) When downloading the FaceTec Server from the Configuration Wizard, set "Initialize For Postman Test Suite With Server" to true.
2) Change the value initializeForPostmanTestSuiteWithServer to true in the config.yaml file.
3) Initialize the FaceTec Server using the below function:
FaceTecSDK.initializeForPostManTestSuiteWithServer(...)For more information on how to launch the FaceTec Server, please see Setting up the FaceTec Server.
Running the Tests
In Postman, Load and Run the FaceTec Postman Test Suite Collection. To do so, follow the steps below:
Select a Postman Workspace, and go to "Manage Environments", and import the localhost_Standard_Server_Environment.json file. For the latest Postman version as of this release, the button to open "Manage Environment" is near the top right of the Main UI.
Add your Device Key into the environment variables DEVICE_KEY_IDENTIFIER, X_USER_AGENT_ANDROID, X_USER_AGENT_BROWSER and X_USER_AGENT_IOS by updating the value INSERT_DEVICE_KEY_HERE, with your own Device Key.
Back on the Main UI, click the "Import" button and upload the FaceTec_Test_Suite.postman_collection.json file. This will load the Test Suite Collection into Postman. For the latest Postman version as of this release, the "Import" button is near the top left of the Main UI.
Run the entire FaceTec Test Suite end to end by clicking the expandable button on the Collection, and then the "Run" button. You can also run tests individually by clicking on an individual test and running it.
Notes and Caveats
- The FaceTec Server flags FaceScans that are submitted multiple times to prevent replay attacks. This means that you will need to clear the test data from your Database after performing any tests. FaceTec recommends setting up a Test Database that you use when running tests to quickly drop/delete records so that you can run and iterate tests without affecting your Production Systems.
- FaceTec Test Data is created using a special process that allows the Test Data to be processed in FaceTec Server Instances initialized with any Keys. If you update the tests to use your own data, you will need to ensure that the Keys that your data is created with match the FaceTec Server Keys you are using.
- The Test Data will only work when the FaceTec Server is initialized using
initializeForPostManTestSuiteWithServer. - These tests are designed to be run in order. If you choose to run specific tests individually and out of order, it is expected that some tests may fail.
- If testing 1:N Search, you must set the "enableSearch" boolean to true inside config.yaml, and specify a valid "searchDatabaseRootDirectory" path.