refactor webdriverjs test case