From fe3d14cbb59b4592818c5181744239aba8d3fdbf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alaksiej=20Miale=C5=A1ka?= Date: Fri, 2 Aug 2024 16:23:48 +0200 Subject: [PATCH] Update to Appium 5.1.0, Selenium 4.23.0 (#58) +semver:feature * Update to Appium 5.1.0, Selenium 4.23.0 +semver:feature use .NET 8 / 4.8 instead of .NET standard * Update downloads tab name in tests after recent Chrome update * Stabilize Chrome tests, add retry to pipeline and update SonarQube task configurations --- .../Aquality.WinAppDriver/Actions/MouseActions.cs | 4 ++-- .../Aquality.WinAppDriver.csproj | 6 +++--- .../Aquality.WinAppDriver.Tests.csproj | 2 +- .../Forms/Chrome/ChromeNavigationPanel.cs | 6 ++++-- .../Forms/Chrome/MultipleWindowsTest.cs | 2 +- azure-pipelines.yml | 14 ++++++++++---- 6 files changed, 21 insertions(+), 13 deletions(-) diff --git a/Aquality.WinAppDriver/src/Aquality.WinAppDriver/Actions/MouseActions.cs b/Aquality.WinAppDriver/src/Aquality.WinAppDriver/Actions/MouseActions.cs index 2e79584..926798a 100644 --- a/Aquality.WinAppDriver/src/Aquality.WinAppDriver/Actions/MouseActions.cs +++ b/Aquality.WinAppDriver/src/Aquality.WinAppDriver/Actions/MouseActions.cs @@ -90,7 +90,7 @@ public void Click(int? x = null, int? y = null, MouseButton? button = null, ILis { parameters.Add("interClickDelayMs", interClickDelay?.TotalMilliseconds); } - Point cursor; + Point cursor = default; if (x == null || y == null) { cursor = Coordinates; @@ -142,7 +142,7 @@ public void Hover(int startX, int startY, int? endX = null, int? endY = null, IL public void Scroll(int delta, int? x = null, int? y = null, ScrollDirection direction = ScrollDirection.Vertical, IList modifierKeys = null) { var parameters = ResolveParameters(modifierKeys); - Point cursor; + Point cursor = default; if (x == null || y == null) { cursor = Coordinates; diff --git a/Aquality.WinAppDriver/src/Aquality.WinAppDriver/Aquality.WinAppDriver.csproj b/Aquality.WinAppDriver/src/Aquality.WinAppDriver/Aquality.WinAppDriver.csproj index 3d247ca..55f754f 100644 --- a/Aquality.WinAppDriver/src/Aquality.WinAppDriver/Aquality.WinAppDriver.csproj +++ b/Aquality.WinAppDriver/src/Aquality.WinAppDriver/Aquality.WinAppDriver.csproj @@ -1,7 +1,7 @@  - netstandard2.0 + net48;net8.0 false true @@ -45,8 +45,8 @@ - - + + diff --git a/Aquality.WinAppDriver/tests/Aquality.WinAppDriver.Tests/Aquality.WinAppDriver.Tests.csproj b/Aquality.WinAppDriver/tests/Aquality.WinAppDriver.Tests/Aquality.WinAppDriver.Tests.csproj index 0e9e0b6..6eb17c1 100644 --- a/Aquality.WinAppDriver/tests/Aquality.WinAppDriver.Tests/Aquality.WinAppDriver.Tests.csproj +++ b/Aquality.WinAppDriver/tests/Aquality.WinAppDriver.Tests/Aquality.WinAppDriver.Tests.csproj @@ -12,7 +12,7 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - + diff --git a/Aquality.WinAppDriver/tests/Aquality.WinAppDriver.Tests/Forms/Chrome/ChromeNavigationPanel.cs b/Aquality.WinAppDriver/tests/Aquality.WinAppDriver.Tests/Forms/Chrome/ChromeNavigationPanel.cs index e10589e..24d03d1 100644 --- a/Aquality.WinAppDriver/tests/Aquality.WinAppDriver.Tests/Forms/Chrome/ChromeNavigationPanel.cs +++ b/Aquality.WinAppDriver/tests/Aquality.WinAppDriver.Tests/Forms/Chrome/ChromeNavigationPanel.cs @@ -1,4 +1,6 @@ -using Aquality.WinAppDriver.Actions; +using Aquality.Selenium.Core.Configurations; +using Aquality.WinAppDriver.Actions; +using Aquality.WinAppDriver.Applications; using Aquality.WinAppDriver.Elements.Interfaces; using Aquality.WinAppDriver.Forms; using OpenQA.Selenium; @@ -32,7 +34,7 @@ public void DontSignIn() public void ClosePopUps() { State.WaitForExist(); - if (NoThanksButton.State.IsExist) + if (!NoThanksButton.State.WaitForNotDisplayed()) { NoThanksButton.Click(); NoThanksButton.State.WaitForNotDisplayed(); diff --git a/Aquality.WinAppDriver/tests/Aquality.WinAppDriver.Tests/Forms/Chrome/MultipleWindowsTest.cs b/Aquality.WinAppDriver/tests/Aquality.WinAppDriver.Tests/Forms/Chrome/MultipleWindowsTest.cs index 7043fd2..247da70 100644 --- a/Aquality.WinAppDriver/tests/Aquality.WinAppDriver.Tests/Forms/Chrome/MultipleWindowsTest.cs +++ b/Aquality.WinAppDriver/tests/Aquality.WinAppDriver.Tests/Forms/Chrome/MultipleWindowsTest.cs @@ -16,7 +16,7 @@ public class MultipleWindowsTest : TestWithCustomApplication : Path.Combine(ProgramFiles, AppPathRelativeFromProgramFiles); private static string NewTabName => $"New Tab{TabNamePostfix}"; - private static string DownloadsTabName => $"Downloads{TabNamePostfix}"; + private static string DownloadsTabName => $"Download history{TabNamePostfix}"; private const string TabNamePostfix = " - Google Chrome"; diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 12e8865..3265e7b 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -15,11 +15,12 @@ stages: displayName: Analyse code with SonarQube steps: - - task: SonarCloudPrepare@1 + - task: SonarCloudPrepare@2 displayName: 'Prepare SonarCloud analysis' inputs: SonarCloud: 'SonarCloud' organization: 'aqualityautomation' + scannerMode: 'MSBuild' projectKey: 'aquality-automation_aquality-winappdriver-dotnet' projectName: 'aquality-winappdriver-dotnet' projectVersion: '$(Build.BuildNumber)' @@ -33,12 +34,16 @@ stages: projects: Aquality.WinAppDriver/Aquality.WinAppDriver.sln arguments: -c $(buildConfiguration) - - task: SonarCloudAnalyze@1 + - task: SonarCloudAnalyze@2 displayName: 'Run SonarCloud code analysis' continueOnError: true + inputs: + jdkversion: 'JAVA_HOME_17_X64' - - task: SonarCloudPublish@1 + - task: SonarCloudPublish@2 displayName: 'Publish SonarCloud quality gate results' + inputs: + pollingTimeoutSec: '300' - job: tests displayName: Run tests @@ -96,6 +101,7 @@ stages: - task: DotNetCoreCLI@2 displayName: 'Run tests' + retryCountOnTaskFailure: 1 inputs: command: 'test' projects: '**/*Tests*/*.csproj' @@ -139,4 +145,4 @@ stages: command: 'push' packagesToPush: '$(Build.ArtifactStagingDirectory)/**/Aquality.WinAppDriver*.nupkg;!$(Build.ArtifactStagingDirectory)/**/Aquality.WinAppDriver*.symbols.nupkg' nuGetFeedType: 'external' - publishFeedCredentials: 'NuGet' \ No newline at end of file + publishFeedCredentials: 'NuGet'