mirror of
https://github.com/LD-Reborn/Berufsschule_HAM.git
synced 2025-12-20 06:51:55 +00:00
Improved assetspage test
This commit is contained in:
@@ -43,7 +43,7 @@ public class AssetsPageTests : IDisposable
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void AssetsPage_ShouldCreateAndShowDetailAndUpdateAndDeleteGroup()
|
||||
public void AssetsPage_ShouldCreateAndShowDetailAndUpdateAndDeleteAsset()
|
||||
{
|
||||
AppHelper.Login(_driver);
|
||||
AssetsHelper.NavigateToAssetsPage(_driver);
|
||||
@@ -53,16 +53,13 @@ public class AssetsPageTests : IDisposable
|
||||
_driver.ExecuteJavaScript($"$('tr[data-asset-id=\"{id}\"]').click()");
|
||||
AppHelper.AwaitVisible(_driver, By.Id("viewAssetModal"));
|
||||
_driver.FindElement(By.Name("Barcode"));
|
||||
bool noEmptyInputsFound = false;
|
||||
try
|
||||
{
|
||||
_driver.FindElement(By.CssSelector("#viewAssetModal input[value=\"\"]"));
|
||||
} catch (Exception)
|
||||
{
|
||||
noEmptyInputsFound = true;
|
||||
}
|
||||
Assert.True(noEmptyInputsFound);
|
||||
var inputs = _driver.FindElements(By.CssSelector("#viewAssetModal input"));
|
||||
|
||||
var emptyInputs = inputs
|
||||
.Where(i => string.IsNullOrWhiteSpace(i.GetAttribute("value")))
|
||||
.ToList();
|
||||
|
||||
Assert.Empty(emptyInputs);
|
||||
AssetsHelper.UpdateAsset(_driver, row);
|
||||
AssetsHelper.DeleteAsset(_driver, row);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user