Implement end-to-end testing

Fix failing test