Casper js tests refactoring