mirror of
https://github.com/LD-Reborn/Berufsschule_HAM.git
synced 2025-12-20 06:51:55 +00:00
Replaced unreliable sleeps with WebDriverWait
This commit is contained in:
@@ -13,7 +13,7 @@ public static class LocationsHelper
|
||||
NavigateToLocationsPage(driver);
|
||||
IWebElement createLocationButton = driver.FindElement(By.CssSelector("button[data-bs-target=\"#createModal\"]"));
|
||||
createLocationButton.Click();
|
||||
Thread.Sleep(500);
|
||||
AppHelper.AwaitVisible(driver, By.Id("createLocationName"));
|
||||
driver.FindElement(By.Id("createLocationName")).SendKeys(name);
|
||||
driver.FindElement(By.Id("createRoomNumber")).SendKeys(room);
|
||||
driver.FindElement(By.Id("createSeat")).SendKeys(seat);
|
||||
@@ -28,7 +28,7 @@ public static class LocationsHelper
|
||||
string selector = $"button.btn-warning[data-location-name=\"{name}\"][data-room-number=\"{room}\"][data-seat=\"{seat}\"]";
|
||||
IWebElement updateLocationButton = driver.FindElement(By.CssSelector(selector));
|
||||
AppHelper.ScrollIntoViewAndClick(driver, updateLocationButton);
|
||||
Thread.Sleep(500);
|
||||
AppHelper.AwaitVisible(driver, By.Id("editLocationName"));
|
||||
List<string[]> ids = [["editLocationName", newName], ["editRoomNumber", newRoom], ["editSeat", newSeat]];
|
||||
ids.ForEach(id =>
|
||||
{
|
||||
@@ -48,7 +48,7 @@ public static class LocationsHelper
|
||||
NavigateToLocationsPage(driver);
|
||||
IWebElement deleteButton = driver.FindElement(By.CssSelector($"button.btn-danger[data-location-id=\"{cn}\"]"));
|
||||
AppHelper.ScrollIntoViewAndClick(driver, deleteButton);
|
||||
Thread.Sleep(1000);
|
||||
AppHelper.AwaitVisible(driver, By.Id("deleteModal"));
|
||||
driver.FindElement(By.Id("deleteModal"));
|
||||
IWebElement deleteConfirmButton = driver.FindElement(By.Id("deleteForm"));
|
||||
deleteConfirmButton.Click();
|
||||
|
||||
Reference in New Issue
Block a user