mirror of
https://github.com/LD-Reborn/Berufsschule_HAM.git
synced 2025-12-20 06:51:55 +00:00
Added HomePage_ShouldContainButtons E2E test, added login helper
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
using System.Diagnostics;
|
||||
using System.Net;
|
||||
using Microsoft.AspNetCore.Mvc.Routing;
|
||||
using OpenQA.Selenium;
|
||||
using OpenQA.Selenium.Chrome;
|
||||
|
||||
namespace Berufsschule_HAM.E2ETests.Helper;
|
||||
|
||||
@@ -42,4 +43,16 @@ public static class AppHelper
|
||||
}
|
||||
throw new Exception("Server did not start within 60 seconds");
|
||||
}
|
||||
|
||||
public static void Login(ChromeDriver driver, string serverUrl)
|
||||
{
|
||||
driver.Navigate().GoToUrl(serverUrl);
|
||||
IWebElement username = driver.FindElement(By.Id("username"));
|
||||
username.SendKeys("admin");
|
||||
IWebElement password = driver.FindElement(By.Id("password"));
|
||||
password.SendKeys("Test1234.");
|
||||
IWebElement submit = driver.FindElement(By.CssSelector("button[type=\"submit\"]"));
|
||||
submit.Click();
|
||||
Thread.Sleep(250);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user