diff --git a/features/steps/laravel_steps.rb b/features/steps/laravel_steps.rb index d1a1424d..f561563e 100644 --- a/features/steps/laravel_steps.rb +++ b/features/steps/laravel_steps.rb @@ -22,6 +22,15 @@ Laravel.navigate_to(route) end +Then("the Laravel response matches {string}") do |regex| + wait = Maze::Wait.new(timeout: 10) + success = wait.until { Laravel.last_response != nil } + + raise 'No response from the Laravel fixture!' unless success + + assert_match(Regexp.new(regex), Laravel.last_response) +end + Then("the exception {string} matches one of the following:") do |path, values| desired_value = read_key_path(Server.current_request[:body], "events.0.exceptions.0.#{path}") assert_includes(values.raw.flatten, desired_value)