You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I think that there are a lot of good suggestions in this #472 discussion.
My proposition is to follow app builder pattern that you can see in aspnet like that:
public static class Program
{
public static async Task Main(string[] args)
{
var builder = new SpecflowApplicationBuilder();
builder.Configuration.UseStandardReqnrollJsonConfiguration();
builder.UnitTestsPlatform.UseMsTestAdapter();
builder.Logging.UseDefaulLogger();
builder.Services.AddSingleton<IMyCustomService>();
builder.UseCustomPluginFromExternalLibrary();
builder.Features.AddFeaturesFromExecutingAssembly();
builder.StepsDefinitions.AddStepsFromExecutingAssembly();
var specflowApplication = builder.Build();
await specflowApplication.RunAsync();
}
}
potential builder:
public sealed class SpecflowApplicationBuilder
{
public SpecflowConfigurationBuilder Configuration { get; } = new();
public UnitTestsPlatformBuilder UnitTestsPlatform { get; } = new();
public SpecflowLoggingBuilder Logging { get; } = new();
...
SpecflowApplication Build();
}
public sealed class SpecflowApplication
{
Task RunAsync();
}
Rules:
Static classes\methods\properties\e.t.c are banned (maybe marked as deprecated on the first version). You can override any services via di and public interface
Extension via DI container and extension methods to this builder like builder.UseCustomPluginFromExternalLibrary(arg1, arg2)
No magic like automatic assembly scanning, e.t.c. For extensibility should be syntax that use should explicitly call like:
as the result you have only what you specified in builder => faster startup & run without not needed services. You should check your build and be sure that exactly you are using and where
Code first approach. Now you need to google all settings names. Would be better to get them from intellisense.
You can still use json config via:
but it should be optional way as any other config provider. The same for Logger, e.t.c. Maybe these should be remove from "core" library and provided as external library for those who needed it
App should have minimal amount and reasonable defaults
var builder = new SpecflowApplciationBuilder();
builder.Scenarios.AddScenariosFromExecutingtAssembly();
await builder.Build().RunAsync();
should work and work really fast
My private opition about reqnroll design in general:
I think that for years specflow & reqnroll get tons of "features" that I really never (or rare) use like custom json parsers\custom di\multiable adapters for tests\step args transformations\plugin system\feature+scenario contexts\report generators\source generators\cucumer messages\e.t.c. Tons of them!!
From my point of view would be better to split (or reimplement) it like
Reqnroll nuget that allow just run scerarios and support step definition
Reqnroll.SpecflowCompatibility nuget . Plugin that "returns all shit back"
Reqnroll.Configuration.ReqnrollJson nuget. Extends to load config from reqnroll.json. only for those who need it
Reqnroll.ExcelDataPlugin nuget. That add support for excel data source. again, only for those who need it
e.t.c
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
I think that there are a lot of good suggestions in this #472 discussion.
My proposition is to follow app builder pattern that you can see in aspnet like that:
potential builder:
Rules:
builder.UseCustomPluginFromExternalLibrary(arg1, arg2)
as the result you have only what you specified in builder => faster startup & run without not needed services. You should check your build and be sure that exactly you are using and where
You can still use json config via:
but it should be optional way as any other config provider. The same for Logger, e.t.c. Maybe these should be remove from "core" library and provided as external library for those who needed it
should work and work really fast
My private opition about reqnroll design in general:
I think that for years specflow & reqnroll get tons of "features" that I really never (or rare) use like custom json parsers\custom di\multiable adapters for tests\step args transformations\plugin system\feature+scenario contexts\report generators\source generators\cucumer messages\e.t.c. Tons of them!!
From my point of view would be better to split (or reimplement) it like
e.t.c
Features that should be out of the box:
That's it!
As the result it should be small\easy to support\fast to run library
Beta Was this translation helpful? Give feedback.
All reactions