45 lines
2.0 KiB
C#
45 lines
2.0 KiB
C#
|
|
using System.Collections;
|
||
|
|
using System.IO;
|
||
|
|
using NUnit.Framework;
|
||
|
|
using TKS.OutGame;
|
||
|
|
using UnityEngine;
|
||
|
|
using UnityEngine.SceneManagement;
|
||
|
|
using UnityEngine.TestTools;
|
||
|
|
|
||
|
|
namespace TKS.Tests
|
||
|
|
{
|
||
|
|
/// <summary>
|
||
|
|
/// 열린 에디터에서 고친 화면만 찍기(PD 2026-11-09 「수정된 화면만 체크」 · 「에디터는 닫지 않음」) — UICaptureDriver 를 에디터를 닫지 않는 방식으로 돌린다.
|
||
|
|
/// 찍을 화면 = Logs/ui_capture_only.txt 한 줄(쉼표 · 정확한 이름 또는 「접두*」 · 이름 = UICaptureDriver 의 shot 이름) · 결과 = Logs/ui_capture/.
|
||
|
|
/// 실행: test run --mode playmode --filter Capture_UiOnly --include-explicit --async-tests
|
||
|
|
/// </summary>
|
||
|
|
public class UiCaptureTests
|
||
|
|
{
|
||
|
|
[TearDown]
|
||
|
|
public void TearDown()
|
||
|
|
{
|
||
|
|
SaveStore.UseMemory(false);
|
||
|
|
}
|
||
|
|
|
||
|
|
[UnityTest, Explicit]
|
||
|
|
public IEnumerator Capture_UiOnly()
|
||
|
|
{
|
||
|
|
string logs = Path.Combine(Path.GetDirectoryName(Application.dataPath), "Logs");
|
||
|
|
string listPath = Path.Combine(logs, "ui_capture_only.txt");
|
||
|
|
Assert.IsTrue(File.Exists(listPath), "찍을 화면 목록 없음: " + listPath);
|
||
|
|
string only = File.ReadAllText(listPath).Trim();
|
||
|
|
Assert.IsNotEmpty(only, "찍을 화면 목록이 빔");
|
||
|
|
LogAssert.ignoreFailingMessages = true; // 캡처 전용 — 같은 에디터를 쓰는 다른 세션의 명령 오류 로그로 캡처가 끊기지 않게
|
||
|
|
WorldProgress.Reset();
|
||
|
|
SaveStore.UseMemory(true);
|
||
|
|
SceneManager.LoadScene("Battle");
|
||
|
|
yield return null;
|
||
|
|
yield return null;
|
||
|
|
var d = UICaptureDriver.Spawn(Path.Combine(logs, "ui_capture"), only);
|
||
|
|
float t0 = Time.realtimeSinceStartup;
|
||
|
|
while (!d.Finished && Time.realtimeSinceStartup - t0 < 300f) yield return null;
|
||
|
|
Assert.IsTrue(d.Finished, "캡처가 5분 안에 끝나지 않음");
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|