-
-
Notifications
You must be signed in to change notification settings - Fork 2k
Add Test Case UUID to Scenario Object #2254
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
Comments
A test case is an instance of an execution of a scenario or an example in a scenario outline. The scenario id is defined as the uri of the scenario appended with a line number. This identifies the scenario in a (relatively) stable manner across different executions where as the What would you use the execution id for? |
Sure, currently we are using a short 8-character identifier that we generate at the beginning of the test in a We generate this id by:
The goal here being to get a unique identifier for a particular test that is also conveniently used where a longer string would be obnoxious (log markers, test file names, test usernames, etc). We also keep our scenario names distinct even across examples, alleviating concerns of duplicates. IMO, if a test was rerun and had the same ID I would be okay with that as well. I am also not stating that this approach is perfect, it seems to work as intended for us so far. I am fine with us using this, but when I came across the UUID that was part of the To be specific, we just switched to running our tests in parallel, and we wanted to output something while the threads were running in the background (so the tests would not appear hung). We landed on using a custom I am not necessarily asking that the UUID is changed to a different format either, we could simply use the first grouping of the UUID for our internal "short id" needs. Just saying that it would be nice to have access to the ID that Cucumber already generates from a step definition class. I might think that access to the If we are willing to change from the UUID, I might recommend a similar approach to what we have implemented; generate a sha, take the first Just tossing ideas out! |
@mpkorstanje Bump, since it has been a while. Let me know if anything needs clarification! |
Currently short on time and prioritizing the release of v7.0.0. No need to bump. |
There is definitely a mismatch between |
This is breaking change so it'd have to go into v7. |
To obtain the original `<uri>:<line-number>` identifier use `scenario.getUri() + ":" + scenario.getLine()`. Closes: #2254
To obtain the original `<uri>:<line-number>` identifier use `scenario.getUri() + ":" + scenario.getLine()`. Closes: #2254
To obtain the original `<uri>:<line-number>` identifier use `scenario.getUri() + ":" + scenario.getLine()`. Closes: #2254
I am currently generating an ID at the beginning of every test that I use for logging and other test identification. I do this during a
before()
hook where I can interact with other data objects presented via picocontainer. I noticed that Cucumber also creates a UUID for a "TestCase". I'm not personally read into the differences between a TestCase and a Scenario, but it would be great to have access to that UUID as part of the Scenario object in order to have the id that cucumber already generates and uses.I have seen that the Scenario object has an id associated with it, but it seems to be a longer string outlining the file, etc that the test comes from that is not as useful as a quick ID number
The text was updated successfully, but these errors were encountered: