BlazeReport icon indicating copy to clipboard operation
BlazeReport copied to clipboard

A minimal example of a Blazor App with NUnit, Selenium, SpecFlow and ExtentReports (.NET Core 3)

Blaze Report

A minimal example of a Blazor App with:

Projects

  • BlazeReport.Commons - A Blazor Class Library
  • BlazeReport.Tests - A NUnit Test Project
  • BlazeReport.Web - A Blazor App

Blazor

The page Index.razor has a single component:

  • BidiButton - A button that can be clicked or right-clicked

Selenium

  • WebDriver - A web driver, in this case, Chrome

Specflow

Structure

SpecFlow uses Gherkin which supports Behaviour-Driven-Design, and has the following structure:

  • A test may contain many Features.
  • A Feature may contain many Scenarios.
  • A Scenario may contain many Scenario Blocks (Given, When, And, But)
  • A Scenario Block may contain many Steps

Bindings

  • BeforeTestRun / AfterTestRun - Runs before/after the entire test run
  • BeforeFeature / AfterFeature - Runs before/after a feature
  • BeforeScenario / AfterScenario - Runs before/after a scenario
  • BeforeScenarioBlock / AfterScenarioBlock - Runs before/after blocks of Given, When, Then
  • BeforeStep / AfterStep - Runs before/after a step

ExtentReports

A report is created before the test run (BeforeTestRun) and after all tests, it is saved to C:\Dev\ExtentReport. Each Feature is a Test and each Scenario is a Node.