Skip to content

RemoveNode(Extent test) removes all child tests in report with the same name #146

@moonvi

Description

@moonvi

Hello @anshooarora ,

All nodes (child tests) are removed in different parent tests in report if child tests have the same name. In pseudo-code example below ChildName

var parentTest1 = extent.CreateTest("ParentTest1");
var child1 = test.CreateNode("ChildName").Pass("Test ended with Pass");

extent.Flush();

var parentTest2 = extent.CreateTest("ParentTest2");
var child2 = test.CreateNode("ChildName").Skip("Test ended with Skip");
var getChild = extent.GetChild(); // GetChild() returns _childTest with whole info from instance context in separate ExtentTextManager.cs

if(logstatus == Status.Skip)
{
parentTest2 .RemoveNode(getChild); //here is the problem: both tests are removed from report - child1 and child2
}

extent.Flush();

As I can see it's checked here. Can it be changed to Id?

var item = tests.SingleOrDefault(x => x.Id == test.Id);

Thanks

ExtentReports: v5.0.0-alpha6
Type: ExtentSparkReporter

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions