Class UITestComponent
Use this class to create your own 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(CommonUITestFixture), BeforeTest(), AfterTest(), Shutdown() as needed. Use AddTestComponent(UITestComponent) to activate the test component. Use RemoveTestComponent(UITestComponent) to deactivate the test component.
Properties
fixture
The test fixture to which the UITestComponent is attached.
Declaration
protected AbstractUITestFixture fixture { get; }
Property Value
| Type | Description |
|---|---|
| AbstractUITestFixture |
Methods
AfterTest()
This function will be invoked when the RemoveTestComponent(UITestComponent) function is called.
Declaration
protected virtual void AfterTest()
BeforeTest()
This function will be invoked 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 being added. |
Shutdown()
This function will be invoked when the RemoveTestComponent(UITestComponent) function is called.
Declaration
protected virtual void Shutdown()