From 3fd16114c96025b806a34e9ec45ba52cfe6e7af9 Mon Sep 17 00:00:00 2001 From: LD-Reborn Date: Sat, 8 Nov 2025 11:14:09 +0100 Subject: [PATCH 1/4] Added TryRetryFindToast helper --- .../Helper/AppHelper.cs | 31 +++++++++++++++++++ .../InventoryPageTests.cs | 16 ++-------- 2 files changed, 33 insertions(+), 14 deletions(-) diff --git a/tests/Berufsschule_HAM.E2ETests/Helper/AppHelper.cs b/tests/Berufsschule_HAM.E2ETests/Helper/AppHelper.cs index a0d6563..db0715b 100644 --- a/tests/Berufsschule_HAM.E2ETests/Helper/AppHelper.cs +++ b/tests/Berufsschule_HAM.E2ETests/Helper/AppHelper.cs @@ -65,4 +65,35 @@ public static class AppHelper submit.Click(); Thread.Sleep(250); } + + public static bool TryRetryFindToast(ChromeDriver driver) + { + int retryCounter = 0; + retry: + try + { + + IWebElement successToast = driver.FindElement(By.CssSelector("#toastContainer div.bg-success")); + if (successToast.Displayed) + { + return true; + } + } + catch (Exception) { } + try + { + IWebElement failToast = driver.FindElement(By.CssSelector("#toastContainer div.bg-danger")); + if (failToast.Displayed) + { + return false; + } + } + catch (Exception) { } + if (++retryCounter < 5) + { + Thread.Sleep(250); + goto retry; + } + return false; + } } \ No newline at end of file diff --git a/tests/Berufsschule_HAM.E2ETests/InventoryPageTests.cs b/tests/Berufsschule_HAM.E2ETests/InventoryPageTests.cs index dbd1568..f9c247c 100644 --- a/tests/Berufsschule_HAM.E2ETests/InventoryPageTests.cs +++ b/tests/Berufsschule_HAM.E2ETests/InventoryPageTests.cs @@ -77,13 +77,7 @@ public class InventoryPageTests : IDisposable IWebElement okButton = _driver.FindElement(By.CssSelector("#viewAssetModal button.btn.btn-primary[data-bs-dismiss=\"modal\"]")); okButton.Click(); Thread.Sleep(500); - IWebElement successToast = _driver.FindElement(By.CssSelector("#toastContainer div.bg-success")); - Assert.True(successToast.Displayed); - try - { - IWebElement failToast = _driver.FindElement(By.CssSelector("#toastContainer div.bg-danger")); - Assert.False(failToast.Displayed); - } catch (Exception) {} + Assert.True(AppHelper.TryRetryFindToast(_driver)); } [Fact] @@ -104,13 +98,7 @@ public class InventoryPageTests : IDisposable IWebElement okButton = _driver.FindElement(By.CssSelector("#updateAssetModal button.btn.btn-warning[type=\"submit\"]")); okButton.Click(); Thread.Sleep(500); - IWebElement successToast = _driver.FindElement(By.CssSelector("#toastContainer div.bg-success")); - Assert.True(successToast.Displayed); - try - { - IWebElement failToast = _driver.FindElement(By.CssSelector("#toastContainer div.bg-danger")); - Assert.False(failToast.Displayed); - } catch (Exception) {} + Assert.True(AppHelper.TryRetryFindToast(_driver)); } [Fact] From 1b95cf4d3bb68260ea6411cff66231a73318d644 Mon Sep 17 00:00:00 2001 From: LD-Reborn Date: Sun, 9 Nov 2025 20:28:46 +0100 Subject: [PATCH 2/4] Fixed renaming group identifier not working --- src/Views/Home/Groups.cshtml | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/Views/Home/Groups.cshtml b/src/Views/Home/Groups.cshtml index e01dc6a..aa765f6 100644 --- a/src/Views/Home/Groups.cshtml +++ b/src/Views/Home/Groups.cshtml @@ -324,7 +324,7 @@
-