Wait for API request to complete in stock management spec