diff --git a/src/Compatibility/ControlGallery/src/Android/FormsAppCompatActivity.cs b/src/Compatibility/ControlGallery/src/Android/FormsAppCompatActivity.cs index 0d555a4dbc19..5edc6e93954a 100644 --- a/src/Compatibility/ControlGallery/src/Android/FormsAppCompatActivity.cs +++ b/src/Compatibility/ControlGallery/src/Android/FormsAppCompatActivity.cs @@ -18,6 +18,7 @@ namespace Microsoft.Maui.Controls.ControlGallery.Android [Activity(Label = "Microsoft Maui Controls Compatibility Gallery", Icon = "@drawable/icon", Theme = "@style/MyTheme", MainLauncher = true, HardwareAccelerated = true, + LaunchMode = LaunchMode.SingleTask, ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation | ConfigChanges.ScreenLayout | ConfigChanges.SmallestScreenSize | ConfigChanges.UiMode)] [IntentFilter(new[] { Intent.ActionView }, Categories = new[] diff --git a/src/Compatibility/ControlGallery/src/Core/CoreGallery.cs b/src/Compatibility/ControlGallery/src/Core/CoreGallery.cs index bdb3aff9e2d0..ba6ea8bb6a61 100644 --- a/src/Compatibility/ControlGallery/src/Core/CoreGallery.cs +++ b/src/Compatibility/ControlGallery/src/Core/CoreGallery.cs @@ -550,6 +550,24 @@ public CoreRootPage(Page rootPage, NavigationBehavior navigationBehavior = Navig var corePageView = new CorePageView(rootPage, navigationBehavior); + var resetCheckBox = new CheckBox + { + AutomationId = "ResetMainPage", + VerticalOptions = LayoutOptions.Center, + }; + var resetLabel = new Label + { + Text = "Reset MainPage", + VerticalOptions = LayoutOptions.Center, + }; + var resetLayout = new HorizontalStackLayout + { + resetCheckBox, + resetLabel + }; + resetLayout.HorizontalOptions = LayoutOptions.End; + resetLayout.Margin = new Microsoft.Maui.Thickness(12); + var searchBar = new SearchBar() { AutomationId = "SearchBar" @@ -566,28 +584,43 @@ public CoreRootPage(Page rootPage, NavigationBehavior navigationBehavior = Navig AutomationId = "GoToTestButton", Command = new Command(async () => { + bool resetMainPage = resetCheckBox.IsChecked; + if (!string.IsNullOrEmpty(searchBar.Text)) { if (!(await corePageView.PushPage(searchBar.Text))) { - foreach (CoreViewContainer item in CoreRootView.ItemsSource) + var testCaseScreen = new TestCases.TestCaseScreen(resetMainPage); + await Task.Delay(50); // Load all the issues before try to navigate. + + if (TestCases.TestCaseScreen.PageToAction.ContainsKey(searchBar.Text?.Trim())) + { + TestCases.TestCaseScreen.PageToAction[searchBar.Text?.Trim()](); + } + else { - if (item.Name == searchBar.Text) + foreach (CoreViewContainer item in CoreRootView.ItemsSource) { - CoreRootView.SelectedItem = item; - break; + if (item.Name == searchBar.Text) + { + CoreRootView.SelectedItem = item; + break; + } } } } } else - await Navigation.PushModalAsync(TestCases.GetTestCases()); + { + await Navigation.PushModalAsync(TestCases.GetTestCases(resetMainPage)); + } }) }; var stackLayout = new StackLayout() { Children = { + resetLayout, testCasesButton, searchBar, new Button { diff --git a/src/Compatibility/ControlGallery/src/Core/TestCases.cs b/src/Compatibility/ControlGallery/src/Core/TestCases.cs index 92bcef269e9f..4302f3797d52 100644 --- a/src/Compatibility/ControlGallery/src/Core/TestCases.cs +++ b/src/Compatibility/ControlGallery/src/Core/TestCases.cs @@ -29,64 +29,75 @@ static TextCell MakeIssueCell(string text, string detail, Action tapped) return cell; } - Action ActivatePageAndNavigate(IssueAttribute issueAttribute, Type type) + Action ActivatePageAndNavigate(IssueAttribute issueAttribute, Type type, bool reset = false) { - Action navigationAction = null; - - if (issueAttribute.NavigationBehavior == NavigationBehavior.PushAsync) + if (reset) { - return async () => + return () => { var page = ActivatePage(type); TrackOnInsights(page); - await Navigation.PushAsync(page); + Application.Current.MainPage = page; }; } - - if (issueAttribute.NavigationBehavior == NavigationBehavior.PushModalAsync) + else { - return async () => - { - var page = ActivatePage(type); - TrackOnInsights(page); - await Navigation.PushModalAsync(page); - }; - } + Action navigationAction = null; - if (issueAttribute.NavigationBehavior == NavigationBehavior.Default) - { - return async () => + if (issueAttribute.NavigationBehavior == NavigationBehavior.PushAsync) { - var page = ActivatePage(type); - TrackOnInsights(page); - if (page is ContentPage || page is CarouselPage) + return async () => { - + var page = ActivatePage(type); + TrackOnInsights(page); await Navigation.PushAsync(page); + }; + } - } - else if (page is Shell) - { - Application.Current.MainPage = page; - } - else + if (issueAttribute.NavigationBehavior == NavigationBehavior.PushModalAsync) + { + return async () => { + var page = ActivatePage(type); + TrackOnInsights(page); await Navigation.PushModalAsync(page); - } - }; - } + }; + } - if (issueAttribute.NavigationBehavior == NavigationBehavior.SetApplicationRoot) - { - return () => + if (issueAttribute.NavigationBehavior == NavigationBehavior.Default) { - var page = ActivatePage(type); - TrackOnInsights(page); - Application.Current.MainPage = page; - }; - } + return async () => + { + var page = ActivatePage(type); + TrackOnInsights(page); + + if (page is ContentPage || page is CarouselPage) + { + await Navigation.PushAsync(page); + } + else if (page is Shell) + { + Application.Current.MainPage = page; + } + else + { + await Navigation.PushModalAsync(page); + } + }; + } - return navigationAction; + if (issueAttribute.NavigationBehavior == NavigationBehavior.SetApplicationRoot) + { + return () => + { + var page = ActivatePage(type); + TrackOnInsights(page); + Application.Current.MainPage = page; + }; + } + + return navigationAction; + } } static void TrackOnInsights(Page page) @@ -159,8 +170,10 @@ void VerifyNoDuplicates() }); } - public TestCaseScreen() + public TestCaseScreen(bool resetMainPage = false) { + ResetMainPage = resetMainPage; + AutomationId = "TestCasesIssueList"; Intent = TableIntent.Settings; @@ -178,13 +191,15 @@ public TestCaseScreen() IssueTestNumber = attribute.IssueTestNumber, Name = attribute.DisplayName, Description = attribute.Description, - Action = ActivatePageAndNavigate(attribute, type) + Action = ActivatePageAndNavigate(attribute, type, ResetMainPage) }).ToList(); VerifyNoDuplicates(); FilterIssues(); } + + internal bool ResetMainPage { get; set; } public void FilterTracker(IssueTracker tracker) { @@ -293,7 +308,7 @@ from issueModel in _issues bool IsExempt(string name) => _exemptNames.Contains(name); } - public static NavigationPage GetTestCases() + public static NavigationPage GetTestCases(bool resetMainPage = false) { TestCaseScreen testCaseScreen = null; var rootLayout = new StackLayout(); @@ -347,7 +362,7 @@ public static NavigationPage GetTestCases() rootLayout.Children.Add(searchBar); rootLayout.Children.Add(searchButton); - testCaseScreen = new TestCaseScreen(); + testCaseScreen = new TestCaseScreen(resetMainPage); rootLayout.Children.Add(CreateTrackerFilter(testCaseScreen)); diff --git a/src/Compatibility/ControlGallery/src/Issues.Shared/Bugzilla26233.cs b/src/Compatibility/ControlGallery/src/Issues.Shared/Bugzilla26233.cs index 269fad0934b4..2741bf7c5c57 100644 --- a/src/Compatibility/ControlGallery/src/Issues.Shared/Bugzilla26233.cs +++ b/src/Compatibility/ControlGallery/src/Issues.Shared/Bugzilla26233.cs @@ -24,7 +24,7 @@ protected override void Init() var listview = new ListView(); listview.ItemTemplate = new DataTemplate(typeof(ItemTemplate)); listview.ItemsSource = new string[] { "item1", "item2", "item3", "item4", "item5", null, null }; - var btnBack = new Button { Text = "back", Command = new Command(() => Navigation.PopAsync()) }; + var btnBack = new Button { AutomationId = "back", Text = "back", Command = new Command(() => Navigation.PopAsync()) }; listview.ItemSelected += (s, e) => Navigation.PushAsync(new ContentPage { Content = btnBack }); var btnPush = new Button { diff --git a/src/Compatibility/ControlGallery/src/Issues.Shared/Bugzilla27731.cs b/src/Compatibility/ControlGallery/src/Issues.Shared/Bugzilla27731.cs index f3db2d43cc3d..3d25e6e03f95 100644 --- a/src/Compatibility/ControlGallery/src/Issues.Shared/Bugzilla27731.cs +++ b/src/Compatibility/ControlGallery/src/Issues.Shared/Bugzilla27731.cs @@ -36,7 +36,7 @@ public Page2(string title) Children = { new Label { Text = $"This is page {count}." }, - new Button { Text = "Click", Command = new Command(() => Navigation.PushAsync(new Page2(title))) } + new Button { AutomationId = "Click", Text = "Click", Command = new Command(() => Navigation.PushAsync(new Page2(title))) } } }; } diff --git a/src/Compatibility/ControlGallery/src/Issues.Shared/Bugzilla28570.cs b/src/Compatibility/ControlGallery/src/Issues.Shared/Bugzilla28570.cs index dcc7f2ea78b1..0b3a8ee4ee8a 100644 --- a/src/Compatibility/ControlGallery/src/Issues.Shared/Bugzilla28570.cs +++ b/src/Compatibility/ControlGallery/src/Issues.Shared/Bugzilla28570.cs @@ -82,6 +82,7 @@ protected override void Init() }; Button makeBig = new Button(); + makeBig.AutomationId = "Tap"; makeBig.Text = "Tap"; // // Clicking button first time does not scroll event though scrollView.Height is already set. diff --git a/src/Compatibility/ControlGallery/src/Issues.Shared/Bugzilla29363.cs b/src/Compatibility/ControlGallery/src/Issues.Shared/Bugzilla29363.cs index 2388b1214479..459b14332396 100644 --- a/src/Compatibility/ControlGallery/src/Issues.Shared/Bugzilla29363.cs +++ b/src/Compatibility/ControlGallery/src/Issues.Shared/Bugzilla29363.cs @@ -28,6 +28,7 @@ protected override void Init() Button modal = new Button { + AutomationId = "ModalPushPopTest", Text = "Modal Push Pop Test", FontAttributes = FontAttributes.Bold, FontSize = 25, diff --git a/src/Compatibility/ControlGallery/src/Issues.Shared/Bugzilla29453.cs b/src/Compatibility/ControlGallery/src/Issues.Shared/Bugzilla29453.cs index f76986e0bfe9..72da9cd3a2a4 100644 --- a/src/Compatibility/ControlGallery/src/Issues.Shared/Bugzilla29453.cs +++ b/src/Compatibility/ControlGallery/src/Issues.Shared/Bugzilla29453.cs @@ -24,6 +24,7 @@ protected override void Init() { Children = { new Label { + AutomationId ="Page1", HorizontalTextAlignment = TextAlignment.Center, Text = "Page 1" } diff --git a/src/Compatibility/ControlGallery/src/Issues.Shared/Bugzilla30166.cs b/src/Compatibility/ControlGallery/src/Issues.Shared/Bugzilla30166.cs index c436dd9bc4e5..54bac6fecd6a 100644 --- a/src/Compatibility/ControlGallery/src/Issues.Shared/Bugzilla30166.cs +++ b/src/Compatibility/ControlGallery/src/Issues.Shared/Bugzilla30166.cs @@ -25,11 +25,13 @@ protected override void Init() { Content = new Button { + AutomationId = "PushModal", Text = "Push Modal", Command = new Command(async () => await Navigation.PushModalAsync(new ContentPage { Content = new Button { + AutomationId = "Back", Text = "Back", Command = new Command(async () => await Navigation.PopModalAsync()), }, diff --git a/src/Compatibility/ControlGallery/src/Issues.Shared/Bugzilla31366.cs b/src/Compatibility/ControlGallery/src/Issues.Shared/Bugzilla31366.cs index af27d1d8b71b..c469131ac9c6 100644 --- a/src/Compatibility/ControlGallery/src/Issues.Shared/Bugzilla31366.cs +++ b/src/Compatibility/ControlGallery/src/Issues.Shared/Bugzilla31366.cs @@ -23,8 +23,8 @@ protected override void Init() var page1 = new ContentPage() { Title = "Page1" }; var successLabel = new Label(); - var startPopOnAppearing = new Button() { Text = "Start PopOnAppearing Test" }; - var startModalStack = new Button() { Text = "Start ModalStack Test" }; + var startPopOnAppearing = new Button() { AutomationId = "StartPopOnAppearingTest", Text = "Start PopOnAppearing Test" }; + var startModalStack = new Button() { AutomationId = "StartModalStackTest", Text = "Start ModalStack Test" }; page1.Content = new StackLayout() { diff --git a/src/Compatibility/ControlGallery/src/Issues.Shared/Bugzilla31395.cs b/src/Compatibility/ControlGallery/src/Issues.Shared/Bugzilla31395.cs index 1d85bc08d544..888da2620fb9 100644 --- a/src/Compatibility/ControlGallery/src/Issues.Shared/Bugzilla31395.cs +++ b/src/Compatibility/ControlGallery/src/Issues.Shared/Bugzilla31395.cs @@ -26,6 +26,7 @@ protected override void Init() VerticalOptions = LayoutOptions.Center, Children = { new Button { + AutomationId ="SwitchMainPage", Text = "Switch Main Page", Command = new Command (() => SwitchMainPage ()) } diff --git a/src/Compatibility/ControlGallery/src/Issues.Shared/Bugzilla31688.cs b/src/Compatibility/ControlGallery/src/Issues.Shared/Bugzilla31688.cs index e902f1da10ea..cf8c11814438 100644 --- a/src/Compatibility/ControlGallery/src/Issues.Shared/Bugzilla31688.cs +++ b/src/Compatibility/ControlGallery/src/Issues.Shared/Bugzilla31688.cs @@ -86,7 +86,7 @@ class Page3 : ContentPage { private Page3() { - Content = new Label { Text = "Page 3" }; + Content = new Label { AutomationId = "Page3", Text = "Page 3" }; } public static async Task CreateAsync() diff --git a/src/Compatibility/ControlGallery/src/Issues.Shared/Bugzilla34007.cs b/src/Compatibility/ControlGallery/src/Issues.Shared/Bugzilla34007.cs index 6cb9b64ca435..5d7de1ccb46d 100644 --- a/src/Compatibility/ControlGallery/src/Issues.Shared/Bugzilla34007.cs +++ b/src/Compatibility/ControlGallery/src/Issues.Shared/Bugzilla34007.cs @@ -24,6 +24,7 @@ protected override void Init() var button0 = new Button { + AutomationId = "Button0", Text = "Button 0", HorizontalOptions = LayoutOptions.Fill, VerticalOptions = LayoutOptions.Fill @@ -31,6 +32,7 @@ protected override void Init() var button1 = new Button { + AutomationId = "Button1", Text = "Button 1", HorizontalOptions = LayoutOptions.Fill, VerticalOptions = LayoutOptions.Fill diff --git a/src/Compatibility/ControlGallery/src/Issues.Shared/Bugzilla35472.cs b/src/Compatibility/ControlGallery/src/Issues.Shared/Bugzilla35472.cs index 7704b49a65d4..629c213fee20 100644 --- a/src/Compatibility/ControlGallery/src/Issues.Shared/Bugzilla35472.cs +++ b/src/Compatibility/ControlGallery/src/Issues.Shared/Bugzilla35472.cs @@ -22,7 +22,7 @@ public class Bugzilla35472 : TestNavigationPage protected override void Init() { // Set up the scroll viewer page - var scrollToButton = new Button() { Text = "Now push this button" }; + var scrollToButton = new Button() { AutomationId = "NowPushButton", Text = "Now push this button" }; var stackLayout = new StackLayout(); @@ -46,6 +46,7 @@ protected override void Init() // Set up the start page var goButton = new Button() { + AutomationId = "PushButton", Text = "Push this button" }; diff --git a/src/Compatibility/ControlGallery/src/Issues.Shared/Bugzilla35477.cs b/src/Compatibility/ControlGallery/src/Issues.Shared/Bugzilla35477.cs index 029e7e3fe3e1..c5f174e66387 100644 --- a/src/Compatibility/ControlGallery/src/Issues.Shared/Bugzilla35477.cs +++ b/src/Compatibility/ControlGallery/src/Issues.Shared/Bugzilla35477.cs @@ -26,7 +26,7 @@ protected override void Init() Text = "Tap the frame below. The label with the text 'No taps yet' should change its text to 'Frame was tapped'." }; var frame = new Frame() { }; - var frameLabel = new Label() { Text = "Tap here" }; + var frameLabel = new Label() { AutomationId = "TapHere", Text = "Tap here" }; frame.Content = new StackLayout() { Children = { frameLabel } }; diff --git a/src/Compatibility/ControlGallery/src/Issues.Shared/Bugzilla38723.cs b/src/Compatibility/ControlGallery/src/Issues.Shared/Bugzilla38723.cs index 6368ab0505a5..d6e9d05c7545 100644 --- a/src/Compatibility/ControlGallery/src/Issues.Shared/Bugzilla38723.cs +++ b/src/Compatibility/ControlGallery/src/Issues.Shared/Bugzilla38723.cs @@ -35,7 +35,8 @@ protected override void Init() }; var button = new Button - { + { + AutomationId = "SELECT", Text = "SELECT" }; diff --git a/src/Compatibility/ControlGallery/src/Issues.Shared/Bugzilla39489.cs b/src/Compatibility/ControlGallery/src/Issues.Shared/Bugzilla39489.cs index 6f58f1ce8c42..6bc6017f0060 100644 --- a/src/Compatibility/ControlGallery/src/Issues.Shared/Bugzilla39489.cs +++ b/src/Compatibility/ControlGallery/src/Issues.Shared/Bugzilla39489.cs @@ -81,9 +81,9 @@ public Bz39489Content() Interlocked.Increment(ref s_count); Debug.WriteLine($">>>>> Bz39489Content Bz39489Content 54: Constructor, count is {s_count}"); - var button = new Button { Text = "New Page" }; + var button = new Button { AutomationId = "NewPage", Text = "New Page" }; - var gcbutton = new Button { Text = "GC" }; + var gcbutton = new Button { AutomationId = "GC", Text = "GC" }; var map = new Bz39489Map(); diff --git a/src/Compatibility/ControlGallery/src/Issues.Shared/Bugzilla39636.xaml b/src/Compatibility/ControlGallery/src/Issues.Shared/Bugzilla39636.xaml index 3c8aa6ed3c6c..27d481b14c07 100644 --- a/src/Compatibility/ControlGallery/src/Issues.Shared/Bugzilla39636.xaml +++ b/src/Compatibility/ControlGallery/src/Issues.Shared/Bugzilla39636.xaml @@ -21,7 +21,7 @@ - + diff --git a/src/Compatibility/ControlGallery/src/Issues.Shared/Bugzilla39821.cs b/src/Compatibility/ControlGallery/src/Issues.Shared/Bugzilla39821.cs index 5d6dbe7dc9d4..a4de976264af 100644 --- a/src/Compatibility/ControlGallery/src/Issues.Shared/Bugzilla39821.cs +++ b/src/Compatibility/ControlGallery/src/Issues.Shared/Bugzilla39821.cs @@ -28,7 +28,7 @@ protected override void Init() var success = new Label { Text = "Success", IsVisible = false }; - var button = new Button() { Text = "Animate" }; + var button = new Button() { AutomationId = "Animate", Text = "Animate" }; Content = new StackLayout { diff --git a/src/Compatibility/ControlGallery/src/Issues.Shared/Bugzilla40005.cs b/src/Compatibility/ControlGallery/src/Issues.Shared/Bugzilla40005.cs index 7e72116786d3..64acc371d62b 100644 --- a/src/Compatibility/ControlGallery/src/Issues.Shared/Bugzilla40005.cs +++ b/src/Compatibility/ControlGallery/src/Issues.Shared/Bugzilla40005.cs @@ -42,6 +42,7 @@ public Page1() { var btn = new Button() { + AutomationId = GoToPage2, Text = GoToPage2 }; btn.Clicked += async (sender, e) => @@ -56,6 +57,7 @@ public Page1() { new Label { + AutomationId = PageOneLabel, HorizontalTextAlignment = TextAlignment.Center, Text = PageOneLabel }, @@ -122,6 +124,7 @@ public Page2() { new Label { + AutomationId = PageTwoLabel, HorizontalTextAlignment = TextAlignment.Center, Text = PageTwoLabel } diff --git a/src/Compatibility/ControlGallery/src/Issues.Shared/Bugzilla41842.cs b/src/Compatibility/ControlGallery/src/Issues.Shared/Bugzilla41842.cs index b1cb628d1c13..e9a0d2a53a47 100644 --- a/src/Compatibility/ControlGallery/src/Issues.Shared/Bugzilla41842.cs +++ b/src/Compatibility/ControlGallery/src/Issues.Shared/Bugzilla41842.cs @@ -24,7 +24,7 @@ protected override void Init() Flyout = new Page() { Title = "Flyout" }; Detail = new NavigationPage(new Page()); - Detail = new NavigationPage(new ContentPage { Content = new Label { Text = "Success" } }); + Detail = new NavigationPage(new ContentPage { Content = new Label { AutomationId = "Success", Text = "Success" } }); } #if UITEST diff --git a/src/Compatibility/ControlGallery/src/Issues.Shared/Bugzilla42069.cs b/src/Compatibility/ControlGallery/src/Issues.Shared/Bugzilla42069.cs index 7518ac99851c..5bc63dd0ec94 100644 --- a/src/Compatibility/ControlGallery/src/Issues.Shared/Bugzilla42069.cs +++ b/src/Compatibility/ControlGallery/src/Issues.Shared/Bugzilla42069.cs @@ -43,14 +43,14 @@ protected override void Init() var label2 = new Label { Text = instructions2, HorizontalTextAlignment = TextAlignment.Center }; var startButton = new Button { Text = "Start" }; - startButton.Clicked += (sender, args) => + startButton.Clicked += async (sender, args) => { // We have to do the push-pop-push dance because NavigationPage // holds a reference to its last page for unrelated reasons; our concern // here is that the first Bugzilla42069_Page that we pushed gets collected - PushAsync(new Bugzilla42069_Page(), false); - PopAsync(false); - PushAsync(new Bugzilla42069_Page(), false); + await PushAsync(new Bugzilla42069_Page(), false); + await PopAsync(false); + await PushAsync(new Bugzilla42069_Page(), false); }; var collectButton = new Button { Text = "Collect" }; diff --git a/src/Compatibility/ControlGallery/src/Issues.Shared/Bugzilla42277.cs b/src/Compatibility/ControlGallery/src/Issues.Shared/Bugzilla42277.cs index ed99f7f75311..bbf841dad041 100644 --- a/src/Compatibility/ControlGallery/src/Issues.Shared/Bugzilla42277.cs +++ b/src/Compatibility/ControlGallery/src/Issues.Shared/Bugzilla42277.cs @@ -39,32 +39,32 @@ public MyDataTemplateSelector() { _1Template = new DataTemplate(() => { - return new TextCell { Text = Success1 }; + return new TextCell { AutomationId = Success1, Text = Success1 }; }); _2Template = new DataTemplate(() => { - return new TextCell { Text = Success2 }; + return new TextCell { AutomationId = Success2, Text = Success2 }; }); _3Template = new DataTemplate(() => { - return new TextCell { Text = Success3 }; + return new TextCell { AutomationId = Success3, Text = Success3 }; }); _4Template = new DataTemplate(() => { - return new TextCell { Text = Success4 }; + return new TextCell { AutomationId = Success4, Text = Success4 }; }); _5Template = new DataTemplate(() => { - return new TextCell { Text = Success5 }; + return new TextCell { AutomationId = Success5, Text = Success5 }; }); _6Template = new DataTemplate(() => { - return new TextCell { Text = Success6 }; + return new TextCell { AutomationId = Success6, Text = Success6 }; }); } diff --git a/src/Compatibility/ControlGallery/src/Issues.Shared/Bugzilla42956.cs b/src/Compatibility/ControlGallery/src/Issues.Shared/Bugzilla42956.cs index 59c93b88405f..47b58369624a 100644 --- a/src/Compatibility/ControlGallery/src/Issues.Shared/Bugzilla42956.cs +++ b/src/Compatibility/ControlGallery/src/Issues.Shared/Bugzilla42956.cs @@ -69,7 +69,7 @@ public MyDataTemplateSelector() seventeen = new DataTemplate(() => new ViewCell { View = new Label { Text = "I am the seventeen!" } }); eighteen = new DataTemplate(() => new ViewCell { View = new Label { Text = "I am the eighteen!" } }); nineteen = new DataTemplate(() => new ViewCell { View = new Label { Text = "I am the nineteen! Is this how I should be databinding? Whatev." } }); - twenty = new DataTemplate(() => new ViewCell { View = new Label { Text = Success } }); + twenty = new DataTemplate(() => new ViewCell { View = new Label { AutomationId = Success, Text = Success } }); } protected override DataTemplate OnSelectTemplate(object item, BindableObject container) diff --git a/src/Compatibility/ControlGallery/src/Issues.Shared/Bugzilla43519.cs b/src/Compatibility/ControlGallery/src/Issues.Shared/Bugzilla43519.cs index 562e9f8cd25f..2656762d19a8 100644 --- a/src/Compatibility/ControlGallery/src/Issues.Shared/Bugzilla43519.cs +++ b/src/Compatibility/ControlGallery/src/Issues.Shared/Bugzilla43519.cs @@ -64,6 +64,7 @@ protected override void Init() Children.Add(mdp); Children.Add(new ContentPage { + AutomationId = Page2, Title = Page2, Content = new StackLayout { diff --git a/src/Compatibility/ControlGallery/src/Issues.Shared/Bugzilla45702.cs b/src/Compatibility/ControlGallery/src/Issues.Shared/Bugzilla45702.cs index 0afefa022f4e..51d8aabe14b4 100644 --- a/src/Compatibility/ControlGallery/src/Issues.Shared/Bugzilla45702.cs +++ b/src/Compatibility/ControlGallery/src/Issues.Shared/Bugzilla45702.cs @@ -35,7 +35,7 @@ class DetailPage45702 : ContentPage { public DetailPage45702() { - var button = new Button { Text = "Click me" }; + var button = new Button { AutomationId = "ClickMe", Text = "Click me" }; button.Clicked += Button_Clicked; Content = button; } diff --git a/src/Compatibility/ControlGallery/src/Issues.Shared/Bugzilla45722.cs b/src/Compatibility/ControlGallery/src/Issues.Shared/Bugzilla45722.cs index 016aa4ea648e..da8521af6dcb 100644 --- a/src/Compatibility/ControlGallery/src/Issues.Shared/Bugzilla45722.cs +++ b/src/Compatibility/ControlGallery/src/Issues.Shared/Bugzilla45722.cs @@ -86,7 +86,7 @@ protected override void Init() lv.ItemsSource = items; lv.ItemTemplate = dt; - var button = new Button { Text = Update }; + var button = new Button { AutomationId = Update, Text = Update }; button.Clicked += (sender, args) => { items.Clear(); @@ -96,7 +96,7 @@ protected override void Init() } }; - var collect = new Button() { Text = Collect }; + var collect = new Button() { AutomationId = Collect, Text = Collect }; collect.Clicked += (sender, args) => { GarbageCollectionHelper.Collect(); diff --git a/src/Compatibility/ControlGallery/src/Issues.Shared/Bugzilla51238.cs b/src/Compatibility/ControlGallery/src/Issues.Shared/Bugzilla51238.cs index 9a3ca1729574..5caf29981189 100644 --- a/src/Compatibility/ControlGallery/src/Issues.Shared/Bugzilla51238.cs +++ b/src/Compatibility/ControlGallery/src/Issues.Shared/Bugzilla51238.cs @@ -51,6 +51,7 @@ protected override void Init() var button = new Button { + AutomationId = "TapMe", Text = "Tap Me!", HorizontalOptions = LayoutOptions.Center, VerticalOptions = LayoutOptions.Center diff --git a/src/Compatibility/ControlGallery/src/Issues.Shared/Bugzilla53179.cs b/src/Compatibility/ControlGallery/src/Issues.Shared/Bugzilla53179.cs index d6e3d20f0ee6..8c522ba8942b 100644 --- a/src/Compatibility/ControlGallery/src/Issues.Shared/Bugzilla53179.cs +++ b/src/Compatibility/ControlGallery/src/Issues.Shared/Bugzilla53179.cs @@ -23,9 +23,9 @@ class TestPage : ContentPage public TestPage(int index) { - nextBtn = new Button { Text = "Next Page" }; - rmBtn = new Button { Text = "Remove previous pages" }; - popBtn = new Button { Text = "Back" }; + nextBtn = new Button { AutomationId = "Next Page", Text = "Next Page" }; + rmBtn = new Button { AutomationId = "Remove previous pages", Text = "Remove previous pages" }; + popBtn = new Button { AutomationId = "Back", Text = "Back" }; nextBtn.Clicked += async (sender, e) => await Navigation.PushAsync(new TestPage(index + 1)); rmBtn.Clicked += (sender, e) => diff --git a/src/Compatibility/ControlGallery/src/Issues.Shared/Bugzilla53445.cs b/src/Compatibility/ControlGallery/src/Issues.Shared/Bugzilla53445.cs index 9f5061004f43..a926528ad797 100644 --- a/src/Compatibility/ControlGallery/src/Issues.Shared/Bugzilla53445.cs +++ b/src/Compatibility/ControlGallery/src/Issues.Shared/Bugzilla53445.cs @@ -22,7 +22,7 @@ protected override void Init() { var layout = new StackLayout { VerticalOptions = LayoutOptions.Fill, Spacing = 20 }; - var status = new Label { Text = "Success" }; + var status = new Label { AutomationId = "Success", Text = "Success" }; var instructions = new Label { Text = "Disable all of the layouts by clicking the Toggle button. Then click the buttons inside each layout. If the status changes from Success to Fail, this test has failed." }; diff --git a/src/Compatibility/ControlGallery/src/Issues.Shared/Bugzilla55365.cs b/src/Compatibility/ControlGallery/src/Issues.Shared/Bugzilla55365.cs index 1879878a04be..b902dbfa233f 100644 --- a/src/Compatibility/ControlGallery/src/Issues.Shared/Bugzilla55365.cs +++ b/src/Compatibility/ControlGallery/src/Issues.Shared/Bugzilla55365.cs @@ -52,17 +52,18 @@ protected override void Init() _itemsPanel.Children.Add(view); } - var clearButton = new Button { Text = "Clear", Command = new Command(o => viewModel.Clear()) }; + var clearButton = new Button { AutomationId = "Clear", Text = "Clear", Command = new Command(o => viewModel.Clear()) }; _layout.Children.Add(clearButton); var collectButton = new Button { + AutomationId = "Garbage", Text = "Garbage", Command = new Command(o => -{ - GarbageCollectionHelper.Collect(); - _layout.Children.Add(new Label { Text = "Success" }); -}) + { + GarbageCollectionHelper.Collect(); + _layout.Children.Add(new Label { Text = "Success" }); + }) }; _layout.Children.Add(collectButton); _layout.Children.Add(_itemsPanel); diff --git a/src/Compatibility/ControlGallery/src/Issues.Shared/Bugzilla57674.cs b/src/Compatibility/ControlGallery/src/Issues.Shared/Bugzilla57674.cs index d186e5392a26..961ae53d578c 100644 --- a/src/Compatibility/ControlGallery/src/Issues.Shared/Bugzilla57674.cs +++ b/src/Compatibility/ControlGallery/src/Issues.Shared/Bugzilla57674.cs @@ -16,7 +16,7 @@ namespace Microsoft.Maui.Controls.ControlGallery.Issues [NUnit.Framework.Category(Compatibility.UITests.UITestCategories.Bugzilla)] #endif [Preserve(AllMembers = true)] - [Issue(IssueTracker.Bugzilla, 57674, "ListView not honoring INotifyCollectionChanged ", PlatformAffected.UWP)] + [Issue(IssueTracker.Bugzilla, 57674, "ListView not honoring INotifyCollectionChanged", PlatformAffected.UWP)] public class Bugzilla57674 : TestContentPage { MyCollection _myCollection; diff --git a/src/Compatibility/ControlGallery/src/Issues.Shared/Bugzilla59896.cs b/src/Compatibility/ControlGallery/src/Issues.Shared/Bugzilla59896.cs index f926c022dc58..82f051e5fd62 100644 --- a/src/Compatibility/ControlGallery/src/Issues.Shared/Bugzilla59896.cs +++ b/src/Compatibility/ControlGallery/src/Issues.Shared/Bugzilla59896.cs @@ -14,7 +14,7 @@ namespace Microsoft.Maui.Controls.ControlGallery.Issues [NUnit.Framework.Category(Compatibility.UITests.UITestCategories.Bugzilla)] #endif [Preserve(AllMembers = true)] - [Issue(IssueTracker.Bugzilla, 59896, "v2.4.0: Adding inserting section to ListView causes crash IF first section is empty ", PlatformAffected.iOS)] + [Issue(IssueTracker.Bugzilla, 59896, "v2.4.0: Adding inserting section to ListView causes crash IF first section is empty", PlatformAffected.iOS)] public class Bugzilla59896 : TestContentPage { const string btnAdd = "btnAdd"; diff --git a/src/Compatibility/ControlGallery/src/Issues.Shared/Bugzilla59925.cs b/src/Compatibility/ControlGallery/src/Issues.Shared/Bugzilla59925.cs index a5b4c4a2ab86..0a9a74eaab99 100644 --- a/src/Compatibility/ControlGallery/src/Issues.Shared/Bugzilla59925.cs +++ b/src/Compatibility/ControlGallery/src/Issues.Shared/Bugzilla59925.cs @@ -32,12 +32,14 @@ protected override void Init() var buttonBigger = new Button { - Text = "Bigger", + AutomationId = "Bigger", + Text = "Bigger" }; buttonBigger.Clicked += (x, o) => ChangeFontSize(Delta); var buttonSmaller = new Button { + AutomationId = "Smaller", Text = "Smaller" }; buttonSmaller.Clicked += (x, o) => ChangeFontSize(-Delta); diff --git a/src/Compatibility/ControlGallery/src/Issues.Shared/GitHub1648.cs b/src/Compatibility/ControlGallery/src/Issues.Shared/GitHub1648.cs index 392ebf79e62e..061c5dfe1d17 100644 --- a/src/Compatibility/ControlGallery/src/Issues.Shared/GitHub1648.cs +++ b/src/Compatibility/ControlGallery/src/Issues.Shared/GitHub1648.cs @@ -41,10 +41,12 @@ public SimplePage() { Children = { new Label { + AutomationId = "Success", Text = "Success" }, new Button { + AutomationId = "Reload", Text = "Reload", Command = new Command(() => Navigation.PopModalAsync()) } diff --git a/src/Compatibility/ControlGallery/src/Issues.Shared/Issue11333.xaml b/src/Compatibility/ControlGallery/src/Issues.Shared/Issue11333.xaml index 1d2a018f8250..e5d286f44044 100644 --- a/src/Compatibility/ControlGallery/src/Issues.Shared/Issue11333.xaml +++ b/src/Compatibility/ControlGallery/src/Issues.Shared/Issue11333.xaml @@ -69,6 +69,7 @@