Class Step


  • public class Step
    extends ResultMatch
    A Cucumber step.
    • Constructor Detail

      • Step

        public Step()
    • 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.
      • setBefore

        public void setBefore​(List<ResultMatch> before)
        Set the before hooks.
        Parameters:
        before - The list of ResultMatch instances.
      • 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.
      • getRows

        public List<Row> getRows()
        Get the data table rows.
        Returns:
        The list of Row instances.
      • setRows

        public void setRows​(List<Row> rows)
        Set the data table rows.
        Parameters:
        rows - The list of Row instances.
      • setAfter

        public void setAfter​(List<ResultMatch> after)
        Set the after hooks.
        Parameters:
        after - The list of ResultMatch instances.
      • getDocString

        public DocString getDocString()
        Get the step's doc string.
        Returns:
        The DocString instance.
      • setDocString

        public void setDocString​(DocString docString)
        Set the step's doc string.
        Parameters:
        docString - The DocString instance.
      • 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.
        Overrides:
        equals in class Object
        Parameters:
        o - The step to compare.
        Returns:
        true if the method names match.
      • hashCode

        public int hashCode()
        Return the step hash.
        Overrides:
        hashCode in class Object
        Returns:
        The hash code based on the step method name.
      • 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()