README.md

August 14, 2023 ยท View on GitHub

The Light BDD test framework scenarios import tool for Azure DevOps

To learn more, please see LightBDD.ScenarioSync wiki pages, or jump straight to:

Project description

ScenarioSync for Azure DevOps, integrates the BDD process with Azure DevOps by connecting and synchronizing the LightBDD scenarios with Test Cases. This way of the development reduce time spend to maintain actuality of scenarios in code and Azure DevOps.

  • ScenarioSync and LightBDD framework is a good alternative to SpecSync and SpecFlow framework.
  • ScenarioSync use LightBDD labels with "Relations:" metadata to assign Scenarios to Related Work Items in Azure DevOps.
  • Labels with "Sync:" metadata uses to link Scenario method to Test Case Associated Automation, that relation allow to run Automated Test Cases directly from Azure Devops Test Plan during release.
  • ScenarioSync works similar to SpecSync but uses LightBDD FeaturesReport.xml file as a source and base on it import Test Suites and Test Cases to Azure DevOps, Test suites and Test Cases that are not in source report removed from Azure DevOps.

Light BDD to Azure DevOps Test Plan features mapping

LightBDDAzure DevOps Test PlanNotes
FeatureTest SuiteCreated as Test Suite
Feature DescriptionTest Suite DescriptionSaving to Test Suite Description
ScenarioTest CaseCreated as Test Case
ScenarioTest Case SummarySaving as text rendered copy to Test Case description
Scenario StepsTest Case StepsCreated as Test Case Steps
Step File AttachmentStep AttachmentCreated Step Attachment
Step Table parameterStep ParametersNot support Azure DevOps parameters, Saving as a text table in a step title
Step Tree parameterXSaving as a text in a step title
CategoriesTagsSaving as Tags
LabelsTagsSaving as Tags
CommentXSaving to Test Case Description
Step parameter expectation expressionsStep Expected ResultSaving as Test case step expected result
Step parameter expectation expressionsStep Expected ResultSaving as Test case step expected result
XConfigurationsMapping not supported, can be applied to Static or Query based test suite
Labels (Relations:)Related WorkUse Label attribute with text 'Relations:'
Labels (Sync:)Associated AutomationUse Label attribute with text 'Sync:'

Example

Use Getting Started to install and run import tool

Light BDD Scenario

[Scenario]
[Label("Test-label")]
[Relations(234, 235)]
[Sync(nameof(Contacts_management), nameof(Searching_for_contacts_by_phone))]
// [Label("Relations:230,235")]
// [Label("Sync:Demo.LightBDD.XUnit2.dll;Demo.LightBDD.XUnit2.Features.Contacts_management.Searching_for_contacts_by_phone")]
public void Searching_for_contacts_by_phone()
{
    Runner.WithContext<ContactsManagementContext>().RunScenario(
        c => c.Given_my_contact_book_is_empty(),
        c => c.Given_I_added_contacts(Table.For(
            new Contact("John", "111-222-333", "john@hotmail.com"),
            new Contact("John", "111-303-404", "jo@hotmail.com"),
            new Contact("Greg", "213-444-444", "greg22@gmail.com"),
            new Contact("Emily", "111-222-5556", "emily1@gmail.com"),
            new Contact("Kathy", "111-555-330", "ka321@gmail.com"))),
        c => c.When_I_search_for_contacts_by_phone_starting_with("111"),
        c => c.Then_I_should_receive_contacts(Table.ExpectData(
            b => b.WithInferredColumns()
                .WithKey(x => x.Name),
            new Contact("Emily", "111-222-5556", "emily1@gmail.com"),
            new Contact("John", "111-222-333", "john@hotmail.com"),
            new Contact("John", "111-303-404", "jo@hotmail.com"),
            new Contact("Kathy", "111-555-330", "ka321@gmail.com")
        )));
}

Azure DevOps Test Case

test-case-demo.png