Skip to content

Commit 2847889

Browse files
authored
Update WebDriverManager reference to enable "MatchingBrowser" webDriverVersion strategy (#194)
* Update WebDriverManager reference to enable "MatchingBrowser" webDriverVersion strategy * Stabilize JS Focus test, replace obsolete property with State reference in tests * Fix ParallelScope in LocalizationManagerTests
1 parent efcffff commit 2847889

File tree

13 files changed

+19
-15
lines changed

13 files changed

+19
-15
lines changed

Aquality.Selenium/src/Aquality.Selenium/Aquality.Selenium.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,9 @@
6868
</ItemGroup>
6969

7070
<ItemGroup>
71-
<PackageReference Include="Microsoft.Edge.SeleniumTools" Version="3.141.1" />
71+
<PackageReference Include="Microsoft.Edge.SeleniumTools" Version="3.141.2" />
7272
<PackageReference Include="Aquality.Selenium.Core" Version="1.2.2" />
73-
<PackageReference Include="WebDriverManager" Version="2.9.1" />
73+
<PackageReference Include="WebDriverManager" Version="2.11.0" />
7474
</ItemGroup>
7575

7676
</Project>

Aquality.Selenium/src/Aquality.Selenium/Browsers/LocalBrowserFactory.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,8 @@ private RemoteWebDriver GetDriver<T>(DriverService driverService, DriverOptions
8787
private static void SetUpDriver(IDriverConfig driverConfig, IDriverSettings driverSettings)
8888
{
8989
var architecture = driverSettings.SystemArchitecture.Equals(Architecture.Auto) ? ArchitectureHelper.GetArchitecture() : driverSettings.SystemArchitecture;
90-
var version = driverSettings.WebDriverVersion.Equals("Latest") ? driverConfig.GetLatestVersion() : driverSettings.WebDriverVersion;
90+
var version = driverSettings.WebDriverVersion.Equals(VersionResolveStrategy.Latest) ? driverConfig.GetLatestVersion() : driverSettings.WebDriverVersion;
91+
version = version.Equals(VersionResolveStrategy.MatchingBrowser) ? driverConfig.GetMatchingBrowserVersion() : version;
9192
var url = UrlHelper.BuildUrl(architecture.Equals(Architecture.X32) ? driverConfig.GetUrl32() : driverConfig.GetUrl64(), version);
9293
var binaryPath = FileHelper.GetBinDestination(driverConfig.GetName(), version, architecture, driverConfig.GetBinaryName());
9394
if (!File.Exists(binaryPath) || !Environment.GetEnvironmentVariable("PATH").Contains(binaryPath))

Aquality.Selenium/src/Aquality.Selenium/Resources/settings.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
"driverSettings": {
88
"chrome": {
9-
"webDriverVersion": "Latest",
9+
"webDriverVersion": "MatchingBrowser",
1010
"capabilities": {
1111
"enableVNC": true,
1212
"loggingPrefs": {

Aquality.Selenium/tests/Aquality.Selenium.Tests/Aquality.Selenium.Tests.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,11 @@
2626

2727
<ItemGroup>
2828
<PackageReference Include="nunit" Version="3.12.0" />
29-
<PackageReference Include="NUnit3TestAdapter" Version="3.16.1">
29+
<PackageReference Include="NUnit3TestAdapter" Version="3.17.0">
3030
<PrivateAssets>all</PrivateAssets>
3131
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
3232
</PackageReference>
33-
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.6.1" />
33+
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.7.1" />
3434
</ItemGroup>
3535

3636
<ItemGroup>

Aquality.Selenium/tests/Aquality.Selenium.Tests/Integration/Actions/JsActionsTests.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ public void Should_BePossibleTo_Click()
2121
var welcomeForm = new WelcomeForm();
2222
welcomeForm.Open();
2323
welcomeForm.GetExampleLink(AvailableExample.Dropdown).JsActions.Click();
24-
Assert.IsTrue(new DropdownForm().IsDisplayed, "Dropdown form should be displayed");
24+
Assert.IsTrue(new DropdownForm().State.WaitForDisplayed(), "Dropdown form should be displayed");
2525
}
2626

2727
[Test]
@@ -30,7 +30,7 @@ public void Should_BePossibleTo_ClickAndWait()
3030
var welcomeForm = new WelcomeForm();
3131
welcomeForm.Open();
3232
welcomeForm.GetExampleLink(AvailableExample.Dropdown).JsActions.ClickAndWait();
33-
Assert.IsTrue(new DropdownForm().IsDisplayed, "Dropdown form should be displayed");
33+
Assert.IsTrue(new DropdownForm().State.WaitForDisplayed(), "Dropdown form should be displayed");
3434
}
3535

3636
[Test]
@@ -69,6 +69,7 @@ public void Should_BePossibleTo_SetFocus()
6969
var expectedText = currentText.Remove(currentText.Length - 1);
7070
product.TxtQuantity.JsActions.SetFocus();
7171
product.TxtQuantity.SendKeys(Keys.Delete);
72+
product.TxtQuantity.SendKeys(Keys.Backspace);
7273
Assert.AreEqual(expectedText, product.TxtQuantity.Value, $"One character should be removed from '{currentText}'");
7374
}
7475

Aquality.Selenium/tests/Aquality.Selenium.Tests/Integration/Actions/MouseActionsTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ public void Should_BePossibleTo_Click()
1414
var welcomeForm = new WelcomeForm();
1515
welcomeForm.Open();
1616
welcomeForm.GetExampleLink(AvailableExample.Dropdown).MouseActions.Click();
17-
Assert.IsTrue(new DropdownForm().IsDisplayed, "Dropdown form should be displayed");
17+
Assert.IsTrue(new DropdownForm().State.WaitForDisplayed(), "Dropdown form should be displayed");
1818
}
1919

2020
[Test]

Aquality.Selenium/tests/Aquality.Selenium.Tests/Integration/ElementStateTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ public void Should_BePossibleTo_CheckElementIsClickableState()
5555
[Test]
5656
public void Should_BePossibleTo_WaitForElementEnabledState()
5757
{
58-
Assert.IsTrue(dynamicControlsForm.IsDisplayed, "Form 'Dynamic Controls' should be displayed");
58+
Assert.IsTrue(dynamicControlsForm.State.WaitForDisplayed(), "Form 'Dynamic Controls' should be displayed");
5959
dynamicControlsForm.ChangeInputStateButton.Click();
6060
Assert.IsTrue(dynamicControlsForm.TextInputTextBox.State.WaitForEnabled(), "Text input should be enable after changing state");
6161
dynamicControlsForm.ChangeInputStateButton.Click();

Aquality.Selenium/tests/Aquality.Selenium.Tests/Integration/TestApp/AutomationPractice/Forms/ProductListForm.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ public ProductListForm() : base(By.XPath(FormLocator), "Product list")
2727
public void NavigateToLastProduct()
2828
{
2929
AqualityServices.Browser.GoTo(GetLastProduct().Href);
30+
AqualityServices.Browser.WaitForPageToLoad();
3031
}
3132

3233
public ILink GetLastProduct()

Aquality.Selenium/tests/Aquality.Selenium.Tests/Integration/Usecases/CustomBrowserFactoryTests.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ private static void SetUpDriver(IDriverConfig driverConfig, IDriverSettings driv
6868
{
6969
var architecture = driverSettings.SystemArchitecture.Equals(Architecture.Auto) ? ArchitectureHelper.GetArchitecture() : driverSettings.SystemArchitecture;
7070
var version = driverSettings.WebDriverVersion.Equals("Latest") ? driverConfig.GetLatestVersion() : driverSettings.WebDriverVersion;
71+
version = version.Equals(VersionResolveStrategy.MatchingBrowser) ? driverConfig.GetMatchingBrowserVersion() : version;
7172
var url = UrlHelper.BuildUrl(architecture.Equals(Architecture.X32) ? driverConfig.GetUrl32() : driverConfig.GetUrl64(), version);
7273
var binaryPath = FileHelper.GetBinDestination(driverConfig.GetName(), version, architecture, driverConfig.GetBinaryName());
7374
if (!File.Exists(binaryPath) || !Environment.GetEnvironmentVariable("PATH").Contains(binaryPath))

Aquality.Selenium/tests/Aquality.Selenium.Tests/Integration/Usecases/ShoppingCartTests.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public void BeforeTest()
3030
public void Should_BePossibleTo_PerformActions()
3131
{
3232
var sliderForm = new SliderForm();
33-
Assert.IsTrue(sliderForm.IsDisplayed, "Slider Form is not opened");
33+
Assert.IsTrue(sliderForm.State.WaitForDisplayed(), "Slider Form is not opened");
3434

3535
sliderForm.ClickNextButton();
3636
sliderForm.ClickNextButton();
@@ -47,7 +47,7 @@ public void Should_BePossibleTo_PerformActions()
4747

4848
shoppingCardSummaryForm.ClickProceedToCheckoutButton();
4949
var authForm = new AuthenticationForm();
50-
Assert.IsTrue(authForm.IsDisplayed, "Authentication Form is not opened");
50+
Assert.IsTrue(authForm.State.WaitForDisplayed(), "Authentication Form is not opened");
5151

5252
var cartMenuForm = new CartMenuForm();
5353
cartMenuForm.OpenCartMenu();

0 commit comments

Comments
 (0)