Interface SpecificCheck

All Known Implementing Classes:
SpecificCheck.ComputedCheck, SpecificCheck.ElementCheck

@NullMarked public interface SpecificCheck
Description of how a SpecificCondition must be checked, produced by a SpecificConditionHandler.

A handler only describes the check and never asserts on a value mismatch by itself. The actual ACCEPT/REJECT CheckResult verdict is computed centrally by SpecificCondition.check(com.codeborne.selenide.Driver, org.openqa.selenium.WebElement), so that specific conditions can be negated (shouldNot*) and composed (and/or).

  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Interface
    Description
    static final record 
    SpecificCheck with a precomputed verdict.
    static final record 
    SpecificCheck that evaluates a standard Selenide WebElementCondition against an element.
  • Method Summary

    Modifier and Type
    Method
    Description
    com.codeborne.selenide.CheckResult
    evaluate(com.codeborne.selenide.Driver driver)
    Computes the verdict of this check.
    of(boolean matched, Object actualValue)
    Creates a check with a precomputed verdict, for conditions that are not backed by a single Selenide condition (e.g.
    of(com.codeborne.selenide.SelenideElement element, com.codeborne.selenide.WebElementCondition condition)
    Creates a check that evaluates the given standard Selenide condition against the element.
  • Method Details

    • evaluate

      com.codeborne.selenide.CheckResult evaluate(com.codeborne.selenide.Driver driver)
      Computes the verdict of this check.
      Parameters:
      driver - selenide driver
      Returns:
      verdict of the check
    • of

      static SpecificCheck of(com.codeborne.selenide.SelenideElement element, com.codeborne.selenide.WebElementCondition condition)
      Creates a check that evaluates the given standard Selenide condition against the element.
      Parameters:
      element - element to evaluate the condition against
      condition - standard Selenide condition to evaluate
      Returns:
      element-backed check
    • of

      static SpecificCheck of(boolean matched, Object actualValue)
      Creates a check with a precomputed verdict, for conditions that are not backed by a single Selenide condition (e.g. collection conditions).
      Parameters:
      matched - whether the condition is matched
      actualValue - actual value to report in case of a mismatch
      Returns:
      precomputed check