Ability to parameterize scenarios
See original GitHub issueIn NUint there is TestCAse attribute, where you can setup parameters for test and it will be launch sereval times with different parameters. I’m Able to add it in LightBDD scenario, but these parameters don’t appear in console output.
e.g.
[TestCase("v5")]
[TestCase("v4")]
[Scenario]
[Label("Ticket-1")]
public void It_should_be_possible_to_get_movies_by_lat_and_lng_on_api_version(string version)
{
string lat = Config.getConfig().testCities.msk.lat;
string lng = Config.getConfig().testCities.msk.lng;
Runner.RunScenario(
_ => Given_api_version(version),
_ => Given_lat_and_lng(lat, lng),
_ => When_trying_get_movies_by_lat_and_lng(),
_ => Then_we_get_statusCode_OK(response),
_ => Then_content_is_not_null(response));
}
here is an output:
SCENARIO: [Ticket-1] It should be possible to get movies by lat and lng on api version
STEP 1/5: GIVEN api version "v5"...
STEP 1/5: GIVEN api version "v5" (Passed after 3ms)
STEP 2/5: AND lat "55.7495307478992" and lng "37.6213073730469"...
STEP 2/5: AND lat "55.7495307478992" and lng "37.6213073730469" (Passed after <1ms)
STEP 3/5: WHEN trying get movies by lat and lng...
STEP 3/5: WHEN trying get movies by lat and lng (Passed after 432ms)
STEP 4/5: THEN we get statusCode OK [response: "RestSharp.RestResponse"]...
STEP 4/5: THEN we get statusCode OK [response: "RestSharp.RestResponse"] (Passed after 7ms)
STEP 5/5: AND content is not null [response: "RestSharp.RestResponse"]...
STEP 5/5: AND content is not null [response: "RestSharp.RestResponse"] (Passed after 3ms)
SCENARIO RESULT: Passed after 474ms
SCENARIO: [Ticket-1] It should be possible to get movies by lat and lng on api version
STEP 1/5: GIVEN api version "v4"...
STEP 1/5: GIVEN api version "v4" (Passed after <1ms)
STEP 2/5: AND lat "55.7495307478992" and lng "37.6213073730469"...
STEP 2/5: AND lat "55.7495307478992" and lng "37.6213073730469" (Passed after <1ms)
STEP 3/5: WHEN trying get movies by lat and lng...
STEP 3/5: WHEN trying get movies by lat and lng (Passed after 123ms)
STEP 4/5: THEN we get statusCode OK [response: "RestSharp.RestResponse"]...
STEP 4/5: THEN we get statusCode OK [response: "RestSharp.RestResponse"] (Passed after <1ms)
STEP 5/5: AND content is not null [response: "RestSharp.RestResponse"]...
STEP 5/5: AND content is not null [response: "RestSharp.RestResponse"] (Passed after <1ms)
SCENARIO RESULT: Passed after 126ms
It would be great if scenario parameters will appear in output
Issue Analytics
- State:
- Created 6 years ago
- Comments:5
Top Results From Across the Web
What is a Scenario Parameter?
Scenario parameters are placeholders like variables, only to represent a value that changes from scenario to scenario. For example, if you want to...
Read more >Parameterize BDD Tests | TestComplete Documentation
In BDD tests, you parameterize test steps, not scenarios or features. That is, you set parameters for the Given , When , and...
Read more >Parameterization and concept of Test Cases
When you write a Scenario, you can parameterize the test data and expected values in a step, which you use for data entry...
Read more >106 SpecFlow Scenario Outlines: Parameterizing Your Tests
SpecFlow is a popular tool used for Behavior Driven Development (BDD) in .NET projects. One of its key features is the ability to...
Read more >Scenario Analysis Techniques Using Multiple 'What If' ...
Learn how to do a scenario analysis in Power BI by isolating certain variables and incorporating the 'what-if' parameter.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@Suremaker Thanks for the answer. I found, that my project gets packages from folder with outdated versions. The problem was resolved
Hello,
The scenario described above should render properly like:
Please check that all referenced LightBDD packages are of version 2.2.0, including:
I have created a sample project with your scenario and both Resharper and Visual Studio Test runner shows properly rendered scenario: example.zip
Please let me know if that helped.