Class Step
- java.lang.Object
-
- com.trivago.cluecumber.engine.json.pojo.ResultMatch
-
- com.trivago.cluecumber.engine.json.pojo.Step
-
public class Step extends ResultMatch
A Cucumber step.
-
-
Constructor Summary
Constructors Constructor Description Step()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object o)Comparison function for steps.List<ResultMatch>getAfter()Get the after hooks.List<ResultMatch>getBefore()Get the before hooks.intgetCollapseLevel()Get the collapse level of the step.DocStringgetDocString()Get the step's doc string.intgetIndex()Get the internal index of the step.StringgetKeyword()Get the step keyword (Given, When, Then etc.).intgetLine()Get the line number where this step is located.StringgetName()Get the step name.List<Row>getRows()Get the data table rows.longgetTotalDuration()Get the step's total duration.StringgetUniqueName()StringgetUrlFriendlyName()Get the hash of this step in a format that can be used within a URL.inthashCode()Return the step hash.booleanhasHooks()Check if the step has hooks.booleanhasHooksWithContent()Check if there are before or after step hooks with content.booleanhasSubSections()Check if the step has sub sections.StringreturnNameWithArgumentPlaceholders()Get the step name with curly braces instead of concrete arguments.StringreturnNameWithArguments()Get an HTML representation of the step name with highlighted argument values.StringreturnTotalDurationString()Get the step's total duration as a human-readable string.voidsetAfter(List<ResultMatch> after)Set the after hooks.voidsetBefore(List<ResultMatch> before)Set the before hooks.voidsetCollapseLevel(int collapseLevel)Set the collapse level of the step.voidsetDocString(DocString docString)Set the step's doc string.voidsetHasSubSections(boolean hasSubSections)Set if the step has sub sections.voidsetIndex(int index)Set the internal index of the step.voidsetKeyword(String keyword)Set the step keyword (Given, When, Then etc.).voidsetLine(int line)Set the line number where this step is located.voidsetName(String name)Set the step name.voidsetRows(List<Row> rows)Set the data table rows.-
Methods inherited from class com.trivago.cluecumber.engine.json.pojo.ResultMatch
getArguments, getConsolidatedStatus, getConsolidatedStatusString, getEmbeddings, getGlueMethodName, getMatch, getOutput, getResult, getStatus, getStatusString, hasContent, hasEmbeddings, hasOutputs, isFailed, isPassed, isSkipped, setEmbeddings, setMatch, setOutput, setResult
-
-
-
-
Method Detail
-
hasHooksWithContent
public boolean hasHooksWithContent()
Check if there are before or after step hooks with content.- Returns:
- true if step hooks with content exist.
-
hasHooks
public boolean hasHooks()
Check if the step has hooks.- Returns:
- true if the step has hooks.
-
getBefore
public List<ResultMatch> getBefore()
Get the before hooks.- Returns:
- The list of
ResultMatchinstances.
-
setBefore
public void setBefore(List<ResultMatch> before)
Set the before hooks.- Parameters:
before- The list ofResultMatchinstances.
-
getLine
public int getLine()
Get the line number where this step is located.- Returns:
- The line number.
-
setLine
public void setLine(int line)
Set the line number where this step is located.- Parameters:
line- The line number.
-
getName
public String getName()
Get the step name.- Returns:
- The name.
-
setName
public void setName(String name)
Set the step name.- Parameters:
name- The name.
-
returnNameWithArguments
public String returnNameWithArguments()
Get an HTML representation of the step name with highlighted argument values.- Returns:
- The step name with highlighted arguments.
-
returnNameWithArgumentPlaceholders
public String returnNameWithArgumentPlaceholders()
Get the step name with curly braces instead of concrete arguments. This is used for the step overview and scenarios by step page.- Returns:
- The scenario name with empty arguments.
-
getKeyword
public String getKeyword()
Get the step keyword (Given, When, Then etc.).- Returns:
- The keyword.
-
setKeyword
public void setKeyword(String keyword)
Set the step keyword (Given, When, Then etc.).- Parameters:
keyword- The keyword.
-
setRows
public void setRows(List<Row> rows)
Set the data table rows.- Parameters:
rows- The list ofRowinstances.
-
getAfter
public List<ResultMatch> getAfter()
Get the after hooks.- Returns:
- The list of
ResultMatchinstances.
-
setAfter
public void setAfter(List<ResultMatch> after)
Set the after hooks.- Parameters:
after- The list ofResultMatchinstances.
-
getDocString
public DocString getDocString()
Get the step's doc string.- Returns:
- The
DocStringinstance.
-
setDocString
public void setDocString(DocString docString)
Set the step's doc string.- Parameters:
docString- TheDocStringinstance.
-
getTotalDuration
public long getTotalDuration()
Get the step's total duration.- Returns:
- The duration in nanoseconds.
-
returnTotalDurationString
public String returnTotalDurationString()
Get the step's total duration as a human-readable string.- Returns:
- The duration string.
-
getUrlFriendlyName
public String getUrlFriendlyName()
Get the hash of this step in a format that can be used within a URL.- Returns:
- The URL friendly step hash.
-
equals
public boolean equals(Object o)
Comparison function for steps.
-
hashCode
public int hashCode()
Return the step hash.
-
getCollapseLevel
public int getCollapseLevel()
Get the collapse level of the step.- Returns:
- The collapse level of the step.
-
setCollapseLevel
public void setCollapseLevel(int collapseLevel)
Set the collapse level of the step.- Parameters:
collapseLevel- The collapse level of the step.
-
getIndex
public int getIndex()
Get the internal index of the step.- Returns:
- The index of the step.
-
setIndex
public void setIndex(int index)
Set the internal index of the step.- Parameters:
index- The index of the step.
-
hasSubSections
public boolean hasSubSections()
Check if the step has sub sections.- Returns:
- true if the step has sub sections.
-
setHasSubSections
public void setHasSubSections(boolean hasSubSections)
Set if the step has sub sections.- Parameters:
hasSubSections- true if the step has sub sections.
-
getUniqueName
public String getUniqueName()
-
-