fix(TestAutomation) Fixed missing driver
This commit is contained in:
@@ -9,12 +9,14 @@
|
|||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="DotNetSeleniumExtras.PageObjects" Version="3.11.0" />
|
|
||||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.0.0" />
|
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.0.0" />
|
||||||
<PackageReference Include="NUnit" Version="3.13.2" />
|
<PackageReference Include="NUnit" Version="3.13.2" />
|
||||||
<PackageReference Include="NUnit3TestAdapter" Version="4.2.0" />
|
<PackageReference Include="NUnit3TestAdapter" Version="4.2.0" />
|
||||||
<PackageReference Include="NUnit.Analyzers" Version="3.2.0" />
|
<PackageReference Include="NUnit.Analyzers" Version="3.2.0" />
|
||||||
<PackageReference Include="coverlet.collector" Version="3.1.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>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
|||||||
@@ -5,11 +5,9 @@ public class Tests
|
|||||||
{
|
{
|
||||||
private IWebDriver _webDriver = default!;
|
private IWebDriver _webDriver = default!;
|
||||||
|
|
||||||
|
|
||||||
private readonly string localhost = "https://localhost:7234";
|
private readonly string localhost = "https://localhost:7234";
|
||||||
private readonly string develop = "https://calm-mud-04916b210.1.azurestaticapps.net/";
|
private readonly string develop = "https://calm-mud-04916b210.1.azurestaticapps.net/";
|
||||||
|
|
||||||
|
|
||||||
private Website Website { get; }
|
private Website Website { get; }
|
||||||
|
|
||||||
public Tests() {
|
public Tests() {
|
||||||
@@ -17,15 +15,13 @@ public class Tests
|
|||||||
var options = new ChromeOptions();
|
var options = new ChromeOptions();
|
||||||
|
|
||||||
options.AcceptInsecureCertificates = true;
|
options.AcceptInsecureCertificates = true;
|
||||||
|
options.AddArgument("--headless");
|
||||||
#if !DEBUG
|
|
||||||
options.AddArgument("--headless");
|
|
||||||
#endif
|
|
||||||
|
|
||||||
options.AddArgument("--start-maximized");
|
options.AddArgument("--start-maximized");
|
||||||
|
|
||||||
//_webDriver = new FirefoxDriver(options);
|
//_webDriver = new FirefoxDriver(options);
|
||||||
_webDriver = new ChromeDriver(options);
|
_webDriver = new ChromeDriver(Environment.CurrentDirectory, options);
|
||||||
|
//_webDriver = new FirefoxDriver(Environment.CurrentDirectory, options);
|
||||||
|
|
||||||
|
|
||||||
Website = new Website(_webDriver);
|
Website = new Website(_webDriver);
|
||||||
}
|
}
|
||||||
@@ -33,7 +29,7 @@ public class Tests
|
|||||||
[OneTimeSetUp]
|
[OneTimeSetUp]
|
||||||
public void Setup()
|
public void Setup()
|
||||||
{
|
{
|
||||||
_webDriver.Navigate().GoToUrl(localhost);
|
_webDriver.Navigate().GoToUrl(develop);
|
||||||
_webDriver.Manage().Timeouts().ImplicitWait = TimeSpan.FromSeconds(15);
|
_webDriver.Manage().Timeouts().ImplicitWait = TimeSpan.FromSeconds(15);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -46,7 +42,7 @@ public class Tests
|
|||||||
[Test]
|
[Test]
|
||||||
public void HarassCalculator()
|
public void HarassCalculator()
|
||||||
{
|
{
|
||||||
_webDriver.Navigate().GoToUrl(localhost + "/harass-calculator");
|
_webDriver.Navigate().GoToUrl(develop + "/harass-calculator");
|
||||||
|
|
||||||
int expectedTotalAlloyHarassment = 240;
|
int expectedTotalAlloyHarassment = 240;
|
||||||
|
|
||||||
@@ -66,7 +62,7 @@ public class Tests
|
|||||||
[Test]
|
[Test]
|
||||||
public void HarassCalculatorInformation()
|
public void HarassCalculatorInformation()
|
||||||
{
|
{
|
||||||
_webDriver.Navigate().GoToUrl(localhost + "/harass-calculator");
|
_webDriver.Navigate().GoToUrl(develop + "/harass-calculator");
|
||||||
|
|
||||||
int expectedExampleTotalAlloyLoss = 720;
|
int expectedExampleTotalAlloyLoss = 720;
|
||||||
int expectedExampleWorkerCost = 300;
|
int expectedExampleWorkerCost = 300;
|
||||||
|
|||||||
Reference in New Issue
Block a user