Updating Mudblazor Version

This commit is contained in:
Jonathan
2025-04-27 19:34:50 -04:00
parent 38ff4e3e89
commit e820457176
153 changed files with 5010 additions and 2059 deletions
-1
View File
@@ -40,5 +40,4 @@ public class BaseTest
return WebsiteInstance;
}
}
}
+2 -2
View File
@@ -9,9 +9,9 @@ public abstract class BasePage : BaseElement
{
}
private IEnumerable<string> Links =>
private IEnumerable<string> Links =>
Website.FindAllWithTag(Website.Find("content"), "a")
.Select(x => x.GetAttribute("href"));
.Select(x => x.GetAttribute("href"));
public abstract string Url { get; set; }
+11 -11
View File
@@ -9,20 +9,20 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Discord.Net.Webhook" Version="3.6.0" />
<PackageReference Include="Microsoft.Extensions.Configuration" Version="8.0.14" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.0.0" />
<PackageReference Include="NUnit" Version="3.13.2" />
<PackageReference Include="NUnit3TestAdapter" Version="4.2.0" />
<PackageReference Include="NUnit.Analyzers" Version="3.2.0" />
<PackageReference Include="coverlet.collector" Version="3.1.0" />
<PackageReference Include="Selenium.WebDriver" Version="4.1.0" />
<PackageReference Include="Selenium.WebDriver.ChromeDriver" Version="101.0.4951.4100" />
<PackageReference Include="Selenium.WebDriver.GeckoDriver" Version="0.31.0" />
<PackageReference Include="Discord.Net.Webhook" Version="3.6.0"/>
<PackageReference Include="Microsoft.Extensions.Configuration" Version="8.0.14"/>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.0.0"/>
<PackageReference Include="NUnit" Version="3.13.2"/>
<PackageReference Include="NUnit3TestAdapter" Version="4.2.0"/>
<PackageReference Include="NUnit.Analyzers" Version="3.2.0"/>
<PackageReference Include="coverlet.collector" Version="3.1.0"/>
<PackageReference Include="Selenium.WebDriver" Version="4.1.0"/>
<PackageReference Include="Selenium.WebDriver.ChromeDriver" Version="101.0.4951.4100"/>
<PackageReference Include="Selenium.WebDriver.GeckoDriver" Version="0.31.0"/>
</ItemGroup>
<ItemGroup>
<Folder Include="Pages\" />
<Folder Include="Pages\"/>
</ItemGroup>
</Project>
+1 -6
View File
@@ -5,7 +5,6 @@ namespace TestAutomation;
[TestFixture]
public class TestHarassCalculator : BaseTest
{
[SetUp]
public void SetUp()
{
@@ -17,12 +16,10 @@ public class TestHarassCalculator : BaseTest
{
TestReport.ThrowErrors();
}
[Test]
public void CalculatorInput()
{
var expectedTotalAlloyHarassment = 240;
Website.HarassCalculatorPage
@@ -41,8 +38,6 @@ public class TestHarassCalculator : BaseTest
[Test]
public void CalculatedExampleInformation()
{
var expectedExampleTotalAlloyLoss = 720;
var expectedExampleWorkerCost = 300;
var expectedExampleMiningTimeCost = 420;
+1 -2
View File
@@ -3,7 +3,6 @@ namespace TestAutomation;
[TestFixture]
public class TestLinks : BaseTest
{
[SetUp]
public void SetUp()
{
@@ -15,7 +14,7 @@ public class TestLinks : BaseTest
{
TestReport.ThrowErrors();
}
[Test]
public void VerifyPageLinks()
{
-16
View File
@@ -1,4 +1,3 @@
using Discord;
using TestAutomation.Utils;
namespace TestAutomation;
@@ -6,7 +5,6 @@ namespace TestAutomation;
[TestFixture]
public class TestSearchFeatures : BaseTest
{
[SetUp]
public void SetUp()
{
@@ -33,7 +31,6 @@ public class TestSearchFeatures : BaseTest
[Test]
public void DesktopSearchForThrone()
{
Website
.Goto()
.NavigationBar.ClickSearchButton()
@@ -46,14 +43,11 @@ public class TestSearchFeatures : BaseTest
new TestMessage { Description = "Couldn't find Throne via search." });
TestReport.CheckPassed(!health.Trim().Equals(""),
new TestMessage { Description = "Throne has no visible health!" });
}
[Test]
public void DesktopFilterForThrone()
{
Website.DatabasePage
.Goto()
.FilterName("Throne")
@@ -61,30 +55,22 @@ public class TestSearchFeatures : BaseTest
TestReport.CheckPassed(name.Equals("Throne"),
new TestMessage { Description = "Couldn't find Throne via filter." });
}
[Test]
public void SeeThroneByDefault()
{
Website.DatabasePage
.Goto()
.GetEntityName("army", "throne", out var name);
TestReport.CheckPassed(name.Equals("Throne"),
new TestMessage { Description = "Couldn't find Throne on the page by default." });
}
[Test]
public void DirectLinkNotThroneFailure()
{
Website.DatabaseSinglePage
.Goto("not throne")
.GetInvalidSearch(out var invalidSearch)
@@ -94,7 +80,5 @@ public class TestSearchFeatures : BaseTest
new TestMessage { Description = "Couldn't find invalid search text on the page." });
TestReport.CheckPassed(validSearch.Equals("Throne"),
new TestMessage { Description = "Couldn't find valid search text on the page." });
}
}
+5 -7
View File
@@ -1,5 +1,4 @@
using System.Diagnostics;
using System.Globalization;
using System.Globalization;
using System.Runtime.CompilerServices;
namespace TestAutomation.Utils;
@@ -22,12 +21,11 @@ public class TestReport
{
if (!Tests.Last().Result)
{
string messages = string.Join("\n", Tests.Last().Messages.Select(x => x.Description).ToList());
var messages = string.Join("\n", Tests.Last().Messages.Select(x => x.Description).ToList());
throw new Exception(
$"{Tests.Last().Name} test failed with {Tests.Last().Messages.Count} messages.\n\n{messages}");
}
}
public async Task VerifyLinks(BasePage page)
@@ -35,8 +33,8 @@ public class TestReport
foreach (var link in page.GetLinks())
try
{
if(link.StartsWith("mailto")) continue;
if (link.StartsWith("mailto")) continue;
using var client = new HttpClient();
var response = await client.GetAsync(link);
+5 -5
View File
@@ -8,7 +8,7 @@ namespace TestAutomation.Utils;
public class Website
{
public static readonly DeploymentType DeploymentType =
Environment.GetEnvironmentVariable("TEST_HOOK")!.Contains("localhost")
Environment.GetEnvironmentVariable("TEST_HOOK")!.Contains("localhost")
? DeploymentType.Local
: DeploymentType.Dev;
@@ -19,8 +19,6 @@ public class Website
public readonly ScreenType ScreenType = ScreenType.Desktop;
public TestReport TestReport { get; set; }
public Website(IWebDriver webDriver, TestReport testReport)
{
WebDriver = webDriver;
@@ -38,6 +36,8 @@ public class Website
WebsiteSearchDialog = new WebsiteSearchDialog(this);
}
public TestReport TestReport { get; set; }
public IWebDriver WebDriver { get; }
public HarassCalculatorPage HarassCalculatorPage { get; }
@@ -117,7 +117,7 @@ public class Website
{
return WebDriver.FindElements(By.TagName(tag));
}
public ReadOnlyCollection<IWebElement> FindAllWithTag(IWebElement parent, string tag)
{
return parent.FindElements(By.TagName(tag));
@@ -210,7 +210,7 @@ public class Website
public void Goto(string path)
{
var url = $"{Url}/{path}";
WebDriver.Navigate().GoToUrl($"{url}");
}
}