Skip to content

Commit

Permalink
test: Adjust RunRuntimeTests objects lookup
Browse files Browse the repository at this point in the history
  • Loading branch information
jeromelaban committed Mar 30, 2020
1 parent 1c44d53 commit d48e297
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions src/SamplesApp/SamplesApp.UITests/RuntimeTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,10 @@
using System.Threading.Tasks;
using NUnit.Framework;
using SamplesApp.UITests.TestFramework;
using Uno.UITest;
using Uno.UITest.Helpers;
using Uno.UITest.Helpers.Queries;
using Uno.UITests.Helpers;

namespace SamplesApp.UITests
{
Expand All @@ -22,11 +24,15 @@ public async Task RunRuntimeTests()
{
Run("SamplesApp.Samples.UnitTests.UnitTestsPage");

var runButton = _app.Marked("runButton");
var failedTestsCount = _app.Marked("failedTestCount");
var failedTests = _app.Marked("failedTests");
var runningState = _app.Marked("runningState");
var runTestCount = _app.Marked("runTestCount");
IAppQuery AllQuery(IAppQuery query)
// .All() is not yet supported for wasm.
=> AppInitializer.GetLocalPlatform() == Platform.Browser ? query : query.All();

var runButton = new QueryEx(q => AllQuery(q).Marked("runButton"));
var failedTestsCount = new QueryEx(q => AllQuery(q).Marked("failedTestCount"));
var failedTests = new QueryEx(q => AllQuery(q).Marked("failedTests"));
var runningState = new QueryEx(q => AllQuery(q).Marked("runningState"));
var runTestCount = new QueryEx(q => AllQuery(q).Marked("runTestCount"));

bool IsTestExecutionDone()
=> runningState.GetDependencyPropertyValue<string>("Text").Equals("Finished", StringComparison.OrdinalIgnoreCase);
Expand Down

0 comments on commit d48e297

Please sign in to comment.