Skip to content

Commit

Permalink
Merge branch 'main' into dependabot/nuget/nunit-3.13.3
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesmcroft authored Mar 24, 2022
2 parents 1750e6a + 6003bf5 commit aac3571
Show file tree
Hide file tree
Showing 50 changed files with 222 additions and 164 deletions.
11 changes: 6 additions & 5 deletions samples/MADESampleApp/Pages/AppPage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ namespace MADESampleApp.Pages
using System;
using System.Collections.Generic;
using Legerity.Pages;
using Legerity.Windows;
using Legerity.Windows.Elements.Core;
using Legerity.Windows.Elements.MADE;
using Legerity.Windows.Extensions;
Expand All @@ -13,17 +14,17 @@ public class AppPage : BasePage
/// <summary>
/// Gets a given trait of the page to verify that the page is in view.
/// </summary>
protected override By Trait => ByExtensions.AutomationId("DropDownList");
protected override By Trait => WindowsByExtras.AutomationId("DropDownList");

public InputValidator TextInputValidator =>
this.WindowsApp.FindElement(ByExtensions.AutomationId("TextBoxValidator"));
this.WindowsApp.FindElement(WindowsByExtras.AutomationId("TextBoxValidator"));

public TextBox TextInput => this.TextInputValidator.Input(ByExtensions.AutomationId("TextBox"));
public TextBox TextInput => this.TextInputValidator.Input(WindowsByExtras.AutomationId("TextBox"));

public InputValidator DateInputValidator =>
this.WindowsApp.FindElement(ByExtensions.AutomationId("DatePickerValidator"));
this.WindowsApp.FindElement(WindowsByExtras.AutomationId("DatePickerValidator"));

public DatePicker DateInput => this.DateInputValidator.Input(ByExtensions.AutomationId("DatePicker"));
public DatePicker DateInput => this.DateInputValidator.Input(WindowsByExtras.AutomationId("DatePicker"));

public DropDownList DropDownList => this.WindowsApp.FindElementByAutomationId("DropDownList");

Expand Down
6 changes: 3 additions & 3 deletions samples/WindowsAlarmsAndClock/Elements/AlarmPopup.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
namespace WindowsAlarmsAndClock.Elements
{
using System;
using Legerity.Windows;
using Legerity.Windows.Elements;
using Legerity.Windows.Elements.Core;
using Legerity.Windows.Extensions;
using OpenQA.Selenium;
using OpenQA.Selenium.Appium;
using OpenQA.Selenium.Appium.Windows;
Expand Down Expand Up @@ -67,11 +67,11 @@ public static implicit operator AlarmPopup(RemoteWebElement element)
return new AlarmPopup(element as WindowsElement);
}

public CustomTimePicker DurationPicker => this.FindElement(ByExtensions.AutomationId("DurationPicker"));
public CustomTimePicker DurationPicker => this.FindElement(WindowsByExtras.AutomationId("DurationPicker"));

public TextBox AlarmNameInput => this.FindElement(By.Name("Alarm name"));

public Button SaveButton => this.Element.FindElement(ByExtensions.AutomationId("PrimaryButton"));
public Button SaveButton => this.Element.FindElement(WindowsByExtras.AutomationId("PrimaryButton"));

public void SetTime(TimeSpan time)
{
Expand Down
7 changes: 3 additions & 4 deletions samples/WindowsAlarmsAndClock/Elements/CustomTimePicker.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
namespace WindowsAlarmsAndClock.Elements
{
using System;

using Legerity.Windows;
using Legerity.Windows.Elements;
using Legerity.Windows.Extensions;
using OpenQA.Selenium.Appium;
using OpenQA.Selenium.Appium.Windows;
using OpenQA.Selenium.Remote;
Expand Down Expand Up @@ -74,8 +73,8 @@ public static implicit operator CustomTimePicker(RemoteWebElement element)
/// </param>
public void SetTime(TimeSpan time)
{
this.Element.FindElement(ByExtensions.AutomationId("HourPicker")).FindElementByName(time.ToString("%h")).Click();
this.Element.FindElement(ByExtensions.AutomationId("MinutePicker")).FindElementByName(time.ToString("mm")).Click();
this.Element.FindElement(WindowsByExtras.AutomationId("HourPicker")).FindElementByName(time.ToString("%h")).Click();
this.Element.FindElement(WindowsByExtras.AutomationId("MinutePicker")).FindElementByName(time.ToString("mm")).Click();
}
}
}
11 changes: 5 additions & 6 deletions samples/WindowsAlarmsAndClock/Pages/AlarmPage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@ namespace WindowsAlarmsAndClock.Pages
using System.Linq;
using Elements;
using Legerity.Extensions;
using Legerity.Windows.Extensions;

using Legerity.Windows;
using Microsoft.VisualStudio.TestTools.UnitTesting;

using OpenQA.Selenium;
Expand All @@ -26,16 +25,16 @@ public class AlarmPage : AppPage
/// </summary>
public AlarmPage()
{
this.addAlarmButton = ByExtensions.AutomationId("AddAlarmButton");
this.alarmList = ByExtensions.AutomationId("AlarmListView");
this.addAlarmButton = WindowsByExtras.AutomationId("AddAlarmButton");
this.alarmList = WindowsByExtras.AutomationId("AlarmListView");
}

public AlarmPopup AlarmPopup => this.WindowsApp.FindElement(ByExtensions.AutomationId("EditFlyout"));
public AlarmPopup AlarmPopup => this.WindowsApp.FindElement(WindowsByExtras.AutomationId("EditFlyout"));

/// <summary>
/// Gets a given trait of the page to verify that the page is in view.
/// </summary>
protected override By Trait => ByExtensions.AutomationId("AddAlarmButton");
protected override By Trait => WindowsByExtras.AutomationId("AddAlarmButton");

/// <summary>
/// Navigates to adding an alarm.
Expand Down
4 changes: 2 additions & 2 deletions samples/WindowsAlarmsAndClock/Pages/AppPage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ namespace WindowsAlarmsAndClock.Pages
{
using System;
using Legerity.Pages;
using Legerity.Windows;
using Legerity.Windows.Elements.WinUI;
using Legerity.Windows.Extensions;
using OpenQA.Selenium;

public class AppPage : BasePage
Expand All @@ -13,7 +13,7 @@ public class AppPage : BasePage
/// <summary>
/// Gets a given trait of the page to verify that the page is in view.
/// </summary>
protected override By Trait => ByExtensions.AutomationId("NavView");
protected override By Trait => WindowsByExtras.AutomationId("NavView");

/// <summary>
/// Selects a sample from the available options with the given name.
Expand Down
23 changes: 11 additions & 12 deletions samples/WindowsAlarmsAndClock/Pages/EditAlarmPage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ namespace WindowsAlarmsAndClock.Pages
using System;

using Legerity.Pages;
using Legerity.Windows.Extensions;

using Legerity.Windows;
using OpenQA.Selenium;
using OpenQA.Selenium.Appium.Windows;

Expand Down Expand Up @@ -38,21 +37,21 @@ public class EditAlarmPage : BasePage
/// </summary>
public EditAlarmPage()
{
this.alarmTimePicker = ByExtensions.AutomationId("AlarmTimePicker");
this.alarmNameTextBox = ByExtensions.AutomationId("AlarmNameTextBox");
this.alarmRepeatButton = ByExtensions.AutomationId("AlarmRepeatsToggleButton");
this.alarmSoundButton = ByExtensions.AutomationId("AlarmSoundButton");
this.alarmSnoozeComboBox = ByExtensions.AutomationId("AlarmSnoozeCombobox");
this.alarmSaveButton = ByExtensions.AutomationId("AlarmSaveButton");
this.alarmCancelButton = ByExtensions.AutomationId("CancelButton");
this.alarmDeleteButton = ByExtensions.AutomationId("AlarmDeleteButton");
this.alarmDeleteDialog = ByExtensions.AutomationId("DeleteConfirmationDialog");
this.alarmTimePicker = WindowsByExtras.AutomationId("AlarmTimePicker");
this.alarmNameTextBox = WindowsByExtras.AutomationId("AlarmNameTextBox");
this.alarmRepeatButton = WindowsByExtras.AutomationId("AlarmRepeatsToggleButton");
this.alarmSoundButton = WindowsByExtras.AutomationId("AlarmSoundButton");
this.alarmSnoozeComboBox = WindowsByExtras.AutomationId("AlarmSnoozeCombobox");
this.alarmSaveButton = WindowsByExtras.AutomationId("AlarmSaveButton");
this.alarmCancelButton = WindowsByExtras.AutomationId("CancelButton");
this.alarmDeleteButton = WindowsByExtras.AutomationId("AlarmDeleteButton");
this.alarmDeleteDialog = WindowsByExtras.AutomationId("DeleteConfirmationDialog");
}

/// <summary>
/// Gets a given trait of the page to verify that the page is in view.
/// </summary>
protected override By Trait => ByExtensions.AutomationId("EditAlarmHeader");
protected override By Trait => WindowsByExtras.AutomationId("EditAlarmHeader");

/// <summary>
/// Sets the time of the alarm being edited.
Expand Down
8 changes: 4 additions & 4 deletions samples/WindowsCommunityToolkitSampleApp/Pages/AppPage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,27 +4,27 @@ namespace WindowsCommunityToolkitSampleApp.Pages
using System.Linq;
using System.Threading;
using Legerity.Pages;
using Legerity.Windows;
using Legerity.Windows.Elements.Core;
using Legerity.Windows.Elements.WinUI;
using Legerity.Windows.Extensions;
using OpenQA.Selenium;
using OpenQA.Selenium.Appium;

public class AppPage : BasePage
{
public NavigationView NavigationView => this.WindowsApp.FindElement(this.Trait);

public AutoSuggestBox SampleSearchBox => this.NavigationView.FindElement(ByExtensions.AutomationId("SearchBox"));
public AutoSuggestBox SampleSearchBox => this.NavigationView.FindElement(WindowsByExtras.AutomationId("SearchBox"));

/// <summary>
/// Gets the UI component associated with the sample picker.
/// </summary>
public GridView SamplePicker => this.WindowsApp.FindElement(ByExtensions.AutomationId("SamplePickerGridView"));
public GridView SamplePicker => this.WindowsApp.FindElement(WindowsByExtras.AutomationId("SamplePickerGridView"));

/// <summary>
/// Gets a given trait of the page to verify that the page is in view.
/// </summary>
protected override By Trait => ByExtensions.AutomationId("NavView");
protected override By Trait => WindowsByExtras.AutomationId("NavView");

/// <summary>
/// Selects a sample from the available options with the given name.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
namespace WindowsCommunityToolkitSampleApp.Pages
{
using Legerity.Windows;
using Legerity.Windows.Elements.Core;
using Legerity.Windows.Elements.WCT;
using Legerity.Windows.Extensions;
using OpenQA.Selenium;

/// <summary>
Expand All @@ -17,7 +17,7 @@ public BladeViewPage()
{
}

public BladeView BladeView => this.WindowsApp.FindElement(ByExtensions.AutomationId("BladeView"));
public BladeView BladeView => this.WindowsApp.FindElement(WindowsByExtras.AutomationId("BladeView"));

/// <summary>
/// Gets a given trait of the page to verify that the page is in view.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
namespace WindowsCommunityToolkitSampleApp.Pages
{
using Legerity.Windows;
using Legerity.Windows.Elements.WCT;
using Legerity.Windows.Extensions;
using OpenQA.Selenium;
using Shouldly;

Expand All @@ -17,7 +17,7 @@ public CarouselPage()
{
}

public Carousel Carousel => this.WindowsApp.FindElement(ByExtensions.AutomationId("CarouselControl"));
public Carousel Carousel => this.WindowsApp.FindElement(WindowsByExtras.AutomationId("CarouselControl"));

/// <summary>
/// Gets a given trait of the page to verify that the page is in view.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
namespace WindowsCommunityToolkitSampleApp.Pages
{
using Legerity.Windows;
using Legerity.Windows.Elements.WCT;
using Legerity.Windows.Extensions;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using OpenQA.Selenium;

Expand All @@ -10,9 +10,9 @@ namespace WindowsCommunityToolkitSampleApp.Pages
/// </summary>
public class ExpanderPage : AppPage
{
public Expander VerticalExpander => this.WindowsApp.FindElement(ByExtensions.AutomationId("Expander1"));
public Expander VerticalExpander => this.WindowsApp.FindElement(WindowsByExtras.AutomationId("Expander1"));

public Expander HorizontalExpander => this.WindowsApp.FindElement(ByExtensions.AutomationId("Expander2"));
public Expander HorizontalExpander => this.WindowsApp.FindElement(WindowsByExtras.AutomationId("Expander2"));

/// <summary>
/// Gets a given trait of the page to verify that the page is in view.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,20 @@ namespace WindowsCommunityToolkitSampleApp.Pages
using Elements;
using Legerity.Exceptions;
using Legerity.Extensions;
using Legerity.Windows;
using Legerity.Windows.Elements.Core;
using Legerity.Windows.Elements.WCT;
using Legerity.Windows.Extensions;
using OpenQA.Selenium;

/// <summary>
/// Defines the InAppNotification page of the Windows Community Toolkit sample application.
/// </summary>
public class InAppNotificationPage : AppPage
{
private readonly By exampleInAppNotificationLocator = ByExtensions.AutomationId("ExampleInAppNotification");
private readonly By exampleInAppNotificationLocator = WindowsByExtras.AutomationId("ExampleInAppNotification");

private readonly By exampleCodeInAppNotificationLocator =
ByExtensions.AutomationId("ExampleVSCodeInAppNotification");
WindowsByExtras.AutomationId("ExampleVSCodeInAppNotification");

/// <summary>
/// Gets the example in-app notification element.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
namespace WindowsCommunityToolkitSampleApp.Pages
{
using Legerity.Windows;
using Legerity.Windows.Elements.WCT;
using Legerity.Windows.Extensions;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using OpenQA.Selenium;

Expand All @@ -14,7 +14,7 @@ public class RadialGaugePage : AppPage

public RadialGaugePage()
{
this.radialGauge = ByExtensions.AutomationId("RadialGauge");
this.radialGauge = WindowsByExtras.AutomationId("RadialGauge");
}

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
namespace XamlControlsGallery.Pages.BasicInput
{
using Legerity.Pages;
using Legerity.Windows;
using Legerity.Windows.Elements.WinUI;
using Legerity.Windows.Extensions;
using Microsoft.VisualStudio.TestTools.UnitTesting;

using OpenQA.Selenium;
Expand All @@ -19,7 +19,7 @@ public class RatingControlPage : BasePage
/// </summary>
public RatingControlPage()
{
this.simpleRatingControl = ByExtensions.AutomationId("RatingControl1");
this.simpleRatingControl = WindowsByExtras.AutomationId("RatingControl1");
}

/// <summary>
Expand Down
4 changes: 2 additions & 2 deletions samples/XamlControlsGallery/Pages/Collections/ListBoxPage.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
namespace XamlControlsGallery.Pages.Collections
{
using Legerity.Pages;
using Legerity.Windows;
using Legerity.Windows.Elements.Core;
using Legerity.Windows.Extensions;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using OpenQA.Selenium;

Expand All @@ -11,7 +11,7 @@ namespace XamlControlsGallery.Pages.Collections
/// </summary>
public class ListBoxPage : BasePage
{
private readonly By colorListBox = ByExtensions.AutomationId("ListBox1");
private readonly By colorListBox = WindowsByExtras.AutomationId("ListBox1");

/// <summary>
/// Gets a given trait of the page to verify that the page is in view.
Expand Down
4 changes: 2 additions & 2 deletions samples/XamlControlsGallery/Pages/Media/InkToolbarPage.cs
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
namespace XamlControlsGallery.Pages.Media
{
using Legerity.Pages;
using Legerity.Windows;
using Legerity.Windows.Elements.Core;
using Legerity.Windows.Extensions;
using OpenQA.Selenium;

/// <summary>
/// Defines the InkToolbar page of the XAML Controls Gallery application.
/// </summary>
public class InkToolbarPage : BasePage
{
public InkToolbar InkToolbar => this.WindowsApp.FindElement(ByExtensions.AutomationId("inkToolbar"));
public InkToolbar InkToolbar => this.WindowsApp.FindElement(WindowsByExtras.AutomationId("inkToolbar"));

/// <summary>
/// Gets a given trait of the page to verify that the page is in view.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
namespace XamlControlsGallery.Pages.MenusAndToolbars
{
using Legerity.Pages;
using Legerity.Windows;
using Legerity.Windows.Elements.Core;
using Legerity.Windows.Extensions;

using OpenQA.Selenium;

/// <summary>
/// Defines the CommandBar page of the XAML Controls Gallery application.
/// </summary>
public class CommandBarPage : BasePage
{
public CommandBar PrimaryCommandBar => this.WindowsApp.FindElement(ByExtensions.AutomationId("PrimaryCommandBar"));
public CommandBar PrimaryCommandBar => this.WindowsApp.FindElement(WindowsByExtras.AutomationId("PrimaryCommandBar"));

/// <summary>
/// Gets a given trait of the page to verify that the page is in view.
Expand Down
Loading

0 comments on commit aac3571

Please sign in to comment.