#Unit Test
##Installation
This project is build based on Node.js
npm install
to install package, if having error of installing package please install each package manually
npm install moment
npm install request
npm install walk
npm install fs
npm install xml2js
npm install path
npm install form-data
npm install json2xls
npm install exceljs
npm install msexcel-builder
npm http-server -g
##Usage
Running the code below will allows you to read run the unit test, reading the result from the designated folder and sending the unit test result to the database.
To run Unit Test
jasmine-node --junitreport [location of file] --output [location to save unit test report]
E.g. jasmine-node --junitreport test/spec/MainTest_spec.js --output ./reports/
Running the code below allows you to generate a excel spreadsheet from the RAML. This excel spreadsheet helps tester to keep track of the test cases that they have created afterwhich upload to the database to notify other tester of which API test cases had been created. This allow reduction of miscomunication and reduce the chances of duplicated codes.
To run generate excel file from raml
node [location of file]
E.g. node test\spec\Raml2excel.js
Running the code below allows you to run the website on you own local machine. This is good for those developers who are intending to modify the UI.
To run local server
http-server
E.g. http-server
##Modification of codes
Each set of unique sequences or API endpoint tests should be started with new frisby.toss
method calls instead of trying to chain multiple HTTP requests together.
For more infomation regarding how to create test cases using frisby
https://github.com/vlucas/frisby
Make sure your save location of unit test report are match to the output when you are running the test
To modify the location of the save output location
var walker = walk.walk('the location where you want to save report to', {
followLinks: false
});
By default the report will be save in ./reports
For more information for those codes
raml-parser - https://github.com/raml-org/raml-js-parser
exceljs - https://github.com/guyonroche/exceljs#reading-xlsx
msexcel-builder - https://github.com/chuanyi/msexcel-builder