Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 55 additions & 0 deletions UITests/Tests/SearchResults.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
//******************************************************************************
//
// Copyright (c) 2024 Microsoft Corporation. All rights reserved.
//
// This code is licensed under the MIT License (MIT).
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
//
//******************************************************************************

using Microsoft.VisualStudio.TestTools.UnitTesting;
using OpenQA.Selenium;
using System.Threading;

namespace UITests.Tests
{
[TestClass]
public class SearchResults : TestBase
{
[ClassInitialize]
public static void ClassInitialize(TestContext context)
{
}

[TestMethod]
[DataRow("a")] // "a" should return results for all groups.
[TestProperty("Description", "Validate the accessibility of the search results page.")]
public void ValidateSearchResultsPageAccessibility(string searchText)
{
var search = Session.FindElementByName("Search");
search.Clear();

search.SendKeys(searchText);
search.SendKeys(Keys.Enter);

Thread.Sleep(100);

var resultsNavView = Session.FindElementByAccessibilityId("resultsNavView");
var resultItems = resultsNavView.FindElements(By.ClassName("Microsoft.UI.Xaml.Controls.NavigationViewItem"));

foreach (var menuItem in resultItems)
{
Thread.Sleep(1000);
menuItem.Click();
AxeHelper.AssertNoAccessibilityErrors();
}
}
}
}
1 change: 1 addition & 0 deletions WinUIGallery/DataModel/ControlInfoDataSource.cs
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,7 @@ private async Task GetControlInfoDataAsync()

item.BadgeString = badgeString;
item.IncludedInBuild = pageType is not null;
item.ImagePath ??= "ms-appx:///Assets/ControlImages/Placeholder.png";
#nullable disable
});

Expand Down