Class UITestComponent
Creates reusable test components that define custom behavior at specific phases of the test lifecycle.
Inherited Members
Namespace: UnityEngine.UIElements.TestFramework
Assembly: Unity.UI.TestFramework.Runtime.dll
Syntax
public abstract class UITestComponent
Remarks
Implement the Initialize(AbstractUITestFixture), BeforeTest(), AfterTest(), Shutdown() as needed.
You can activate and deactivate test components:
- To activate the test component, use AddTestComponent(UITestComponent).
- To deactivate the test component, use RemoveTestComponent(UITestComponent).
Properties
fixture
The test fixture to which the UITestComponent is attached.
Declaration
protected AbstractUITestFixture fixture { get; }
Property Value
| Type | Description |
|---|---|
| AbstractUITestFixture |
Methods
AfterTest()
Runs when the RemoveTestComponent(UITestComponent) function is called.
Declaration
protected virtual void AfterTest()
BeforeTest()
Runs when the AddTestComponent(UITestComponent) function is called.
Declaration
protected virtual void BeforeTest()
Initialize(AbstractUITestFixture)
Invoked when the AddTestComponent(UITestComponent) function is called.
Declaration
protected virtual void Initialize(AbstractUITestFixture testFixture)
Parameters
| Type | Name | Description |
|---|---|---|
| AbstractUITestFixture | testFixture | The test fixture to which the test component is added. |
Shutdown()
Runs when the RemoveTestComponent(UITestComponent) function is called.
Declaration
protected virtual void Shutdown()