Shisha, smoke test those URLs!
Here comes Shisha! Yet another NodeJs based application from Namshi! Shisha is a smoke testing module, what is smoke testing? Read about it here. In short, smoke testing is a term coming from Electrical Engineering, where an Electronic chip is simply tested by plugging it into an electric source and observing if smoke comes out! How does shisha relate to this? Well, just give shisha a list or a file of URLs and expected HTTP status code for each URL, and it will assert the expected status codes and show you back a report! It serves as a quick and fast testing platform for your website/APIs. Instead of waiting for a unit or an integration test to be prepared and run, simply set shisha to run on your URLs, it is fast and simple!
Install it
Install shisha globally from NPM
Prepare it and smoke it
Create a text file named .smoke
where all your test cases will reside.
Fill it as following:
From the directory where your .smoke
file is, run shisha
and observe the shisha smoking!
Here is a video illustration:
Features
You can:–
- Pass a path to any text file containing the right URL status code mapping using
--smoke
argument
- Pass locals to be replaced in your text file
so your text file would look something like this
Here is how locals work:
- Easily extend shisha in your code as follows:
then, in your code:
you will have access to the smoke
method which accepts the following arguments:
- data source, which can be a path to a text file, a list or an object.
- A list of locals to be replaced in the placeholders of the text file.
- A callback which accepts the report argument where the set of smoking results are parsed.
or
or
locals
as mentioned before, is a list of placeholders to be replaced in the smoke file
callback
is a function called when smoking is done!
if you do not have any locals, you can simply omit it.
Happy smoking!