Ensure apps are stopped and started properly before and after tests