From 241c9c99e85964067f05aa09db0e7f818d97d13c Mon Sep 17 00:00:00 2001 From: eriklimakc Date: Fri, 20 Sep 2024 15:32:54 +0100 Subject: [PATCH] chore: Use fast tap to make tests run faster --- build/ci/stage-build-uitests-android.yml | 6 +++--- build/ci/stage-build-uitests-ios.yml | 6 +++--- .../TestHarness/TestHarness.UITest/AppExtensions.cs | 13 +++++++------ .../TestHarness.UITest/Extensions/AppExtensions.cs | 2 +- 4 files changed, 14 insertions(+), 13 deletions(-) diff --git a/build/ci/stage-build-uitests-android.yml b/build/ci/stage-build-uitests-android.yml index d45e6aad4..e62189e1a 100644 --- a/build/ci/stage-build-uitests-android.yml +++ b/build/ci/stage-build-uitests-android.yml @@ -26,7 +26,7 @@ jobs: - task: PublishTestResults@2 condition: always() - retryCountOnTaskFailure: 3 + retryCountOnTaskFailure: 2 inputs: testRunTitle: 'Android Test Run' testResultsFormat: 'NUnit' @@ -34,9 +34,9 @@ jobs: failTaskOnFailedTests: true failTaskOnMissingResultsFile: true - - task: PublishBuildArtifacts@1 + - task: PublishBuildArtifacts@1/ condition: always() - retryCountOnTaskFailure: 3 + retryCountOnTaskFailure: 2 inputs: PathtoPublish: $(build.artifactstagingdirectory) ArtifactName: uno-uitest-tests diff --git a/build/ci/stage-build-uitests-ios.yml b/build/ci/stage-build-uitests-ios.yml index d2b3da283..1109f6557 100644 --- a/build/ci/stage-build-uitests-ios.yml +++ b/build/ci/stage-build-uitests-ios.yml @@ -31,7 +31,7 @@ jobs: - task: PublishTestResults@2 condition: always() - retryCountOnTaskFailure: 3 + retryCountOnTaskFailure: 2 inputs: testRunTitle: 'iOS Test Run' testResultsFormat: 'NUnit' @@ -41,7 +41,7 @@ jobs: - task: PublishBuildArtifacts@1 condition: always() - retryCountOnTaskFailure: 3 + retryCountOnTaskFailure: 2 inputs: PathtoPublish: $(build.artifactstagingdirectory) ArtifactName: uno-uitest-tests @@ -49,7 +49,7 @@ jobs: - task: PublishBuildArtifacts@1 condition: always() - retryCountOnTaskFailure: 3 + retryCountOnTaskFailure: 2 inputs: PathtoPublish: $(build.sourcesdirectory)/testing/TestHarness/TestHarness/bin/Release/net8.0-ios/iossimulator-x64/TestHarnessApp.app ArtifactName: uno-uitest-ios-bin diff --git a/testing/TestHarness/TestHarness.UITest/AppExtensions.cs b/testing/TestHarness/TestHarness.UITest/AppExtensions.cs index 93701d39d..cd9bece7d 100644 --- a/testing/TestHarness/TestHarness.UITest/AppExtensions.cs +++ b/testing/TestHarness/TestHarness.UITest/AppExtensions.cs @@ -1,28 +1,29 @@ namespace TestHarness.UITest; +// TODO: Remove commented code if it works in CI public static class AppExtensions { public const int UIWaitTimeInMilliseconds = 1000; public static async Task TapAndWait(this IApp app, string elementToTap, string elementToWaitFor ) { app.WaitElement(elementToTap); - await Task.Delay(UIWaitTimeInMilliseconds); + //await Task.Delay(UIWaitTimeInMilliseconds); - app.Tap(elementToTap); + app.FastTap(elementToTap); app.WaitElement(elementToWaitFor); - await Task.Delay(UIWaitTimeInMilliseconds); + //await Task.Delay(UIWaitTimeInMilliseconds); } public static async Task SelectElementIndexAndWait(this IApp app, string listName, string indexToSelect, string elementToWaitFor) { app.WaitElement(listName); - await Task.Delay(UIWaitTimeInMilliseconds); + //await Task.Delay(UIWaitTimeInMilliseconds); var list = new QueryEx(q => q.All().Marked(listName)); list.SetDependencyPropertyValue("SelectedIndex", indexToSelect); - await Task.Delay(UIWaitTimeInMilliseconds); + //await Task.Delay(UIWaitTimeInMilliseconds); app.WaitElement(elementToWaitFor); - await Task.Delay(UIWaitTimeInMilliseconds); + //await Task.Delay(UIWaitTimeInMilliseconds); } } diff --git a/testing/TestHarness/TestHarness.UITest/Extensions/AppExtensions.cs b/testing/TestHarness/TestHarness.UITest/Extensions/AppExtensions.cs index b76a2e53d..f1de18288 100644 --- a/testing/TestHarness/TestHarness.UITest/Extensions/AppExtensions.cs +++ b/testing/TestHarness/TestHarness.UITest/Extensions/AppExtensions.cs @@ -34,7 +34,7 @@ public static Func WaitThenTap(this IApp app, Func