Add Wait function in agent client. Refactor tests.