Skip to content
Roblox API Reference

TestService

A service used by Roblox to run controlled tests of the engine. It is available for developers to use, to a limited degree.
  • Service
Memory category
Instances
Own members
58
Inherited members
75
Subclasses
0
Siblings
608

Properties37

Inherited fromObject2

Property categoryData

Inherited fromInstance21

Property categoryBehavior

Property categoryData

Property categoryPermissions

Defined byTestService14

Property categoryData

  • TestService.Description: string = ""
    A description of the test being executed.
  • TestService.Enabled: boolean = false
    • Read only
    • Thread unsafe

Property categoryPhysics

  • TestService.AutoRuns: boolean = true
    If set to true, the game will start running when the service's TestService:RunAsync() method is called.
  • TestService.IsPhysicsEnvironmentalThrottled: boolean = true
    Sets whether or not the physics environment should be throttled while running this test.
  • TestService.IsSleepAllowed: boolean = true
    Sets whether or not physics objects will be allowed to fall asleep while the test simulation is running.
  • TestService.ThrottlePhysicsToRealtime: boolean = true
    Sets whether the test should be throttled to simulate time according to real world time or as fast as possible.
  • TestService.Is30FpsThrottleEnabled: boolean = true
    Deprecated: This has been deprecated and directly renamed to ThrottlePhysicsToRealtime to better reflect its practical use.
    Sets whether or not the physics engine should be throttled to 30 FPS while the test is being ran.
    • Deprecated
    • Not replicated
    • Load only

    Use ThrottlePhysicsToRealtime instead.

Property categoryResults

  • TestService.ErrorCount: number = 0
    Measures how many errors have been recorded in the test session.
    • Read only
    • Save only
  • TestService.TestCount: number = 0
    Measures how many test calls have been recorded in the test session.
    • Read only
    • Save only
  • TestService.WarnCount: number = 0
    Measures how many warning calls have been recorded in the test session.
    • Read only
    • Save only

Property categorySettings

  • TestService.ExecuteWithStudioRun: boolean = false
    When set to true, TestService will be executed when using the Run action in Roblox Studio.
  • TestService.NumberOfPlayers: number = 0
    The number of players expected in this test, if any.
  • TestService.SimulateSecondsLag: number = 0
    Sets a specific amount of additional latency experienced by players during the test session.
  • TestService.Timeout: number = 10
    The maximum amount of time that tests are allowed to run for.

Methods83

Inherited fromObject3
  • Get an event that fires when a given property of the object changes.
    Parameters
    ParameterDescription
    property: string
    The property to connect to.
    Returns
    TypeDescription
    RBXScriptSignal
    A signal that fires whenever the property changes.
  • Object:IsA(className: string): boolean
    Returns true if an object's class matches or inherits from a given class.
    • Custom Lua state
    • Thread safe
    Parameters
    ParameterDescription
    className: string
    The class against which the Object's class will be checked. Case-sensitive.
    Returns
    TypeDescription
    boolean
    Describes whether the Object's class matched or is a subclass of the given class.
  • Object:isA(className: string): boolean
    Deprecated: This deprecated function is a variant of Object:IsA() which should be used instead.
    • Deprecated
    • Custom Lua state
    Parameters
    Parameter
    className: string
    Returns
    Type
    boolean

    Use IsA instead.

Inherited fromInstance39
Defined byTestService41
  • TestService:CaptureScreenshotAsync(artifactName: string? = "",options: { [string]: any }? = nil,): ...any
    • Yields
    • Capabilities: InternalTest
    Parameters
    Parameter
    artifactName: string? = ""
    options: { [string]: any }? = nil
    Returns
    Type
    ...any
  • TestService:Check(condition: boolean,description: string,source: Instance? = nil,line: number? = 0,)
    Prints result of a condition to the output.
    Parameters
    ParameterDescription
    condition: boolean
    The boolean expression to evaluate as the test assertion.
    description: string
    A label that identifies this check in the test output.
    source: Instance? = nil
    The script instance that invoked the check, used for output attribution. Defaults to nil.
    line: number? = 0
    The line number in the source script where the check was called. Defaults to 0.
  • TestService:Checkpoint(text: string, source: Instance? = nil, line: number? = 0)
    Prints Test checkpoint: followed by a string to the output in blue text.
    Parameters
    ParameterDescription
    text: string
    The message to print alongside the checkpoint label.
    source: Instance? = nil
    The script instance that invoked the checkpoint, used for output attribution. Defaults to nil.
    line: number? = 0
    The line number in the source script where the checkpoint was called. Defaults to 0.
  • TestService:ConvertSlimAcrToObj(acrFullFilePath: string,objFileName: string,): string
    • Roblox script security
    Parameters
    Parameter
    acrFullFilePath: string
    objFileName: string
    Returns
    Type
    string
  • TestService:CreateAndSavePropertySet(source: Instance): string
    • Roblox script security
    Parameters
    Parameter
    source: Instance
    Returns
    Type
    string
  • TestService:CreateExtraAssetsFileFromPropertySet(psetFileName: string): string
    • Roblox script security
    Parameters
    Parameter
    psetFileName: string
    Returns
    Type
    string
  • TestService:Done()
    Prints Testing Done to the output in blue text.
  • TestService:Error(description: string,source: Instance? = nil,line: number? = 0,)
    Prints a red error message to the output, prefixed by TestService:.
    Parameters
    ParameterDescription
    description: string
    The error message text to display.
    source: Instance? = nil
    The script instance that raised the error, used for output attribution. Defaults to nil.
    line: number? = 0
    The line number in the source script where the error was raised. Defaults to 0.
  • TestService:Fail(description: string,source: Instance? = nil,line: number? = 0,)
    Indicates a fatal error in a TestService run.
    Parameters
    ParameterDescription
    description: string
    The failure message text to display.
    source: Instance? = nil
    The script instance where the failure occurred, used for output attribution. Defaults to nil.
    line: number? = 0
    The line number in the source script where the failure was triggered. Defaults to 0.
  • TestService:FetchExtraAssets(extraAssetsFileName: string): string
    • Roblox script security
    Parameters
    Parameter
    extraAssetsFileName: string
    Returns
    Type
    string
  • TestService:FetchTestControlsAsync(category: string): ...any
    • Yields
    • Capabilities: InternalTest
    Parameters
    Parameter
    category: string
    Returns
    Type
    ...any
  • TestService:GetTestControls(providerName: string): { [string]: any }
    • Capabilities: InternalTest
    Parameters
    Parameter
    providerName: string
  • TestService:GetTestControlSchema(providerName: string): { [string]: any }
    • Capabilities: InternalTest
    Parameters
    Parameter
    providerName: string
  • TestService:ListTests(): { any }
    Returns
    Type
    { any }
  • TestService:Message(text: string, source: Instance? = nil, line: number? = 0)
    Prints TestService: followed by a string to the output in blue text.
    Parameters
    ParameterDescription
    text: string
    The message to print to the output.
    source: Instance? = nil
    The script instance that sent the message, used for output attribution. Defaults to nil.
    line: number? = 0
    The line number in the source script where the message was sent. Defaults to 0.
  • TestService:RegisterSuite(suiteName: string,options: { [string]: any }? = nil,): TestSuite
    Parameters
    Parameter
    suiteName: string
    options: { [string]: any }? = nil
    Returns
    Type
    TestSuite
  • TestService:RegisterTest(testName: string,options: { [string]: any }? = nil,callback: ((...any) -> ...any)? = nil,): TestCase
    Parameters
    Parameter
    testName: string
    options: { [string]: any }? = nil
    callback: ((...any) -> ...any)? = nil
    Returns
    Type
    TestCase
  • TestService:RequestValidationAsync(module: string,artifactName: string,options: any,): ...any
    • Yields
    • Capabilities: InternalTest
    Parameters
    Parameter
    module: string
    artifactName: string
    options: any
    Returns
    Type
    ...any
  • TestService:Require(condition: boolean,description: string,source: Instance? = nil,line: number? = 0,)
    Prints whether a condition is true along with a description string.
    Parameters
    ParameterDescription
    condition: boolean
    The boolean expression to evaluate as a required assertion.
    description: string
    A label that identifies this requirement in the test output.
    source: Instance? = nil
    The script instance that invoked the requirement, used for output attribution. Defaults to nil.
    line: number? = 0
    The line number in the source script where the requirement was called. Defaults to 0.
  • TestService:ResetTestControl(providerName: string, controlName: string)
    • Capabilities: InternalTest
    Parameters
    Parameter
    providerName: string
    controlName: string
  • TestService:ResetTestRegistry()
  • TestService:RunAsync()
    Runs scripts which are parented to TestService.
    • Yields
    • Plugin security
  • TestService:RunTestsAsync(filter: { [string]: any }? = nil): TestRunResult
    • Yields
    Parameters
    Parameter
    filter: { [string]: any }? = nil
    Returns
    Type
    TestRunResult
  • TestService:ScopeTime(): { [string]: any }
    Returns a dictionary of per-scope physics simulation timings for performance testing.
    Returns
    TypeDescription
    { [string]: any }
    A dictionary mapping physics simulation scopes to their measured step times.
  • TestService:SetTestControl(providerName: string,controlName: string,value: any,)
    • Capabilities: InternalTest
    Parameters
    Parameter
    providerName: string
    controlName: string
    value: any
  • TestService:SignalProfilingCapture(target: string? = "",options: { [string]: any }? = nil,)
    • Capabilities: InternalTest
    Parameters
    Parameter
    target: string? = ""
    options: { [string]: any }? = nil
  • TestService:SignalProfilingStart(target: string? = "",options: { [string]: any }? = nil,)
    • Capabilities: InternalTest
    Parameters
    Parameter
    target: string? = ""
    options: { [string]: any }? = nil
  • TestService:SignalProfilingStop(target: string? = "")
    • Capabilities: InternalTest
    Parameters
    Parameter
    target: string? = ""
  • TestService:StartAudioCaptureAsync(artifactName: string? = "",options: { [string]: any }? = nil,): ...any
    • Yields
    • Capabilities: InternalTest
    Parameters
    Parameter
    artifactName: string? = ""
    options: { [string]: any }? = nil
    Returns
    Type
    ...any
  • TestService:StartTestSession()
    • Capabilities: InternalTest
  • TestService:StartVideoCaptureAsync(artifactName: string? = "",options: { [string]: any }? = nil,): ...any
    • Yields
    • Capabilities: InternalTest
    Parameters
    Parameter
    artifactName: string? = ""
    options: { [string]: any }? = nil
    Returns
    Type
    ...any
  • TestService:StopAudioCaptureAsync(): ...any
    • Yields
    • Capabilities: InternalTest
    Returns
    Type
    ...any
  • TestService:StopTestSession()
    • Capabilities: InternalTest
  • TestService:StopVideoCaptureAsync(): ...any
    • Yields
    • Capabilities: InternalTest
    Returns
    Type
    ...any
  • TestService:TakeSnapshot(snapshotname: string, source: Instance? = nil)
    • Capabilities: InternalTest
    Parameters
    Parameter
    snapshotname: string
    source: Instance? = nil
  • TestService:TranscodePropertySet(extraAssetsFileName: string,psetFileName: string,): string
    • Roblox script security
    Parameters
    Parameter
    extraAssetsFileName: string
    psetFileName: string
    Returns
    Type
    string
  • TestService:Warn(condition: boolean,description: string,source: Instance? = nil,line: number? = 0,)
    Prints if a condition is true, otherwise prints a warning.
    Parameters
    ParameterDescription
    condition: boolean
    The boolean expression to evaluate as the warning assertion.
    description: string
    A label that identifies this warning check in the test output.
    source: Instance? = nil
    The script instance that invoked the warning, used for output attribution. Defaults to nil.
    line: number? = 0
    The line number in the source script where the warning was called. Defaults to 0.
  • TestService:getTestSessionProviderStats(providerName: string): { [string]: any }
    • Capabilities: InternalTest
    Parameters
    Parameter
    providerName: string
  • TestService:isFeatureEnabled(name: string): boolean
    Returns whether the named feature identified by name is currently enabled.
    Parameters
    ParameterDescription
    name: string
    The name of the feature to query.
    Returns
    TypeDescription
    boolean
    true if the named feature resolves to true, false otherwise.
  • TestService:RegisterTestLegacy(testOptions: { [string]: any }): TestCase
    • Deprecated
    • Capabilities: InternalTest
    Parameters
    Parameter
    testOptions: { [string]: any }
    Returns
    Type
    TestCase

    Use RegisterTest instead.

  • TestService:Run()
    Deprecated: Use RunAsync() instead.
    Runs scripts which are parented to TestService.
    • Deprecated
    • Yields
    • Plugin security

    Use RunAsync instead.

Events13

Inherited fromObject1
Inherited fromInstance9
Defined byTestService3