Skip to content

TrganTest

Namespace: TrganReport

Represents a single test case within a report. Encapsulates metadata, execution timing, status, and associated steps.

public class TrganTest

Inheritance ObjectTrganTest

Constructors

TrganTest(TrganContainer, String, String[])

Represents a single test case within a report. Encapsulates metadata, execution timing, status, and associated steps.

public TrganTest(TrganContainer container, string trgantestName, String[] categories)

Parameters

container TrganContainer
Parent execution container

trgantestName String
The name of the test case.

categories String[]
Optional categories or tags associated with the test.

Methods

CreateStep(String)

Creates a new step.

public TrganStep CreateStep(string description)

Parameters

description String
The step description.

Returns

TrganStep
The created TrganStep.

CreateStep(GherkinKeyword, String)

Creates a new step with a specific Gherkin keyword.

public TrganStep CreateStep(GherkinKeyword keyword, string description)

Parameters

keyword GherkinKeyword
The Gherkin keyword (e.g., Given, When, Then).

description String
The step description.

Returns

TrganStep
The created TrganStep.

AddStep(Status, String, Screenshot)

Adds a new step with status, message, and optional screenshot.

public void AddStep(Status status, string message, Screenshot screenshot)

Parameters

status Status
The step status.

message String
The step message.

screenshot Screenshot
Optional screenshot for the step.

AddStep(Status, GherkinKeyword, String, Screenshot)

Adds a new step with status, gherkin keyword, message, and optional screenshot.

public void AddStep(Status status, GherkinKeyword gherkin, string message, Screenshot screenshot)

Parameters

status Status

gherkin GherkinKeyword

message String

screenshot Screenshot

Log(Status)

Mark the test status with given

public void Log(Status status)

Parameters

status Status

Pass()

Marks the test as PASS

public void Pass()

Fail()

Marks the test as FAIL

public void Fail()

Skip()

Marks the test as SKIP

public void Skip()

Log(Status, String, Screenshot)

Logs a new step with status, message, and optional screenshot.

public void Log(Status status, string message, Screenshot screenshot)

Parameters

status Status
The step status.

message String
The step message.

screenshot Screenshot
Optional screenshot.

Pass(String, Screenshot)

Logs a new passing step with the specified message and optional screenshot.

public void Pass(string message, Screenshot screenshot)

Parameters

message String
The message describing the successful step.

screenshot Screenshot
An optional screenshot to attach to the step.

Fail(String, Screenshot)

Logs a new failing step with the specified message and optional screenshot.

public void Fail(string message, Screenshot screenshot)

Parameters

message String
The message describing the failure.

screenshot Screenshot
An optional screenshot to attach to the step.

Skip(String, Screenshot)

Logs a new skipped step with the specified message and optional screenshot.

public void Skip(string message, Screenshot screenshot)

Parameters

message String
The message explaining why the step was skipped.

screenshot Screenshot
An optional screenshot to attach to the step.