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

fix undefined hook parameter #919

Merged
merged 7 commits into from
Aug 29, 2017
Merged

fix undefined hook parameter #919

merged 7 commits into from
Aug 29, 2017

Conversation

charlierudolph
Copy link
Member

resolves #891

@likerRr
Copy link

likerRr commented Aug 28, 2017

Can we also get access to current (not only failed) scenario name? There can be several scenarios in one feature file and in addition to uri+line (where error appeared) it would be helpful to have a name e.g. in order to save a screenshot with the name of scenario.

@charlierudolph
Copy link
Member Author

charlierudolph commented Aug 28, 2017

url + line uniquely identifies a scenario (or an example of a scenario outline) where the name is not guaranteed to be unique.

@charlierudolph
Copy link
Member Author

I also like matching the event protocol data. Also with some of the ideas for how to view results in the future, I think we will stop saving screenshots to disk and start attaching them and thus let the formatter embed them in an html report. I believe some html reporters already do this.

let message = testCase.sourceLocation.uri + ":" + testCase.sourceLocation.line + " "
if (testCase.result.status === Status.FAILED) {
message += "failed"
} else {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why do you need an else? seems like the test case only fails.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using the same After hook as the previous scenario. I'll join the two scenarios into one

@kriswill
Copy link

In reference to the scenario name, we also use it to register all of the step durations with our analytics system to track performance changes over time. We pretty much harvest all of the metadata about the scenario and record as dimensions, then use them to filter in our charting dashboards. I realize that maybe this type of thing might be better implemented as a reporter, but having the full fidelity of the results available in the hooks has been helpful.

Copy link
Contributor

@olleolleolle olleolleolle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Having only read it, it looks like it does what it says.

@charlierudolph
Copy link
Member Author

@kriswill yes please use one of the reporters for that. Ideally the support code is only used for running tests and then use reporters when you need more parts of data. The event protocol formatter gives pretty much everything

@charlierudolph charlierudolph merged commit 73ec18d into master Aug 29, 2017
@charlierudolph charlierudolph deleted the cr-testCaseResult branch August 29, 2017 05:09
@lock
Copy link

lock bot commented Oct 24, 2018

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Oct 24, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

scenario result not passed to before/after hooks
4 participants