#
This is the latest development version
Some features documented on this page may not yet be available in the published stable version.
absent: Condition[Element] = Condition('is absent in DOM', present.not_)
module-attribute
#
Deprecated 'is absent' condition. Use absent_in_dom instead.
absent_in_dom: Condition[Element] = Condition('is absent in DOM', present_in_dom.not_)
module-attribute
#
blank: Condition[Element] = Match('is blank', actual=lambda element: ('value', webelement.get_attribute('value')) if (webelement := element.locate()) and webelement.tag_name == 'input' else ('text', webelement.text), by=lambda actual_desc_and_result: not actual_desc_and_result[1], _describe_actual_result=lambda actual_desc_and_result: f'actual {actual_desc_and_result[0]}: {actual_desc_and_result[1]}')
module-attribute
#
Asserts that element is blank, i.e. has empty value if is an element or empty text otherwise.
Is similar to the experimental 4-in-1 [_empty][selene.core.match._empty] condition, works only for singular elements: if they are a value-based elements (like inputs and textarea) then it checks for empty value, if they are text-based elements then it checks for empty text content.
The _empty
condition works same but if applied to collection
then will assert that it has size 0. And when applied to "form" element,
then will check for all form "value-like" inputs to be empty.
Hence, the blank
condition is more precise, while empty
is more general.
Because of its generality, the empty
condition can be easier to remember,
but can lead to some kind of confusion when applied to both element
and collection in same test.
checked: Condition[Element] = native_property('checked').value(True)
module-attribute
#
clickable: Condition[Element] = visible.and_(enabled)
module-attribute
#
disabled: Condition[Element] = enabled.not_
module-attribute
#
empty: Condition[Collection] = Match('is empty', __is_empty, by=predicate.is_truthy)
module-attribute
#
Deprecated 'is empty' collection condition. Use size(0) instead.
enabled: Condition[Element] = Match('is enabled', by=lambda element: element.locate().is_enabled())
module-attribute
#
existing: Condition[Element] = Match('is present in DOM', by=__deprecated_is_existing, _falsy_exceptions=(AssertionError, NoSuchElementException))
module-attribute
#
Deprecated 'is existing' condition. Use present_in_dom instead.
hidden: Condition[Element] = Condition('is hidden', visible.not_)
module-attribute
#
hidden_in_dom: Condition[Element] = present_in_dom.and_(visible.not_)
module-attribute
#
present: Condition[Element] = Match('is present in DOM', by=lambda element: fp.thread(element, fp.with_warn('be.present is deprecated, use be.present_in_dom instead', DeprecationWarning), lambda element: element.locate() is not None), _falsy_exceptions=(AssertionError, NoSuchElementException))
module-attribute
#
Deprecated 'is present' condition. Use present_in_dom instead.