Files
elwig/Tests/E2ETests/Utils.cs
Lorenz Stechauner f09753ccc2
All checks were successful
Test / Run tests (push) Successful in 2m4s
Remove byte order marks
2024-07-26 19:44:41 +02:00

32 lines
1.1 KiB
C#

using OpenQA.Selenium;
using OpenQA.Selenium.Appium;
namespace Tests.E2ETests {
public static class Utils {
public const int WINDOW_OPEN_SLEEP = 2000;
public static readonly string ApplicationPath = Path.GetFullPath(@"..\..\..\..\Elwig\bin\Debug\net8.0-windows\Elwig.exe");
public static readonly string ConfigPath = Path.GetFullPath(@"..\..\..\..\Tests\config.test.ini");
public static readonly string TestDatabasePath = Path.GetFullPath(@"..\..\..\..\Tests\ElwigTestDB.sqlite3");
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 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);
}
}
}