Remove duplication in end to end tests