StudioTestService
Service allowing plugins to automate and customize Test and Run mode testing.
| Memory category | Instances |
|---|
Member index 4
Description
StudioTestService allows plugins to automate and customize Test and Run mode
testing. With StudioTestService, your plugins can launch tests that jump
straight to a specific part of your game, or run complex code tests
automatically.
The following is an example of automated unit testing:
1 2 3 4 5 | |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 | |
History 5
- 700 Add GetTestArgs
- 700 Add ExecuteRunModeAsync
- 700 Add ExecutePlayModeAsync
- 700 Add EndTest
- 700 Add StudioTestService
Members 4
EndTest
| Parameters (1) | ||
|---|---|---|
| value | Variant | |
| Returns (1) | ||
| null | ||
Ends the current Studio test session if called from the server DataModel, even if the test was not started by this service.
If the test was started by StudioTestService:ExecutePlayModeAsync() or StudioTestService:ExecuteRunModeAsync(), the value passed here is returned by that method.
This method returns immediately and ends the test session asynchronously. It errors if called from any DataModel other than that of the server during a running Studio test session.
| Thread safety | Unsafe |
|---|
ExecutePlayModeAsync
| Parameters (1) | ||
|---|---|---|
| args | Variant | |
| Returns (1) | ||
| Variant | ||
Starts a solo Test session and yields until that session ends.
The args parameter can be retrieved using
StudioTestService:GetTestArgs(). Returns the value passed to
StudioTestService:EndTest(), or nil if the test ended by other
means.
This method errors if a test session is already running.
| Security | PluginSecurity |
|---|---|
| Thread safety | Unsafe |
History 1
ExecuteRunModeAsync
| Parameters (1) | ||
|---|---|---|
| args | Variant | |
| Returns (1) | ||
| Variant | ||
Starts a Run test session and yields until that session ends.
The args parameter can be retrieved using
StudioTestService:GetTestArgs(). Returns the value passed to
StudioTestService:EndTest(), or nil if the test ended by other
means.
This method errors if a test session is already running.
| Security | PluginSecurity |
|---|---|
| Thread safety | Unsafe |
History 1
GetTestArgs
| Parameters (0) | ||
|---|---|---|
| No parameters. | ||
| Returns (1) | ||
| Variant | ||
Returns the argument passed to
StudioTestService:ExecutePlayModeAsync() or
StudioTestService:ExecuteRunModeAsync() for the current test
session, or nil if the session was not started by those methods.
| Thread safety | Unsafe |
|---|
History 1
- 700 Add GetTestArgs