How rohitkr7/bdd_specflow_automation_framework works
Project Type and Purpose
• This is a “BDD Automation Framework using Specflow” written in C# (.NET Framework class library).
• It drives web-based test cases written in Gherkin and executed via Specflow’s test runner (e.g., MSTest/NUnit).
File Structure
• Top-level project file: BDD_Tutorial_classLib_netFramework.csproj (class library containing your step definitions and glue code).
• Directories:
• FeatureFiles – all “.feature” files (Gherkin scenarios) and their auto-generated code-behind.
• StepDefinitions – C# classes binding Gherkin steps to code.
• Objects – domain/helper classes (e.g., EmployeeDetails).
• Properties – standard .NET metadata.
• Configuration:
• packages.config – NuGet dependencies (Specflow, Selenium WebDriver, etc.).
• App.config – Specflow runner settings, test-run configuration.
Interactions and Data Flow
1. Test Runner triggers Specflow Engine.
2. Engine loads FeatureFiles → parses scenarios.
3. For each step, Engine invokes matching StepDefinitions.
4. StepDefinitions leverage:
– Domain/Helper Objects for business logic or data.
– WebDriver clients to drive browser actions.
5. Hooks (before/after scenarios) configure test environment.
6. Results flow back to Test Runner → Reports.
Architectural Patterns
• BDD Pattern: clearly delineates feature layer (Gherkin) from code.
• Separation of Concerns:
• Feature definitions vs. step implementations vs. domain objects.
• Data-Driven Testing: scenario outlines and external data mapping.
• Hook Mechanism: global setup/teardown.