Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion tests/UI/Logic/AccessibleNamesTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
.ToList();

var unnamed = new StringBuilder();
var openFailures = new StringBuilder();
var opened = 0;
var skipped = new List<string>();
foreach (var type in windowTypes)
Expand Down Expand Up @@ -71,7 +72,8 @@
}
catch (Exception e)
{
skipped.Add($"{type.Name} ({(e as TargetInvocationException)?.InnerException?.GetType().Name ?? e.GetType().Name})");
var cause = (e as TargetInvocationException)?.InnerException ?? e;
openFailures.AppendLine($"{type.Name}: {cause.GetType().Name}: {cause.Message}");
continue;
}

Expand Down Expand Up @@ -99,6 +101,7 @@
}
}

Assert.True(openFailures.Length == 0, $"Windows that failed to open:\n{openFailures}");
Assert.True(opened > 50, $"Only {opened} windows opened; skipped: {string.Join(", ", skipped)}");
Assert.True(unnamed.Length == 0, $"Inputs without an accessible name ({opened} windows opened, {skipped.Count} skipped):\n{unnamed}");
}
Expand Down Expand Up @@ -130,9 +133,9 @@
parts.Add($"name={control.Name}");
}

if (control is TextBox textBox && !string.IsNullOrEmpty(textBox.Watermark))

Check warning on line 136 in tests/UI/Logic/AccessibleNamesTests.cs

View workflow job for this annotation

GitHub Actions / test

'TextBox.Watermark' is obsolete: 'Use PlaceholderText instead.'
{
parts.Add($"watermark={textBox.Watermark}");

Check warning on line 138 in tests/UI/Logic/AccessibleNamesTests.cs

View workflow job for this annotation

GitHub Actions / test

'TextBox.Watermark' is obsolete: 'Use PlaceholderText instead.'
}

var parent = control.Parent;
Expand Down
Loading