Add Unity playmode bootstrap smoke test
CI / test (push) Successful in 1m28s Details

This commit is contained in:
MpakobecEx 2026-10-21 16:41:44 +05:00
parent 33d62a34e2
commit d9a090dfde
6 changed files with 84 additions and 0 deletions

1
.gitignore vendored
View File

@ -44,6 +44,7 @@ client/.idea/
client/Assets/AddressableAssetsData/*.bin
client/Assets/StreamingAssets/aa/*
client/*.log
client/TestResults*.xml
# --- Unity прочее ---
*.unitypackage

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: e6bec1f0a4db28b4ea6abf6bff71cb76
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,47 @@
using System.Collections;
using NUnit.Framework;
using UnityEngine;
using UnityEngine.EventSystems;
using UnityEngine.TestTools;
using Vanguard.App;
namespace Vanguard.Tests
{
public sealed class AppBootstrapPlayModeTests
{
[UnityTest]
public IEnumerator App_Bootstraps_And_Shows_Login()
{
if (Object.FindAnyObjectByType<VanguardApp>() == null)
{
var go = new GameObject("Test App");
go.AddComponent<VanguardApp>();
}
yield return null;
yield return null;
Assert.IsNotNull(Object.FindAnyObjectByType<VanguardApp>());
Assert.IsNotNull(GameObject.Find("Vanguard Canvas"));
Assert.IsNotNull(GameObject.Find("LoginScreen"));
Cleanup();
yield return null;
}
private static void Cleanup()
{
var app = Object.FindAnyObjectByType<VanguardApp>();
if (app != null)
Object.Destroy(app.gameObject);
var canvas = GameObject.Find("Vanguard Canvas");
if (canvas != null)
Object.Destroy(canvas);
var eventSystem = Object.FindAnyObjectByType<EventSystem>();
if (eventSystem != null)
Object.Destroy(eventSystem.gameObject);
}
}
}

View File

@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: b8e1375853da4264f80f4fd944176ac4

View File

@ -0,0 +1,19 @@
{
"name": "Vanguard.Tests.PlayMode",
"rootNamespace": "Vanguard.Tests",
"references": [
"Vanguard.Runtime"
],
"includePlatforms": [],
"excludePlatforms": [],
"allowUnsafeCode": false,
"overrideReferences": false,
"precompiledReferences": [],
"autoReferenced": false,
"defineConstraints": [],
"versionDefines": [],
"noEngineReferences": false,
"optionalUnityReferences": [
"TestAssemblies"
]
}

View File

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 199ad6dea713aef4cb50a4d8d01c9ca4
AssemblyDefinitionImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant: