Skip to content

Commit

Permalink
Disabling unit test in batch mode
Browse files Browse the repository at this point in the history
  • Loading branch information
AMollis committed Jul 10, 2023
1 parent f7bf772 commit d4ed81c
Showing 1 changed file with 16 additions and 5 deletions.
21 changes: 16 additions & 5 deletions com.microsoft.mrtk.core/Tests/Editor/MRTK3ProfileEditorTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using NUnit.Framework;
using System.Collections;
using UnityEditor;
using UnityEngine;
using UnityEngine.TestTools;
using UnityEngine.UIElements;

Expand All @@ -14,16 +15,26 @@ internal class MRTK3ProfileEditorTest
/// <summary>
/// Verify that the <see cref="MRTK3ProfileEditor"/> window can be opened.
/// </summary>
/// <remarks>
/// This test is disabled when executing in batch mode, since it requires a Unity graphic device.
/// </remarks>
[UnityTest]
public IEnumerator InspectorWindowSmokeTest()
{
var window = SettingsService.OpenProjectSettings("Project/MRTK3");
Assert.IsNotNull(window, "The MRTK Profile editor window should have been opened");
if (Application.isBatchMode)
{
yield return null;
}
else
{
var window = SettingsService.OpenProjectSettings("Project/MRTK3");
Assert.IsNotNull(window, "The MRTK Profile editor window should have been opened");

var panel = window.rootVisualElement.Query<IMGUIContainer>(className: "settings-panel-imgui-container").First();
Assert.IsNotNull(panel, "There should have hand a settings panel created for the MRTK Profile.");
var panel = window.rootVisualElement.Query<IMGUIContainer>(className: "settings-panel-imgui-container").First();
Assert.IsNotNull(panel, "There should have hand a settings panel created for the MRTK Profile.");

yield return null;
yield return null;
}
}
}
}

0 comments on commit d4ed81c

Please sign in to comment.