TrganStep
Namespace: TrganReport
Represents a single step within a Trgan test. Captures logs, status, and screenshots.
public class TrganStep
Inheritance Object → TrganStep
Constructors
TrganStep(TrganTest)
Initializes a step with a reference to the parent test.
public TrganStep(TrganTest test)
Parameters
test
TrganTest
The parent TrganTest instance.
TrganStep(GherkinKeyword, TrganTest)
Initializes a step with a Gherkin keyword and a parent test.
public TrganStep(GherkinKeyword keyword, TrganTest test)
Parameters
keyword
GherkinKeyword
The Gherkin keyword (e.g., Given, When, Then).
test
TrganTest
The parent TrganTest instance.
Methods
Log(Status, String, Screenshot)
Logs the status and optional screenshot for the step. Also updates the parent test's status and end time.
public void Log(Status status, string message, Screenshot screenshot)
Parameters
status
Status
The status to log.
message
String
An optional write log message
screenshot
Screenshot
An optional screenshot.
Write(String, Screenshot, Boolean)
Writes a log entry with optional screenshot and timestamp. Also updates the parent test's end time.
public void Write(string message, Screenshot screenshot, bool timeStamp)
Parameters
message
String
The log message.
screenshot
Screenshot
An optional screenshot.
timeStamp
Boolean
Whether to include a timestamp in the log.
Pass(String, Screenshot)
Logs a passing status with an optional screenshot.
public void Pass(string message, Screenshot screenshot)
Parameters
message
String
An optional write log message
screenshot
Screenshot
An optional screenshot to attach.
Fail(String, Screenshot)
Logs a failing status with an optional screenshot.
public void Fail(string message, Screenshot screenshot)
Parameters
message
String
An optional write log message
screenshot
Screenshot
An optional screenshot to attach.
Skip(String, Screenshot)
Logs a skipped status with an optional screenshot.
public void Skip(string message, Screenshot screenshot)
Parameters
message
String
An optional write log message
screenshot
Screenshot
An optional screenshot to attach.