Skip to content

If before feature hook fails then tests from that feature are not included in report #824

@saggy7001

Description

@saggy7001

Reqnroll Version

3.0.2

Which test runner are you using?

MSTest

Test Runner Version Number

17.8.0

.NET Implementation

.NET 8.0

Test Execution Method

Visual Studio Test Explorer

Content of reqnroll.json configuration file

{
  "$schema": "https://schemas.reqnroll.net/reqnroll-config-latest.json",
  "formatters": {
    "html": { "outputFilePath": "tc-report/reqnroll_report.html" },
    "message": { "outputFilePath": "tc-report/reqnroll_report.ndjson" }
  }
}

Issue Description


Feature1

Feature: Feature1

A short summary of the feature

Scenario: scenario 1
	When I add 1 and 3
	Then Addition is 4

Scenario: scenario 2
	When I add 1 and 3
	Then Addition is 3

@BeforeScenario
Scenario: scenario 3
	When I add 1 and 3
	Then Addition is 4

Feature2

@BeforeFeature
Feature: Feature2

A short summary of the feature

Scenario: scenario 10
	When I add 1 and 3
	Then Addition is 3

StepDef

using Reqnroll;

namespace ReqnrollReport
{
    [Binding]
    public class Steps
    {
        private int _result = 0;
        [When("I add {int} and {int}")]
        public void WhenIAddAnd(int p0, int p1)
        {
            _result = p0 + p1;
        }

        [Then("Addition is {int}")]
        public void ThenAdditionIs(int p0)
        {
            Assert.AreEqual(p0, _result);
        }

        [BeforeScenario("BeforeScenario")]
        public static void BeforeScenario()
        {
            Assert.True(false);
        }

        [BeforeFeature("BeforeFeature")]
        public static void BeforeFeature()
        {
            Assert.True(false);
        }
    }
}

Report HTML:

reqnroll_report.html


Report NDJSON:

reqnroll_report.json


Steps to Reproduce

Run all testes from solution

Check html report

there are no tests from feature 2 reported in report as failed

Link to Repro Project

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions