-
Notifications
You must be signed in to change notification settings - Fork 41
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
Additional info in feature, scenario and steps #191
Comments
Hello @tuscias , At this moment the child items do not have the ability to track their parent (scenario result/info cannot retrieve the feature result/info). I will make a feature for obtaining it. If you just want to generate the report after all tests are done, you can achieve it by making own report writer. Here is a wiki page on generating reports. What you could do is to make own report writer: class MyEmailingReporter : IReportWriter
{
public void Save(params IFeatureResult[] results)
{
foreach (var featureResult in results)
{
// report feature with all it's scenarios and steps
}
}
} The ...then register your writer in LightBDD: protected override void OnConfigure(LightBddConfiguration configuration)
{
configuration
.ReportWritersConfiguration()
.Add(new AllureReporter());
} Please note that the report will be generated after all tests are done, so you won't be able to implement any execution notifications as the tests are running this way... If you are interested in the immediate notification of the test progress, I would say the valid method would be to implement own progress notifier and update report as the tests are executing: public class AllureProgressNotifier : IScenarioProgressNotifier, IFeatureProgressNotifier
{
// code updating reports as tests progresses
} then the registration could be done like that: var allureNotifier = new AllureProgressNotifier();
configuration.Get<FeatureProgressNotifierConfiguration>()
.AppendNotifiers(allureNotifier);
configuration.Get<ScenarioProgressNotifierConfiguration>()
.AppendNotifierProviders(() => allureNotifier); but with this method, you will get to the same problem as with the decorator where As mentioned at the beginning of the response, I will have to implement the parent tracking for obtaining incremental/interactive report generation (please let me know if that is your case). If you just want to make a report at the end, I would suggest going with option 1 as it's the simplest one. I hope it helps, |
Updated IFeatureInfo, IScenarioInfo, IStepInfo to extend IMetadataInfo Updated IScenarioInfo, IStepInfo with Parent property Updated XmlReportFormatter to report RuntimeIds and updated XmlReportFormatterSchema
Hey @tuscias , Please take a look at PR #192 Please let me know if the change is sufficient for you to continue with your integration. I have a plan to merge and release it on Monday. Please also be aware that on Thursday I am going on holiday, which means I won't be able making any changes till the beginning of September. |
Yes, that is exactly how I wanted it to work! |
Ok, I'll prepare the release tonight |
#191 Additional info in feature, scenario and steps Introduced IMetadataInfo with Name and RuntimeId Updated IFeatureInfo, IScenarioInfo, IStepInfo to extend IMetadataInfo Updated IScenarioInfo, IStepInfo with Parent property Updated XmlReportFormatter to report RuntimeIds and updated XmlReportFormatterSchema
Released with LightBDD 3.1.0 |
Description
Hi,
i'm implementing my own scenario decorator and noticed that scenario object doesn't have info about his parent, i.e feature. This information is needed to create Allure reports, where i have to specify a feature id for each scenario so they would link correctly:
public class ScenarioAllureDecorator : IScenarioDecorator
{
private static readonly AllureLifecycle allure = AllureLifecycle.Instance;
Am i missing something? Is this could approached a bit differently?
The text was updated successfully, but these errors were encountered: