Set ViewIdResourceName for Appium based tests (#15436)
This commit is contained in:
Родитель
b4f3eed8d3
Коммит
c4dafd6b72
|
@ -34,10 +34,19 @@ namespace Xamarin.Forms.Platform.Android
|
|||
{
|
||||
host.ContentDescription = value;
|
||||
}
|
||||
else if (host.ContentDescription == (_element as VisualElement)?.AutomationId)
|
||||
else if (host.ContentDescription == (_element as Element)?.AutomationId)
|
||||
{
|
||||
host.ContentDescription = null;
|
||||
}
|
||||
|
||||
if (_element is Element element &&
|
||||
!string.IsNullOrWhiteSpace(element.AutomationId) &&
|
||||
host?.Context != null)
|
||||
{
|
||||
// This is used by Appium and other automation testing frameworks
|
||||
// to locate views
|
||||
info.ViewIdResourceName = $"{host.Context.PackageName}:id/{element.AutomationId}";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче