alttester / alttester/AltTester-Unity-SDK

Inconsistent exception thrown by WaitForComponentProperty for non-existent property

未关闭
#1,855 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
2.2.6
主要语言
C#
星标
121
派生
24
PR 合并指标
30 天内没有已合并 PR

描述

### 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)
```

贡献指南

打开贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。