Updated the support for taking screenshot only for failed specs