-
-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #102 from MADE-Apps/feature/conditions
Added WaitUntil conditions
- Loading branch information
Showing
78 changed files
with
1,067 additions
and
571 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
namespace WindowsAlarmsAndClock.Elements | ||
{ | ||
using System; | ||
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; | ||
using OpenQA.Selenium.Remote; | ||
|
||
/// <summary> | ||
/// Defines a <see cref="WindowsElement"/> wrapper for the AlarmPopup control. | ||
/// </summary> | ||
public class AlarmPopup : WindowsElementWrapper | ||
{ | ||
/// <summary> | ||
/// Initializes a new instance of the <see cref="AlarmPopup"/> class. | ||
/// </summary> | ||
/// <param name="element"> | ||
/// The <see cref="WindowsElement"/> reference. | ||
/// </param> | ||
public AlarmPopup(WindowsElement element) | ||
: base(element) | ||
{ | ||
} | ||
|
||
/// <summary> | ||
/// Allows conversion of a <see cref="WindowsElement"/> to the <see cref="AlarmPopup"/> without direct casting. | ||
/// </summary> | ||
/// <param name="element"> | ||
/// The <see cref="WindowsElement"/>. | ||
/// </param> | ||
/// <returns> | ||
/// The <see cref="DurationPicker"/>. | ||
/// </returns> | ||
public static implicit operator AlarmPopup(WindowsElement element) | ||
{ | ||
return new AlarmPopup(element); | ||
} | ||
|
||
/// <summary> | ||
/// Allows conversion of a <see cref="AppiumWebElement"/> to the <see cref="AlarmPopup"/> without direct casting. | ||
/// </summary> | ||
/// <param name="element"> | ||
/// The <see cref="AppiumWebElement"/>. | ||
/// </param> | ||
/// <returns> | ||
/// The <see cref="AlarmPopup"/>. | ||
/// </returns> | ||
public static implicit operator AlarmPopup(AppiumWebElement element) | ||
{ | ||
return new AlarmPopup(element as WindowsElement); | ||
} | ||
|
||
/// <summary> | ||
/// Allows conversion of a <see cref="RemoteWebElement"/> to the <see cref="AlarmPopup"/> without direct casting. | ||
/// </summary> | ||
/// <param name="element"> | ||
/// The <see cref="AppiumWebElement"/>. | ||
/// </param> | ||
/// <returns> | ||
/// The <see cref="AlarmPopup"/>. | ||
/// </returns> | ||
public static implicit operator AlarmPopup(RemoteWebElement element) | ||
{ | ||
return new AlarmPopup(element as WindowsElement); | ||
} | ||
|
||
public CustomTimePicker DurationPicker => this.FindElement(ByExtensions.AutomationId("DurationPicker")); | ||
|
||
public TextBox AlarmNameInput => this.FindElement(By.Name("Alarm name")); | ||
|
||
public Button SaveButton => this.Element.FindElement(ByExtensions.AutomationId("PrimaryButton")); | ||
|
||
public void SetTime(TimeSpan time) | ||
{ | ||
this.DurationPicker.SetTime(time); | ||
} | ||
|
||
public void SetName(string name) | ||
{ | ||
this.AlarmNameInput.SetText(name); | ||
} | ||
|
||
public void SaveAlarm() | ||
{ | ||
this.SaveButton.Click(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
namespace WindowsAlarmsAndClock.Pages | ||
{ | ||
using System; | ||
using Legerity.Pages; | ||
using Legerity.Windows.Elements.WinUI; | ||
using Legerity.Windows.Extensions; | ||
using OpenQA.Selenium; | ||
|
||
public class AppPage : BasePage | ||
{ | ||
public NavigationView NavigationView => this.WindowsApp.FindElement(this.Trait); | ||
|
||
/// <summary> | ||
/// Gets a given trait of the page to verify that the page is in view. | ||
/// </summary> | ||
protected override By Trait => ByExtensions.AutomationId("NavView"); | ||
|
||
/// <summary> | ||
/// Selects a sample from the available options with the given name. | ||
/// </summary> | ||
/// <typeparam name="TPage">The type of page to return.</typeparam> | ||
/// <param name="name">The name of the sample to click.</param> | ||
/// <returns>The <see cref="TPage"/> instance.</returns> | ||
public TPage SelectPage<TPage>(string name) where TPage : BasePage | ||
{ | ||
this.NavigationView.ClickMenuOption(name); | ||
return Activator.CreateInstance<TPage>(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.