-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
[Feature Request] Provide ScenarioOutline Metadata #2634
Comments
@OwenK2 thanks for checking, yes I think the best approach is for you to submit a PR if you call that JSON already has metadata about the index of the outline "example": https://github.com/karatelabs/karate/blob/v1.5.0/karate-core/src/main/java/com/intuit/karate/core/ScenarioResult.java#L197 I'm not sure if that is sufficient for you to get if it is the last example. I propose we add a new property called "exampleCount" which may be more "future proof". |
Yeah I can't quite figure out if it is the last example just based on the |
@ptrthomas Working on the PR now, hope this is an ok place to ask questions like this. I have a test scenario like so: Scenario Outline: Multi Outline
* print <pass>
* if(!<pass>) karate.fail()
Examples:
| pass |
| false |
| false |
Examples:
| pass |
| true |
| true | I noticed that the example index resets per "example table". Meaning here the scenario example indexes go 1, 2 then 1,2 again. How does karate distinguish between the scenarios in the first table and the second? Based on the code karate queries scenarios via section ID + example ID but how does this work if 2 scenarios could have the same section and example index? Does there need to be an |
@OwenK2 yeah, no one has ever needed this before, and we may indeed need |
@ptrthomas PR created here: #2636. This is my first attempt at contributing to a public repo so please let me know if I need to fix anything. Please let me know what you think when you get a chance! |
@OwenK2 PR merged with thanks. I'll be trying to release 1.5.1 next week. |
@ptrthomas Awesome, glad I could contribute! |
1.5.1 released |
My team is looking to implement the following logic in the
afterScenario
hook to update our system of record as the test suite runs:Currently I am unaware of any way to get this information or perform this logic in Karate (if I am wrong please let me know and I can re-post on stack overflow and close this issue). Possible ideas here are to provide a
karate.scenarioOutline
object with the desired metadata. This could perhaps be in conjunction with anafterScenarioOutline
hook although that may be excessive.Possible
karate.scenarioOutline
I started looking into the code to try and contribute but saw in the guidelines that I should run my idea by project leads before working on a PR.
The text was updated successfully, but these errors were encountered: