docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class ContextMenuSimulator

    Provides a testable wrapper for context menu interactions in UI Toolkit tests. Allows simulation and verification of context menu display, item selection, and menu content without invoking the native system menu.

    Inheritance
    object
    UITestComponent
    MenuSimulator
    ContextMenuSimulator
    Inherited Members
    MenuSimulator.menuIsDisplayed
    MenuSimulator.menuItemCount
    MenuSimulator.DiscardMenu()
    MenuSimulator.SimulateItemSelection(int)
    MenuSimulator.SimulateMenuSelection(string)
    MenuSimulator.FindActionIndex(string)
    MenuSimulator.AssertContainsAction(string)
    MenuSimulator.AssertContainsAction(string, DropdownMenuAction.Status)
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: UnityEditor.UIElements.TestFramework
    Assembly: Unity.UI.TestFramework.Editor.dll
    Syntax
    public sealed class ContextMenuSimulator : MenuSimulator

    Methods

    AfterTest()

    internal lifecycle method invoked automatically by the test fixture

    Declaration
    protected override void AfterTest()
    Overrides
    MenuSimulator.AfterTest()

    BeforeTest()

    internal lifecycle method invoked automatically by the test fixture

    Declaration
    protected override void BeforeTest()
    Overrides
    MenuSimulator.BeforeTest()
    In This Article
    Back to top
    Copyright © 2025 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)