Class: GameTestSequence
Executes a set of steps defined via chained .thenXyz methods, sequentially. This facilitates a 'script' of GameTest setup methods and assertions over time.
Constructors
new GameTestSequence()
private
new GameTestSequence():GameTestSequence
Returns
Methods
thenExecute()
thenExecute(
callback
):GameTestSequence
Parameters
Parameter | Type | Description |
---|---|---|
callback | () => void | Callback function to execute. |
Returns
Returns a GameTestSequence object where additional .thenXyz method steps can be added.
Remarks
Runs the given callback as a step within a GameTest sequence. Exceptions thrown within the callback will end sequence execution.
This function can't be called in read-only mode.
thenExecuteAfter()
thenExecuteAfter(
delayTicks
,callback
):GameTestSequence
Parameters
Parameter | Type | Description |
---|---|---|
delayTicks | number | Number of ticks to wait before executing the callback. |
callback | () => void | Callback function to execute. |
Returns
Returns a GameTestSequence object where additional .thenXyz method steps can be added.
Remarks
After a delay, runs the given callback as a step within a GameTest sequence. Exceptions thrown within the callback will end sequence execution.
This function can't be called in read-only mode.
thenExecuteFor()
thenExecuteFor(
tickCount
,callback
):GameTestSequence
Parameters
Parameter | Type | Description |
---|---|---|
tickCount | number | - |
callback | () => void | Callback function to execute. |
Returns
Returns a GameTestSequence object where additional .thenXyz method steps can be added.
Remarks
Runs the given callback every tick for the given number of ticks.
This function can't be called in read-only mode.
thenFail()
thenFail(
errorMessage
):void
Parameters
Parameter | Type | Description |
---|---|---|
errorMessage | string | Error message summarizing the failure condition. |
Returns
void
Remarks
Causes the test to fail if this step in the GameTest sequence is reached.
This function can't be called in read-only mode.
thenIdle()
thenIdle(
delayTicks
):GameTestSequence
Parameters
Parameter | Type | Description |
---|---|---|
delayTicks | number | Number of ticks to delay for this step in the GameTest sequence. |
Returns
Returns a GameTestSequence object where additional .thenXyz method steps can be added.
Remarks
Idles the GameTest sequence for the specified delayTicks.
This function can't be called in read-only mode.
thenSucceed()
thenSucceed():
void
Returns
void
Remarks
Marks the GameTest a success if this step is reached in the GameTest sequence.
This function can't be called in read-only mode.
thenWait()
thenWait(
callback
):GameTestSequence
Parameters
Parameter | Type | Description |
---|---|---|
callback | () => void | Testing callback function to execute. Typically, this function will have .assertXyz functions within it. |
Returns
Returns a GameTestSequence object where additional .thenXyz method steps can be added.
Remarks
Executes the given callback every tick until it succeeds. Exceptions thrown within the callback will end sequence execution.
This function can't be called in read-only mode.
thenWaitAfter()
thenWaitAfter(
delayTicks
,callback
):GameTestSequence