WIP: try to get context menu to work properly in automation tests

This commit is contained in:
tznind
2025-03-16 17:15:06 +00:00
committed by Tig
parent 4316378f6e
commit f0bd577c98
2 changed files with 159 additions and 3 deletions

View File

@@ -37,6 +37,30 @@ public class BasicFluentAssertionTests
.ResizeConsole (20,20)
.Assert (lbl.Frame.Width.Should ().Be (18))
.Stop ();
}
[Fact]
public void ContextMenu_CrashesOnRight ()
{
var clicked = false;
var ctx = new ContextMenu ();
var menuItems = new MenuBarItem (
[
new ("_New File", string.Empty, () => { clicked = true; })
]
);
using var c = With.A<Window> (40, 10)
.WithContextMenu(ctx,menuItems)
// Click in main area inside border
.RightClick(1,1)
.LeftClick (2, 2)
/*.Assert (Application.Top.Focused.Should ().BeAssignableTo(typeof(MenuBarItem)))
.Down()
.Enter()*/
.Stop ();
Assert.True (clicked);
}
}