refactoring and add take screen shoot on test failure