Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Finalize status information #75

Merged
merged 3 commits into from
Dec 4, 2016
Merged

Conversation

mgwidmann
Copy link
Contributor

So I set out to try to automatically take a screenshot on scenario failure, but it doesn't seem like its possible to know that information on scenario_failure of if it was successful or not.

So this PR adds the following capability:

scenario_finalize fn
  {:ok, _scenario}, _state ->
        Hound.end_session
  {:error, _reason, scenario}, _state ->
    Hound.Helpers.Screenshot.take_screenshot("#{scenario.name |> String.downcase() |> String.replace(~r/\W/, "-")}-failure.png")
    Hound.end_session
end

Its backwards compatible allowing the regular single parameter function to still work as it does today.

@meadsteve
Copy link
Collaborator

I like this a lot 👍 Thanks for taking the time to add this. I've got no feedback at all on the PR so I'll merge and release some time today.

@meadsteve meadsteve merged commit 07dc223 into meadery:master Dec 4, 2016
@meadsteve
Copy link
Collaborator

I was hoping to backport this to the 2.x branch but at the moment it doesn't seem worth the effort so I'm going to push on and get a version of 3.x ready soon and release this patch as part of that.

@mgwidmann
Copy link
Contributor Author

👍 awesome thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants