Hello all.
I am making use of the test functionality in casper where one can have many test files, and casperjs will recursively run through the directories and look for the test scripts. One one of my test scripts, I created a resource requested listener:
casper.on('resource.requested', function(resource) {...
However, I only want those events to be caught inside that one test script. I don't want that listener for later scripts that are run in the sequence. How can I remove the listener?
For example:
casperjs test
test1.js ...
test2.js (has 'resource.requested' listener) ...
test3.js ...
How do I stop test3.js from having its resource.requested events being caught?
Thanks for any and all help. It is much appreciated.