test(accessibility): retain native status layout evidence

Refs #6

Co-Authored-By: Codex (GPT-6) <noreply@openai.com>
Signed-off-by: James Maes <jmaes@dmdbrands.com>
This commit is contained in:
James MaesandCodex committed 2026-10-10 20:20:23 -05:00
1 parent 23928bc614
commit e7b6985a34
4 files changed
+24 -3

No files matched your search

+1
View File
@@ -50,6 +50,7 @@ jobs:
artifacts/installed-smoke-*/*.json
artifacts/installed-smoke-*/*.log
artifacts/installed-smoke-*/*.trx
artifacts/installed-smoke-*/*.png
retention-days: 7
ci:
uses: KofTwentyTwo/standards/.github/workflows/dotnet.yml@fdf5ed029603c938615a32b1beca3628b8787945 # v0.1.2
+1 -1
View File
@@ -41,7 +41,7 @@ the UI thread, but the status text was absent from automation. The next targeted
change exposes StatusText with an explicit automation ID, text-bound accessible
name and content view. The deletion assertion remains unchanged; it also requires
the initial Opened status to be accessible. Build and formatting pass locally;
hosted recovery proof is pending. Scripts 38100976565 reproduced the analyzer
hosted recovery proof is pending. Accessibility head 23928bc still failed the initial status lookup (24/25 UI tests passed); properties alone did not resolve it. The next diagnostic retains the native tree and fixture-window PNG in hosted installed evidence. No deletion assertion is weakened. Scripts 38100976565 reproduced the analyzer
engine crash; no scripts/settings/workflow changed and issue #5 remains open.
## Repository and authorization
@@ -95,6 +95,19 @@ public sealed class AppSession : IDisposable
/// <summary>Retains only this fixture window and its accessibility tree when document status acceptance fails.</summary>
public string DescribeDocumentStatus()
{
string directory = Path.Combine(Environment.GetEnvironmentVariable("GITHUB_WORKSPACE") ?? DataDirectory, "artifacts", "installed-smoke-ui");
Directory.CreateDirectory(directory);
string name = Guid.NewGuid().ToString("N");
MainWindow.CaptureToFile(Path.Combine(directory, name + ".png"));
string tree = FlaUI.Core.Debug.Details(MainWindow);
File.WriteAllText(Path.Combine(directory, name + ".log"), tree);
return tree;
}
/// <summary>The settings file as the app last saved it.</summary>
public string ReadSettings() => ReadShared(Path.Combine(DataDirectory, "settings.json"));
@@ -149,7 +149,14 @@ public class AppTests
{
using var session = new AppSession(document: "# Last readable version");
session.WaitFor(() => session.FindInApp(cf => cf.ByName("Last readable version")), "the initial heading", TimeSpan.FromSeconds(30));
session.WaitFor(() => session.FindInApp(cf => cf.ByAutomationId("StatusText").And(cf.ByName("Opened document.md"))), "the accessible initial document status");
try
{
session.WaitFor(() => session.FindInApp(cf => cf.ByAutomationId("StatusText").And(cf.ByName("Opened document.md"))), "the accessible initial document status");
}
catch(TimeoutException exception)
{
throw new TimeoutException($"{exception.Message} Native tree: {session.DescribeDocumentStatus()}", exception);
}
string path = Path.Combine(session.DataDirectory, "document.md");
File.Delete(path);
try
@@ -161,7 +168,7 @@ public class AppTests
catch(TimeoutException exception)
{
AutomationElement? status = session.FindInApp(cf => cf.ByAutomationId("StatusText"));
throw new TimeoutException($"{exception.Message} Observed status: '{status?.Properties.Name.ValueOrDefault}'. Logs: {session.ReadLogs()}", exception);
throw new TimeoutException($"{exception.Message} Observed status: '{status?.Properties.Name.ValueOrDefault}'. Logs: {session.ReadLogs()} Native tree: {session.DescribeDocumentStatus()}", exception);
}
Assert.NotNull(session.FindInApp(cf => cf.ByName("Last readable version")));
File.WriteAllText(path, "# Recovered document");