Skip to content

Commit f7620c3

Browse files
committed
Use async Task for TestInitalize
1 parent 31de2aa commit f7620c3

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

UITests/UITests.Tests.Shared/UITestBase.cs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
using System.Reflection;
99
using Windows.UI.Xaml.Tests.MUXControls.InteractionTests.Common;
1010
using Windows.UI.Xaml.Tests.MUXControls.InteractionTests.Infra;
11+
using System.Threading.Tasks;
1112

1213
#if USING_TAEF
1314
using WEX.Logging.Interop;
@@ -75,7 +76,7 @@ private static TestSetupHelper.TestSetupHelperOptions TestSetupHelperOptions
7576
public TestContext TestContext { get; set; }
7677

7778
[TestInitialize]
78-
public void TestInitialize()
79+
public async Task TestInitialize()
7980
{
8081
// This will reset the test for each run (as from original WinUI https://github.com/microsoft/microsoft-ui-xaml/blob/master/test/testinfra/MUXTestInfra/Infra/TestHelpers.cs)
8182
// We construct it so it doesn't try to run any tests since we use the AppService Bridge to complete
@@ -84,10 +85,9 @@ public void TestInitialize()
8485

8586
var pageName = GetPageForTest(TestContext);
8687

87-
var rez = TestAssembly.OpenPage(pageName);
88-
rez.Wait();
88+
var rez = await TestAssembly.OpenPage(pageName);
8989

90-
if (!rez.Result)
90+
if (!rez)
9191
{
9292
// Error case, we didn't get confirmation of test starting.
9393
throw new InvalidOperationException("Test host didn't confirm test ready to execute page: " + pageName);
@@ -96,7 +96,6 @@ public void TestInitialize()
9696
Log.Comment("[Harness] Received Host Ready with Page: {0}", pageName);
9797
Wait.ForIdle();
9898
Log.Comment("[Harness] Starting Test for {0}...", pageName);
99-
return;
10099
}
101100

102101
[TestCleanup]

0 commit comments

Comments
 (0)