alttester / alttester/AltTester-Unity-SDK

Inconsistent exception thrown by WaitForComponentProperty for non-existent property

Open
#1,855 0 comments 0 reactions 0 assignees View on GitHub
2.2.6
Dominant language
C#
Stars
121
Forks
24
PR merge metrics
No merged PRs in 30d

Description

### Summary
When calling `WaitForComponentProperty` with a non-existent property name, the exception thrown is inconsistent between language bindings:

- **.NET and Java:** Throws `PropertyNotFoundException` as expected.
- **Python:** Throws `WaitTimeOutException` instead of `PropertyNotFoundException`.

#### Example code:

.NET:
```csharp
try
{
altElement.WaitForComponentProperty(componentName, unexistingPropertyName, propertyValue, assemblyName);
Assert.Fail();
}
catch (PropertyNotFoundException exception)
{
Assert.That(exception.Message, Is.EqualTo($"Property {unexistingPropertyName} not found"));
}
```

Python:
```python
with pytest.raises(exceptions.WaitTimeOutException) as exception:
alt_element.wait_for_component_property(
component_name, unexisting_property_name, property_value, assembly_name, timeout=2)

assert "Property " + unexisting_property_name + " not found" in str(exception.value)
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.