E2ETests: Refactor to use .FindElement(By.Something())
All checks were successful
Test / Run tests (push) Successful in 2m12s
All checks were successful
Test / Run tests (push) Successful in 2m12s
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
using OpenQA.Selenium;
|
||||
using OpenQA.Selenium.Appium.Windows;
|
||||
using OpenQA.Selenium.Appium;
|
||||
|
||||
namespace Tests.E2ETests {
|
||||
public static class Utils {
|
||||
@@ -10,22 +10,22 @@ namespace Tests.E2ETests {
|
||||
public static readonly string ConfigPath = Path.GetFullPath(@"..\..\..\..\Tests\config.test.ini");
|
||||
public static readonly string TestDatabasePath = Path.GetFullPath(@"..\..\..\..\Tests\ElwigTestDB.sqlite3");
|
||||
|
||||
public static WindowsElement FindById(this WindowsDriver<WindowsElement> session, string accessibilityId) {
|
||||
return session.FindElementByAccessibilityId(accessibilityId);
|
||||
}
|
||||
|
||||
public static void SelectComboBoxItemByCount(this WindowsDriver<WindowsElement> session, string accessibilityId, int count) {
|
||||
var element = session.FindElementByAccessibilityId(accessibilityId);
|
||||
public static void SelectItem(this IWebElement element, int count) {
|
||||
element.Click();
|
||||
element.SendKeys(string.Concat(Enumerable.Repeat(Keys.Down, count)));
|
||||
element.SendKeys(Keys.Enter);
|
||||
}
|
||||
|
||||
public static void SelectComboBoxItemByText(this WindowsDriver<WindowsElement> session, string accessibilityId, string text) {
|
||||
var element = session.FindElementByAccessibilityId(accessibilityId);
|
||||
public static void SelectItem(this IWebElement element, string text) {
|
||||
element.Click();
|
||||
element.SendKeys(text);
|
||||
element.SendKeys(Keys.Enter);
|
||||
}
|
||||
}
|
||||
|
||||
public class By : OpenQA.Selenium.By {
|
||||
public static OpenQA.Selenium.By WpfId(string wpfName) {
|
||||
return new ByAccessibilityId(wpfName);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user