Class StopConditions.StopConditionAdapter

    • Field Detail

      • LOG

        public static final org.apache.logging.log4j.Logger LOG
      • session

        public final Session session
      • ignoreCase

        public final boolean ignoreCase
      • testBefore

        public final boolean testBefore
      • contains

        public final boolean contains
      • jsIsTrueScript

        public String jsIsTrueScript
      • maxPages

        public final int maxPages
    • Constructor Detail

      • StopConditionAdapter

        public StopConditionAdapter​(Session session,
                                    boolean ignoreCase,
                                    boolean testBefore,
                                    boolean contains)
      • StopConditionAdapter

        public StopConditionAdapter​(Session session,
                                    boolean testBefore,
                                    int maxPages)
      • StopConditionAdapter

        public StopConditionAdapter​(Session session)
      • StopConditionAdapter

        public StopConditionAdapter​(Session session,
                                    boolean ignoreCase,
                                    boolean testBefore,
                                    boolean contains,
                                    int maxPages)
    • Method Detail

      • isTrue

        public boolean isTrue()
        Description copied from interface: Condition
        Returns true if the Condition is satisfied.
        Specified by:
        isTrue in interface Condition
        Returns:
        true if the Condition is satisfied.
      • innerIsTrue

        public abstract boolean innerIsTrue()
      • doTestBeforeProcessingPage

        public boolean doTestBeforeProcessingPage()
        Description copied from interface: Table.StopCondition
        Returns true if the condition's isTrue method should be called before processing a page (versus after).
        Specified by:
        doTestBeforeProcessingPage in interface Table.StopCondition
        Returns:
        whether or not to call the condition's isTrue method before processing the page
      • eachRow

        public boolean eachRow​(Table.Row row)
        Description copied from interface: Table.StopCondition
        Called for each row, also gives the StopCondition a chance to skip rows. Return true to include the row, false to skip it.
        Specified by:
        eachRow in interface Table.StopCondition
        Parameters:
        row - the current row to check
        Returns:
        whether or not to include the row
      • setJavascriptIsTrueScript

        public void setJavascriptIsTrueScript​(String script)
        Allow the isTrue method to be implemented in javascript, which allows for extensibility. During execution of the script, hostSession is the active Session and stopCondition is this StopConditionAdapter.
        Parameters:
        script - source script that implements isTrue and "returns" (ends with) a boolean.
      • isTrue

        public boolean isTrue​(String actual,
                              String expected)
        Return true if actual "equals" expected, where "equals" takes into account the ignoreCase and contains settings.
        Parameters:
        actual - the actual value
        expected - the expected value
        Returns:
        true if actual "equals" expected
      • incrementPageCount

        public void incrementPageCount()