Convert tests to casper API (bug 1045707)