Skip to content

Commit

Permalink
chore: Use fast tap to make tests run faster
Browse files Browse the repository at this point in the history
  • Loading branch information
eriklimakc committed Sep 24, 2024
1 parent 4aabfad commit 241c9c9
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 13 deletions.
6 changes: 3 additions & 3 deletions build/ci/stage-build-uitests-android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,17 +26,17 @@ jobs:
- task: PublishTestResults@2
condition: always()
retryCountOnTaskFailure: 3
retryCountOnTaskFailure: 2
inputs:
testRunTitle: 'Android Test Run'
testResultsFormat: 'NUnit'
testResultsFiles: '$(build.sourcesdirectory)/build/TestResult.xml'
failTaskOnFailedTests: true
failTaskOnMissingResultsFile: true

- task: PublishBuildArtifacts@1
- task: PublishBuildArtifacts@1/
condition: always()
retryCountOnTaskFailure: 3
retryCountOnTaskFailure: 2
inputs:
PathtoPublish: $(build.artifactstagingdirectory)
ArtifactName: uno-uitest-tests
Expand Down
6 changes: 3 additions & 3 deletions build/ci/stage-build-uitests-ios.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
- task: PublishTestResults@2
condition: always()
retryCountOnTaskFailure: 3
retryCountOnTaskFailure: 2
inputs:
testRunTitle: 'iOS Test Run'
testResultsFormat: 'NUnit'
Expand All @@ -41,15 +41,15 @@ jobs:

- task: PublishBuildArtifacts@1
condition: always()
retryCountOnTaskFailure: 3
retryCountOnTaskFailure: 2
inputs:
PathtoPublish: $(build.artifactstagingdirectory)
ArtifactName: uno-uitest-tests
ArtifactType: Container

- 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
Expand Down
13 changes: 7 additions & 6 deletions testing/TestHarness/TestHarness.UITest/AppExtensions.cs
Original file line number Diff line number Diff line change
@@ -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);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public static Func<IAppQuery, IAppQuery> WaitThenTap(this IApp app, Func<IAppQue
{
app.WaitForElement(query, timeout: timeout);
Console.WriteLine("Tapping element");
app.Tap(query);
app.FastTap(query);

return query;
}
Expand Down

0 comments on commit 241c9c9

Please sign in to comment.