docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class SceneGraphicsTestAttribute

    Attribute to create a new Scene Graphics Test. When used, it will create a new test case for the method it is applied to.

    Inheritance
    object
    Attribute
    GraphicsTestAttributeBase
    SceneGraphicsTestAttribute
    Implements
    ITestBuilder
    IImplyFixture
    ITestAction
    Inherited Members
    GraphicsTestAttributeBase.TextureFormat
    GraphicsTestAttributeBase.ImageExtension
    GraphicsTestAttributeBase.ReferenceImageRootSource
    GraphicsTestAttributeBase.ReferenceImageNamingStrategyType
    GraphicsTestAttributeBase.TestCaseCreated
    GraphicsTestAttributeBase.BeforeTest(ITest)
    GraphicsTestAttributeBase.AfterTest(ITest)
    GraphicsTestAttributeBase.Targets
    Attribute.Equals(object)
    Attribute.GetCustomAttribute(Assembly, Type)
    Attribute.GetCustomAttribute(Assembly, Type, bool)
    Attribute.GetCustomAttribute(MemberInfo, Type)
    Attribute.GetCustomAttribute(MemberInfo, Type, bool)
    Attribute.GetCustomAttribute(Module, Type)
    Attribute.GetCustomAttribute(Module, Type, bool)
    Attribute.GetCustomAttribute(ParameterInfo, Type)
    Attribute.GetCustomAttribute(ParameterInfo, Type, bool)
    Attribute.GetCustomAttributes(Assembly)
    Attribute.GetCustomAttributes(Assembly, bool)
    Attribute.GetCustomAttributes(Assembly, Type)
    Attribute.GetCustomAttributes(Assembly, Type, bool)
    Attribute.GetCustomAttributes(MemberInfo)
    Attribute.GetCustomAttributes(MemberInfo, bool)
    Attribute.GetCustomAttributes(MemberInfo, Type)
    Attribute.GetCustomAttributes(MemberInfo, Type, bool)
    Attribute.GetCustomAttributes(Module)
    Attribute.GetCustomAttributes(Module, bool)
    Attribute.GetCustomAttributes(Module, Type)
    Attribute.GetCustomAttributes(Module, Type, bool)
    Attribute.GetCustomAttributes(ParameterInfo)
    Attribute.GetCustomAttributes(ParameterInfo, bool)
    Attribute.GetCustomAttributes(ParameterInfo, Type)
    Attribute.GetCustomAttributes(ParameterInfo, Type, bool)
    Attribute.GetHashCode()
    Attribute.IsDefaultAttribute()
    Attribute.IsDefined(Assembly, Type)
    Attribute.IsDefined(Assembly, Type, bool)
    Attribute.IsDefined(MemberInfo, Type)
    Attribute.IsDefined(MemberInfo, Type, bool)
    Attribute.IsDefined(Module, Type)
    Attribute.IsDefined(Module, Type, bool)
    Attribute.IsDefined(ParameterInfo, Type)
    Attribute.IsDefined(ParameterInfo, Type, bool)
    Attribute.Match(object)
    Attribute.TypeId
    object.Equals(object, object)
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: UnityEngine.TestTools.Graphics
    Assembly: UnityEngine.TestTools.Graphics.dll
    Syntax
    public class SceneGraphicsTestAttribute : GraphicsTestAttributeBase, ITestBuilder, IImplyFixture, ITestAction
    Remarks

    This attribute uses the SceneGraphicsTestCaseSource class to create the test cases.

    Constructors

    SceneGraphicsTestAttribute(params string[])

    Creates a new instance of the SceneGraphicsTestAttribute class.

    Declaration
    public SceneGraphicsTestAttribute(params string[] scenePaths)
    Parameters
    Type Name Description
    string[] scenePaths

    The paths to the scenes to be used for the test. These paths are relative to the project folder and must be in a path that is indexed by the Unity Asset Database.

    Remarks

    Valid scene paths are:
    - Direct paths to Unity scene assets, e.g. Assets/Scenes/TestScene.unity
    - Paths to asset directories, e.g. Assets/Scenes. In this case, all scenes in the directory and its subdirectories will be included.
    - Regular expressions only for the file names of test scenes, e.g. Assets/Scenes/[0-9]+. The regular expressions may not affect the base directory, so Assets/.*/TestScene.unity or equivalent is not valid. You may also not use backslashes as path separators when using the regex feature. Assets\Scenes/[0-9]+ is invalid, but Assets/Scenes/\d+ is valid.
    - Paths from any directory recognized by the AssetDatabase, so Packages/YourPackageName/Scenes is also valid.

    SceneGraphicsTestAttribute(Type, params string[])

    Creates a new instance of the SceneGraphicsTestAttribute class.

    Declaration
    public SceneGraphicsTestAttribute(Type source, params string[] scenePaths)
    Parameters
    Type Name Description
    Type source

    The type of the source to be used for the test. This is usually SceneGraphicsTestCaseSource or a derived class.

    string[] scenePaths

    The paths to the scenes to be used for the test. These paths are relative to the project folder and must be in a path that is indexed by the Unity Asset Database.

    Remarks

    Valid scene paths are:
    - Direct paths to Unity scene assets, e.g. Assets/Scenes/TestScene.unity
    - Paths to asset directories, e.g. Assets/Scenes. In this case, all scenes in the directory and its subdirectories will be included.
    - Regular expressions only for the file names of test scenes, e.g. Assets/Scenes/[0-9]+. The regular expressions may not affect the base directory, so Assets/.*/TestScene.unity or equivalent is not valid. You may also not use backslashes as path separators when using the regex feature. Assets\Scenes/[0-9]+ is invalid, but Assets/Scenes/\d+ is valid.
    - Paths from any directory recognized by the AssetDatabase, so Packages/YourPackageName/Scenes is also valid.

    Implements

    NUnit.Framework.Interfaces.ITestBuilder
    NUnit.Framework.Interfaces.IImplyFixture
    NUnit.Framework.ITestAction
    In This Article
    Back to top
    Copyright © 2026 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)