implement testing code for end-2-end tests