END_TEST;
}
+
+int utcDaliAutomationId(void)
+{
+ ToolkitTestApplication application;
+ Dali::Property::Index automationIdIndex = Toolkit::DevelControl::Property::AUTOMATION_ID;
+ std::string automationIdKey = "automationId";
+ std::string automationIdValue = "test123";
+
+ auto control = Toolkit::Control::New();
+ auto* controlAccessible = Accessibility::Accessible::Get(control);
+
+ // Check that there is no automationId initially
+ DALI_TEST_CHECK(control.GetProperty<std::string>(automationIdIndex).empty());
+ auto attributes = controlAccessible->GetAttributes();
+ DALI_TEST_CHECK(attributes.find(automationIdKey) == attributes.end());
+
+ // Set automationId
+ control.SetProperty(automationIdIndex, automationIdValue);
+
+ // Check that automationId is set
+ DALI_TEST_EQUALS(control.GetProperty<std::string>(automationIdIndex), automationIdValue, TEST_LOCATION);
+ attributes = controlAccessible->GetAttributes();
+ DALI_TEST_CHECK(attributes.find(automationIdKey) != attributes.end());
+ DALI_TEST_EQUALS(attributes[automationIdKey], automationIdValue, TEST_LOCATION);
+
+ // Unset automationId
+ control.SetProperty(automationIdIndex, "");
+
+ // Check that there is no automationId
+ DALI_TEST_CHECK(control.GetProperty<std::string>(automationIdIndex).empty());
+ attributes = controlAccessible->GetAttributes();
+ DALI_TEST_CHECK(attributes.find(automationIdKey) == attributes.end());
+
+ END_TEST;
+}
}
}
+ auto automationId = control.GetProperty<std::string>(Dali::Toolkit::DevelControl::Property::AUTOMATION_ID);
+ if(!automationId.empty())
+ {
+ attributeMap.emplace("automationId", std::move(automationId));
+ }
+
return attributeMap;
}
*
*/
COUNTER_CLOCKWISE_FOCUSABLE_ACTOR_ID,
+
+ /**
+ * @brief Identifier that allows the automation framework to find and interact with this element.
+ * @details Name "automationId", type Property::STRING.
+ * @note This is a string identifier (compared to @c Actor::Property::ID which is an integer).
+ * It will also appear in the AT-SPI tree under the key "automationId".
+ */
+ AUTOMATION_ID,
};
} // namespace Property
const PropertyRegistration Control::Impl::PROPERTY_23(typeRegistration, "accessibilityHidden", Toolkit::DevelControl::Property::ACCESSIBILITY_HIDDEN, Property::BOOLEAN, &Control::Impl::SetProperty, &Control::Impl::GetProperty);
const PropertyRegistration Control::Impl::PROPERTY_24(typeRegistration, "clockwiseFocusableActorId", Toolkit::DevelControl::Property::CLOCKWISE_FOCUSABLE_ACTOR_ID, Property::INTEGER, &Control::Impl::SetProperty, &Control::Impl::GetProperty);
const PropertyRegistration Control::Impl::PROPERTY_25(typeRegistration, "counterClockwiseFocusableActorId", Toolkit::DevelControl::Property::COUNTER_CLOCKWISE_FOCUSABLE_ACTOR_ID, Property::INTEGER, &Control::Impl::SetProperty, &Control::Impl::GetProperty);
+const PropertyRegistration Control::Impl::PROPERTY_26(typeRegistration, "automationId", Toolkit::DevelControl::Property::AUTOMATION_ID, Property::STRING, &Control::Impl::SetProperty, &Control::Impl::GetProperty);
// clang-format on
}
break;
}
+
+ case Toolkit::DevelControl::Property::AUTOMATION_ID:
+ {
+ std::string automationId;
+ if(value.Get(automationId))
+ {
+ controlImpl.mImpl->mAutomationId = automationId;
+ }
+ break;
+ }
}
}
}
value = controlImpl.mImpl->mCounterClockwiseFocusableActorId;
break;
}
+
+ case Toolkit::DevelControl::Property::AUTOMATION_ID:
+ {
+ value = controlImpl.mImpl->mAutomationId;
+ break;
+ }
}
}
std::string mAccessibilityName;
std::string mAccessibilityDescription;
std::string mAccessibilityTranslationDomain;
+ std::string mAutomationId;
bool mAccessibilityHighlightable = false;
bool mAccessibilityHidden = false;
static const PropertyRegistration PROPERTY_23;
static const PropertyRegistration PROPERTY_24;
static const PropertyRegistration PROPERTY_25;
+ static const PropertyRegistration PROPERTY_26;
private:
// Accessibility - notification for highlighted object to check if it is showing.