Frisby is another tool which is used in Testing, actually it is for API testing. It is based on node.js and jasmine. Jasmine is an open source testing framework for java script. Before work with Frisby.js, let’s see how to install it on your Linux machine.
- npm should be there to install Frisby. So first let’s install npm.
- Next we should check whether we have the node.js or not.
- If it’s there, the output looks similar to this.
- Then we can install Frisby.
- There will be a file ‘node_modules‘ at your installation directory.
- As Frisby has built on top of Jasmine, we have to install jasmine as well.
- Then we need to create a symbolic link like following.
- Now everything is setup for running your Frisby script. Name the file according to the naming conversions. As this is based on Java Script, the extension should be ‘.js‘. Also we should append the ‘_spec‘ at the end of the file name. So the file name must be something like,
Then write this code.
Using ‘jasmine-node file_name‘ command we can execute the code. The result will be something like this for a Failure scenario.
- Also we can generate test reports using the jasmine-node module using it’s ‘–junitreport‘ parameter.
Generated report files will be inside the ‘reports‘ directory.
Generated report ‘.xml‘ file.
Now you know how to install Frisby.js on your machine and how to execute a test successfully. From the next post we will see how to write test cases for API automation. Thank You!