replace sleep by wait_until in specs