mirror of
https://github.com/LD-Reborn/Berufsschule_HAM.git
synced 2025-12-20 06:51:55 +00:00
Refactored HomePageTests
This commit is contained in:
@@ -7,6 +7,8 @@ namespace Berufsschule_HAM.E2ETests.Helper;
|
||||
|
||||
public static class AppHelper
|
||||
{
|
||||
public const string ServerUrl = "http://localhost:5275";
|
||||
public static Uri ServerUri = new(ServerUrl);
|
||||
public static async Task<Process> StartApp(string appUrl)
|
||||
{
|
||||
var startInfo = new ProcessStartInfo
|
||||
@@ -44,9 +46,17 @@ public static class AppHelper
|
||||
throw new Exception("Server did not start within 60 seconds");
|
||||
}
|
||||
|
||||
public static void Login(ChromeDriver driver, string serverUrl)
|
||||
public static ChromeDriver GetChromeDriver()
|
||||
{
|
||||
driver.Navigate().GoToUrl(serverUrl);
|
||||
var options = new ChromeOptions();
|
||||
//options.AddArgument("--headless");
|
||||
return new ChromeDriver(options);
|
||||
|
||||
}
|
||||
|
||||
public static void Login(ChromeDriver driver)
|
||||
{
|
||||
driver.Navigate().GoToUrl(ServerUrl);
|
||||
IWebElement username = driver.FindElement(By.Id("username"));
|
||||
username.SendKeys("admin");
|
||||
IWebElement password = driver.FindElement(By.Id("password"));
|
||||
|
||||
Reference in New Issue
Block a user