refactor end to end test to implement page object pattern