Class JConditions

java.lang.Object
io.jmix.masquerade.JConditions

public class JConditions extends Object
Utility class that provides the conditions for checks in web-elements and their wrappers.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final com.codeborne.selenide.WebElementCondition
    Checks whether a checkbox web-element is checked.
    static final com.codeborne.selenide.WebElementCondition
    Checks whether the web-element is in the disabled state.
    static final com.codeborne.selenide.WebElementCondition
    Checks whether the web-element is in the enabled state.
    static final com.codeborne.selenide.WebElementCondition
    Checks whether a web-element exists (element can be invisible or hidden).
    static final com.codeborne.selenide.WebElementCondition
    Checks whether the web-element is in the opened state.
    static final com.codeborne.selenide.WebElementCondition
    Checks whether the web-element is in the readonly state.
    static final com.codeborne.selenide.WebElementCondition
    Checks whether the web-element is in the required state.
    static final com.codeborne.selenide.WebElementCondition
    Checks whether the web-element is in the selected state.
    static final com.codeborne.selenide.WebElementCondition
    Checks whether the web-element is in the visible state.
  • Method Summary

    Modifier and Type
    Method
    Description
    static com.codeborne.selenide.WebElementCondition
    checkedItems(String... checkedItems)
    Creates and returns a condition that checks the checked items of CheckboxGroup web-element wrapper.
    static com.codeborne.selenide.WebElementCondition
    checkedItems(List<String> checkedItems)
    Creates and returns a condition that checks the checked items of CheckboxGroup web-element wrapper.
    static com.codeborne.selenide.WebElementCondition
    checkedItemsContains(String... checkedItems)
    Creates and returns a condition that checks the contained checked items of CheckboxGroup web-element wrapper.
    static com.codeborne.selenide.WebElementCondition
    Creates and returns a condition that checks the contained checked items of CheckboxGroup web-element wrapper.
    static com.codeborne.selenide.WebElementCondition
    checkedItemsCount(int count)
    Creates and returns a condition that checks items count of CheckboxGroup web-element wrapper.
    static com.codeborne.selenide.WebElementCondition
    Creates and returns a condition that checks date value for web-element wrappers for components that supports date (e.g.
    static com.codeborne.selenide.WebElementCondition
    Creates and returns a condition that checks header value for DialogWindow web-elements wrappers.
    static com.codeborne.selenide.WebElementCondition
    label(String label)
    Creates and returns a condition that checks the label value of web-element wrappers for field components.
    static com.codeborne.selenide.WebElementCondition
     
    static com.codeborne.selenide.WebElementCondition
     
    static com.codeborne.selenide.WebElementCondition
     
    static com.codeborne.selenide.WebElementCondition
     
    static com.codeborne.selenide.WebElementCondition
     
    static com.codeborne.selenide.WebElementCondition
     
    static com.codeborne.selenide.WebElementCondition
    selectedItems(String... itemsValue)
    Creates and returns a condition that checks the selected items of multi-select components web-element wrappers (e.g MultiSelectComboBox, MultiSelectComboBoxPicker).
    static com.codeborne.selenide.WebElementCondition
    selectedItems(List<String> itemsValue)
    Creates and returns a condition that checks the selected items of multi-select components web-element wrappers (e.g MultiSelectComboBox, MultiSelectComboBoxPicker).
    static com.codeborne.selenide.WebElementCondition
    Creates and returns a condition that checks the contained selected items of multi-select components web-element wrappers (e.g MultiSelectComboBox, MultiSelectComboBoxPicker).
    static com.codeborne.selenide.WebElementCondition
    Creates and returns a condition that checks the contained value of multi-select components web-element wrappers (e.g MultiSelectComboBox, MultiSelectComboBoxPicker).
    static com.codeborne.selenide.WebElementCondition
    selectedItemsCount(int count)
    Creates and returns a condition that checks the count of selected items of multi-select components web-element wrappers (e.g MultiSelectComboBox, MultiSelectComboBoxPicker).
    static com.codeborne.selenide.WebElementCondition
    Creates and returns a condition that checks time value for web-element wrappers for components that supports time (e.g.
    static com.codeborne.selenide.WebElementCondition
    value(String value)
    Creates and returns a condition that checks the value of web-element wrappers that can have a value.
    static com.codeborne.selenide.WebElementCondition
    Creates and returns a condition that checks the contained value of web-element wrappers that can have a value.
    static com.codeborne.selenide.WebElementCondition
    visibleItems(String... visibleItems)
    Creates and returns a condition that checks visible items for overlay web-element wrappers (inheritors of AbstractOverlay).
    static com.codeborne.selenide.WebElementCondition
    visibleItems(List<String> visibleItems)
    Creates and returns a condition that checks visible items for overlay web-element wrappers (inheritors of AbstractOverlay).
    static com.codeborne.selenide.WebElementCondition
    visibleItemsContains(String... visibleItemsContains)
    Creates and returns a condition that checks visible contained items for overlay web-element wrappers (inheritors of AbstractOverlay).
    static com.codeborne.selenide.WebElementCondition
    visibleItemsContains(List<String> visibleItemsContains)
    Creates and returns a condition that checks visible contained items for overlay web-element wrappers (inheritors of AbstractOverlay).
    static com.codeborne.selenide.WebElementCondition
    visibleItemsCount(int count)
    Creates and returns a condition that checks visible items count for overlay web-element wrappers (inheritors of AbstractOverlay).

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • DISABLED

      public static final com.codeborne.selenide.WebElementCondition DISABLED
      Checks whether the web-element is in the disabled state. This condition can be checked by each web-element wrapper.
    • ENABLED

      public static final com.codeborne.selenide.WebElementCondition ENABLED
      Checks whether the web-element is in the enabled state. This condition can be checked by each web-element wrapper.
    • VISIBLE

      public static final com.codeborne.selenide.WebElementCondition VISIBLE
      Checks whether the web-element is in the visible state. This condition can be checked by each web-element wrapper.
    • READONLY

      public static final com.codeborne.selenide.WebElementCondition READONLY
      Checks whether the web-element is in the readonly state. This condition can be checked by web-element wrapper for components that have a value.
    • EXIST

      public static final com.codeborne.selenide.WebElementCondition EXIST
      Checks whether a web-element exists (element can be invisible or hidden). This condition can be checked by each web-element wrapper.
    • REQUIRED

      public static final com.codeborne.selenide.WebElementCondition REQUIRED
      Checks whether the web-element is in the required state. This condition can be checked by web-elements wrapper for fields.
    • CHECKED

      public static final com.codeborne.selenide.WebElementCondition CHECKED
      Checks whether a checkbox web-element is checked. This condition can only be checked by checkbox-like components.
    • OPENED

      public static final com.codeborne.selenide.WebElementCondition OPENED
      Checks whether the web-element is in the opened state. This condition can be checked by each web-element wrapper that supports opening (e.g. Details, Accordion.Panel).
    • SELECTED

      public static final com.codeborne.selenide.WebElementCondition SELECTED
      Checks whether the web-element is in the selected state. This condition can be checked by each web-element wrapper that supports selecting (e.g. TabSheet.Tab).
  • Method Details

    • notificationPosition

      public static com.codeborne.selenide.WebElementCondition notificationPosition(Notification.Position position)
      Parameters:
      position - expected position of the Notification
      Returns:
      condition that checks the notification position, which can be checked by the Notification web-element wrapper
    • notificationTheme

      public static com.codeborne.selenide.WebElementCondition notificationTheme(Notification.Theme theme)
      Parameters:
      theme - expected theme of the Notification
      Returns:
      condition that checks notification theme, which can be checked by the Notification web-element wrapper
    • notificationTitle

      public static com.codeborne.selenide.WebElementCondition notificationTitle(String title)
      Parameters:
      title - expected title of the Notification
      Returns:
      condition that checks the notification title, which can be checked by the Notification web-element wrapper
    • notificationTitleContains

      public static com.codeborne.selenide.WebElementCondition notificationTitleContains(String title)
      Parameters:
      title - expected contained title part of the Notification
      Returns:
      condition that checks the contained title value, which can be checked by the Notification web-element wrapper
    • notificationMessage

      public static com.codeborne.selenide.WebElementCondition notificationMessage(String message)
      Parameters:
      message - expected message of the Notification
      Returns:
      condition that checks the message, which can be checked by the Notification web-element wrapper
    • notificationMessageContains

      public static com.codeborne.selenide.WebElementCondition notificationMessageContains(String message)
      Parameters:
      message - expected contained message part of the Notification
      Returns:
      condition that checks the contained message value, which can be checked by the Notification web-element wrapper
    • selectedItems

      public static com.codeborne.selenide.WebElementCondition selectedItems(String... itemsValue)
      Creates and returns a condition that checks the selected items of multi-select components web-element wrappers (e.g MultiSelectComboBox, MultiSelectComboBoxPicker).
      Parameters:
      itemsValue - expected selected items as a string presentation value
      Returns:
      condition that checks selected items, which can be checked by the multi-select component
      See Also:
    • selectedItems

      public static com.codeborne.selenide.WebElementCondition selectedItems(List<String> itemsValue)
      Creates and returns a condition that checks the selected items of multi-select components web-element wrappers (e.g MultiSelectComboBox, MultiSelectComboBoxPicker).
      Parameters:
      itemsValue - list of expected selected items as a string presentation value
      Returns:
      condition that checks selected items, which can be checked by the multi-select component
      See Also:
    • selectedItemsContains

      public static com.codeborne.selenide.WebElementCondition selectedItemsContains(String... itemsValue)
      Creates and returns a condition that checks the contained selected items of multi-select components web-element wrappers (e.g MultiSelectComboBox, MultiSelectComboBoxPicker).
      Parameters:
      itemsValue - list of expected contained selected items as a string presentation value
      Returns:
      condition that checks contained selected items, which can be checked by the multi-select component
      See Also:
    • selectedItemsContains

      public static com.codeborne.selenide.WebElementCondition selectedItemsContains(List<String> itemsValue)
      Creates and returns a condition that checks the contained value of multi-select components web-element wrappers (e.g MultiSelectComboBox, MultiSelectComboBoxPicker).
      Parameters:
      itemsValue - list of expected contained items value as a string presentation value
      Returns:
      condition that checks contained items value, which can be checked by the multi-select component
      See Also:
    • selectedItemsCount

      public static com.codeborne.selenide.WebElementCondition selectedItemsCount(int count)
      Creates and returns a condition that checks the count of selected items of multi-select components web-element wrappers (e.g MultiSelectComboBox, MultiSelectComboBoxPicker).
      Parameters:
      count - expected selected items count
      Returns:
      condition that checks the selected items count, which can be checked by the multi-select component
    • checkedItems

      public static com.codeborne.selenide.WebElementCondition checkedItems(String... checkedItems)
      Creates and returns a condition that checks the checked items of CheckboxGroup web-element wrapper.
      Parameters:
      checkedItems - expected checked items as a string presentation value
      Returns:
      condition that checks the checked items, which can be checked by the CheckboxGroup web-element wrapper
      See Also:
    • checkedItems

      public static com.codeborne.selenide.WebElementCondition checkedItems(List<String> checkedItems)
      Creates and returns a condition that checks the checked items of CheckboxGroup web-element wrapper.
      Parameters:
      checkedItems - list of expected checked items as a string presentation value
      Returns:
      condition that checks the checked items, which can be checked by the CheckboxGroup web-element wrapper
      See Also:
    • checkedItemsContains

      public static com.codeborne.selenide.WebElementCondition checkedItemsContains(String... checkedItems)
      Creates and returns a condition that checks the contained checked items of CheckboxGroup web-element wrapper.
      Parameters:
      checkedItems - expected contained checked items as a string presentation value
      Returns:
      condition that checks the contained checked items, which can be checked by the CheckboxGroup web-element wrapper
      See Also:
    • checkedItemsContains

      public static com.codeborne.selenide.WebElementCondition checkedItemsContains(List<String> checkedItems)
      Creates and returns a condition that checks the contained checked items of CheckboxGroup web-element wrapper.
      Parameters:
      checkedItems - list of expected contained checked items as a string presentation value
      Returns:
      condition that checks the contained checked items, which can be checked by the CheckboxGroup web-element wrapper
      See Also:
    • checkedItemsCount

      public static com.codeborne.selenide.WebElementCondition checkedItemsCount(int count)
      Creates and returns a condition that checks items count of CheckboxGroup web-element wrapper.
      Parameters:
      count - expected items count
      Returns:
      condition that checks items count, which can be checked by the CheckboxGroup web-element wrapper
    • value

      public static com.codeborne.selenide.WebElementCondition value(String value)
      Creates and returns a condition that checks the value of web-element wrappers that can have a value.
      Parameters:
      value - expected value as a string presentation value
      Returns:
      condition that checks value, which can be checked by web-element wrapper for components that have a value
    • valueContains

      public static com.codeborne.selenide.WebElementCondition valueContains(String value)
      Creates and returns a condition that checks the contained value of web-element wrappers that can have a value.
      Parameters:
      value - expected contained value as a string presentation value
      Returns:
      condition that checks contained value, which can be checked by web-element wrapper for components that have a value
    • label

      public static com.codeborne.selenide.WebElementCondition label(String label)
      Creates and returns a condition that checks the label value of web-element wrappers for field components.
      Parameters:
      label - expected label value as a string presentation value
      Returns:
      condition that checks label, which can be checked by web-element wrapper for field components
    • visibleItems

      public static com.codeborne.selenide.WebElementCondition visibleItems(String... visibleItems)
      Creates and returns a condition that checks visible items for overlay web-element wrappers (inheritors of AbstractOverlay).
      Parameters:
      visibleItems - expected visible items as a string presentation value
      Returns:
      condition that checks visible items, which can be checked by overlay web-element wrapper
      See Also:
    • visibleItems

      public static com.codeborne.selenide.WebElementCondition visibleItems(List<String> visibleItems)
      Creates and returns a condition that checks visible items for overlay web-element wrappers (inheritors of AbstractOverlay).
      Parameters:
      visibleItems - list of expected visible items as a string presentation value
      Returns:
      condition that checks visible items, which can be checked by overlay web-element wrapper
      See Also:
    • visibleItemsContains

      public static com.codeborne.selenide.WebElementCondition visibleItemsContains(String... visibleItemsContains)
      Creates and returns a condition that checks visible contained items for overlay web-element wrappers (inheritors of AbstractOverlay).
      Parameters:
      visibleItemsContains - expected visible contained items as a string presentation value
      Returns:
      condition that checks visible contained items, which can be checked by overlay web-element wrapper
      See Also:
    • visibleItemsContains

      public static com.codeborne.selenide.WebElementCondition visibleItemsContains(List<String> visibleItemsContains)
      Creates and returns a condition that checks visible contained items for overlay web-element wrappers (inheritors of AbstractOverlay).
      Parameters:
      visibleItemsContains - list of expected visible contained items as a string presentation value
      Returns:
      condition that checks visible contained items, which can be checked by overlay web-element wrapper
      See Also:
    • visibleItemsCount

      public static com.codeborne.selenide.WebElementCondition visibleItemsCount(int count)
      Creates and returns a condition that checks visible items count for overlay web-element wrappers (inheritors of AbstractOverlay).
      Parameters:
      count - expected items count
      Returns:
      condition that checks items count, which can be checked by overlay web-element wrappers (inheritors of AbstractOverlay)
    • dateValue

      public static com.codeborne.selenide.WebElementCondition dateValue(String value)
      Creates and returns a condition that checks date value for web-element wrappers for components that supports date (e.g. DatePicker, DateTimePicker).
      Parameters:
      value - expected date value as a string presentation value
      Returns:
      condition that checks date value, which can be checked by web-element wrappers for components that supports date
    • timeValue

      public static com.codeborne.selenide.WebElementCondition timeValue(String value)
      Creates and returns a condition that checks time value for web-element wrappers for components that supports time (e.g. TimePicker, DateTimePicker).
      Parameters:
      value - expected time value as a string presentation value
      Returns:
      condition that checks time value, which can be checked by web-element wrappers for components that supports time
    • dialogHeader

      public static com.codeborne.selenide.WebElementCondition dialogHeader(String value)
      Creates and returns a condition that checks header value for DialogWindow web-elements wrappers.
      Parameters:
      value - expected header value as a string presentation value
      Returns:
      condition that checks header value, which can be checked by DialogWindow web-element wrapper