docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class CommonUITestFixture

    Basic implementation of AbstractUITestFixture. Manages NUnit's lifetime and provides a PanelSimulator to simulate interactions with UIToolkit content. Provides component-based extensibility for re-usable utilities. Actual usage done via UITestFixture, EditorWindowUITestFixture<EditorWindowType> or RuntimeUITestFixture

    Inheritance
    object
    AbstractUITestFixture
    CommonUITestFixture
    EditorWindowUITestFixture<EditorWindowType>
    RuntimeUITestFixture
    Inherited Members
    AbstractUITestFixture.AddTestComponent<T>()
    AbstractUITestFixture.RemoveTestComponent<T>()
    AbstractUITestFixture.panel
    AbstractUITestFixture.rootVisualElement
    AbstractUITestFixture.panelName
    AbstractUITestFixture.needsRendering
    AbstractUITestFixture.pixelsPerPoint
    AbstractUITestFixture.panelSize
    AbstractUITestFixture.ReleasePanel()
    AbstractUITestFixture.RecreatePanel()
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: UnityEngine.UIElements.TestFramework
    Assembly: Unity.UI.TestFramework.Runtime.dll
    Syntax
    public abstract class CommonUITestFixture : AbstractUITestFixture

    Properties

    clearContentAfterTest

    When set to true, the rootVisualElement will be cleared after each test.

    Declaration
    public override sealed bool clearContentAfterTest { get; set; }
    Property Value
    Type Description
    bool
    Overrides
    AbstractUITestFixture.clearContentAfterTest
    Remarks

    Defaults to true.

    simulate

    Returns the PanelSimulator used by the test fixture.

    Declaration
    public override sealed PanelSimulator simulate { get; set; }
    Property Value
    Type Description
    PanelSimulator
    Overrides
    AbstractUITestFixture.simulate
    Remarks

    Use this property to interact with the simulated panel.

    themeStyleSheet

    Theme style sheet used by this test fixture.

    Declaration
    public override ThemeStyleSheet themeStyleSheet { get; set; }
    Property Value
    Type Description
    ThemeStyleSheet
    Overrides
    AbstractUITestFixture.themeStyleSheet
    Remarks

    Defaults to null. When the value is null, the style applied will be the default theme style sheet.

    Methods

    AddTestComponent(UITestComponent)

    Adds the component to the test fixture.

    Declaration
    public override sealed void AddTestComponent(UITestComponent component)
    Parameters
    Type Name Description
    UITestComponent component

    The UITestComponent to add to the test fixture.

    Overrides
    AbstractUITestFixture.AddTestComponent(UITestComponent)
    Remarks

    Adding the component to the test fixture triggers relevant UITestComponent virtual methods based on the current test state.

    FindTestComponent<T>()

    Returns the first component of type T attached to the test fixture.

    Declaration
    public override sealed T FindTestComponent<T>()
    Returns
    Type Description
    T

    The first component of type T.

    Type Parameters
    Name Description
    T

    The type of UITestComponent to search for.

    Overrides
    AbstractUITestFixture.FindTestComponent<T>()

    FixtureOneTimeSetUp()

    Sets up the test fixture.

    Declaration
    public override void FixtureOneTimeSetUp()
    Overrides
    AbstractUITestFixture.FixtureOneTimeSetUp()

    FixtureOneTimeTearDown()

    Tears down the test fixture.

    Declaration
    public override void FixtureOneTimeTearDown()
    Overrides
    AbstractUITestFixture.FixtureOneTimeTearDown()

    FixtureSetUp()

    Sets up the test.

    Declaration
    public override void FixtureSetUp()
    Overrides
    AbstractUITestFixture.FixtureSetUp()

    FixtureTearDown()

    Tears down the test.

    Declaration
    public override void FixtureTearDown()
    Overrides
    AbstractUITestFixture.FixtureTearDown()

    RemoveTestComponent(UITestComponent)

    Removes the component from the test fixture.

    Declaration
    public override sealed void RemoveTestComponent(UITestComponent component)
    Parameters
    Type Name Description
    UITestComponent component

    The UITestComponent to remove from the test fixture.

    Overrides
    AbstractUITestFixture.RemoveTestComponent(UITestComponent)
    Remarks

    Removing the component from the test fixture triggers relevant UITestComponent virtual methods based on on the current test state.

    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)