如何使用 Xamarin UITest 查找 ActionSheet?
How to get find an ActionSheet using Xamarin UITest?
我目前正在尝试在我的 Xamarin.Forms 应用程序中编写一个 Android UITest,但我不确定我应该如何与正在显示的 ActionSheet 进行交互。请注意,我所说的 ActionSheet 是指调用 DisplayActionSheet(string title, string cancel, string destruction, params string[] buttons)
.
时显示的弹出窗口
与视图不同,我不能简单地将 AutomationId 添加到 ActionSheet,因为它没有在我的 SearchForExercisesPage 中定义(见屏幕截图),因此我想我不能简单地使用类似的东西:
app.Tap(foo => foo.Marked("ActionSheet").Index(1))
有人试过使用 Xamarin UITest 与 ActionSheet 交互吗?
试试这个:
app.Tap(foo => foo.Marked("Exercise Details"));
或者这样:
app.Tap(foo => foo.id("text1").Text("Exercise Details"));
或者这样:
app.Tap(foo => foo.id("text1").Index(1));
我目前正在尝试在我的 Xamarin.Forms 应用程序中编写一个 Android UITest,但我不确定我应该如何与正在显示的 ActionSheet 进行交互。请注意,我所说的 ActionSheet 是指调用 DisplayActionSheet(string title, string cancel, string destruction, params string[] buttons)
.
与视图不同,我不能简单地将 AutomationId 添加到 ActionSheet,因为它没有在我的 SearchForExercisesPage 中定义(见屏幕截图),因此我想我不能简单地使用类似的东西:
app.Tap(foo => foo.Marked("ActionSheet").Index(1))
有人试过使用 Xamarin UITest 与 ActionSheet 交互吗?
试试这个:
app.Tap(foo => foo.Marked("Exercise Details"));
或者这样:
app.Tap(foo => foo.id("text1").Text("Exercise Details"));
或者这样:
app.Tap(foo => foo.id("text1").Index(1));