Added TryRetryFindToast helper

This commit is contained in:
2025-11-08 11:14:09 +01:00
parent 545f9bd81c
commit 3fd16114c9
2 changed files with 33 additions and 14 deletions

View File

@@ -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]