Skip to content

squape.vps

vph_property

vph_property(object_or_name, property_name, expected_value, msg)

Highlights the object then verifies its property. The object remains highlighted during verification to make it easier to identify on potential screenshots.

Parameters:

Name Type Description Default
object_or_name any

symbolic name, real name, or object reference

required
property_name str

name of the property to verify

required
expected_value any

expected value of the verified property

required
msg str

verification message

required

Returns:

Type Description
bool

True if verification is positive, False otherwise

Source code in squape/vps.py
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
def vph_property(
    object_or_name: any, property_name: str, expected_value: any, msg: str
) -> bool:
    """Highlights the object then verifies its property.
    The object remains highlighted during verification to make it easier to identify
    on potential screenshots.

    Args:
        object_or_name (any): symbolic name, real name, or object reference
        property_name (str): name of the property to verify
        expected_value (any): expected value of the verified property
        msg (str): verification message

    Returns:
        True if verification is positive, False otherwise
    """

    obj = squish.waitForObjectExists(object_or_name)
    property_value = operator.attrgetter(property_name)(obj)
    squish.highlightObject(obj, 200, False)
    result = test.compare(property_value, expected_value, msg)
    time.sleep(0.200)
    return result