LocatorAssertions

Specter provides custom expect matchers specifically designed for Unreal Engine. These assertions will automatically poll the engine (retrying until a timeout) until the condition is met, exactly like web Playwright.

Gameplay Ability System (GAS)

Assertions for polling and verifying Gameplay Tags, Attributes, Abilities, and Effects.

expect(actor).toHaveGameplayTag

Ensures the given actor currently possesses the specified Gameplay Tag on its Ability System Component.

Usage

await expect(enemy).toHaveGameplayTag("Status.Stunned", { timeout: 10000 });

Arguments

  • tagstring
    The Gameplay Tag string (e.g., 'Status.Stunned').
  • optionsObject(optional)
    • timeoutnumber(optional)Defaults to 5000
      Time to retry the assertion for in milliseconds. Defaults to timeout in TestConfig.expect.

Returns

  • Promise<void>

expect(actor).toHaveAnyGameplayTags

Ensures the given actor has at least one of the specified Gameplay Tags.

Usage

await expect(enemy).toHaveAnyGameplayTags(["Status.Stunned", "Status.Rooted"]);

Arguments

  • tagsstring[]
    An array of Gameplay Tags.

Returns

  • Promise<void>

expect(actor).toHaveAllGameplayTags

Ensures the given actor has all of the specified Gameplay Tags.

Usage

await expect(enemy).toHaveAllGameplayTags(["Status.Stunned", "Status.Burning"]);

Arguments

  • tagsstring[]
    An array of Gameplay Tags.

Returns

  • Promise<void>

expect(actor).toHaveGameplayTagCount

Verifies the exact count of a specific Gameplay Tag.

Usage

await expect(enemy).toHaveGameplayTagCount("Status.Poisoned", 3);

Arguments

  • tagstring
    The Gameplay Tag.
  • expectedCountnumber
    The expected exact count.

Returns

  • Promise<void>

expect(actor).toHaveAttributeValue

Polls the actor's Ability System attributes and passes once the specified attribute exactly matches the expected value.

Usage

await expect(defender).toHaveAttributeValue("MMAttributeSet", "Health", 10);

Arguments

  • setstring
    The Attribute Set class name.
  • attributestring
    The specific attribute name.
  • expectedValuenumber
    The exact numeric value to wait for.

Returns

  • Promise<void>

expect(actor).toHaveAttributeBaseValue

Polls the actor's Ability System attributes and passes once the specified base attribute exactly matches the expected value.

Usage

await expect(defender).toHaveAttributeBaseValue("MMAttributeSet", "MaxHealth", 100);

Arguments

  • setstring
    The Attribute Set class name.
  • attributestring
    The specific base attribute name.
  • expectedValuenumber
    The exact numeric value to wait for.

Returns

  • Promise<void>

expect(actor).toHaveAttributeChange

Polls the actor's Ability System attributes and passes if the specified attribute changes by the expected delta within the timeout.

Usage

await expect(defender).toHaveAttributeChange("MMAttributeSet", "Health", {
  delta: -attackerDamage,
  instigator: attacker,
  ability: "Default__GA_Marshmallow_Punch_C"
}, async () => {
  await attacker.triggerAbilityByTag("Ability.Attack.Melee");
});

Arguments

  • setstring
    The Attribute Set class name.
  • attributestring
    The specific attribute name.
  • optionsObject
    Options including { delta?: number, instigator?: ActorLocator, ability?: string }.
  • actionFunction(optional)
    An async callback that triggers the attribute change.

Returns

  • Promise<void>

expect(actor).toHaveGameplayEffect

Verifies the actor has an active Gameplay Effect of the given class.

Usage

await expect(hero).toHaveGameplayEffect("/Game/Effects/GE_Shield");

Arguments

  • effectClassPathstring
    The effect class path.

Returns

  • Promise<void>

expect(actor).toHaveGameplayEffectStackCount

Verifies the actor has an active Gameplay Effect with a specific stack count.

Usage

await expect(hero).toHaveGameplayEffectStackCount("/Game/Effects/GE_Bleed", 5);

Arguments

  • effectClassPathstring
    The effect class path.
  • expectedCountnumber
    The expected stack count.

Returns

  • Promise<void>

expect(actor).toHaveGameplayEffectLevel

Verifies the actor has an active Gameplay Effect with a specific level.

Usage

await expect(hero).toHaveGameplayEffectLevel("/Game/Effects/GE_Buff", 2);

Arguments

  • effectClassPathstring
    The effect class path.
  • expectedLevelnumber
    The expected level.

Returns

  • Promise<void>

expect(actor).toHaveAppliedGameplayEffect

Verifies that a specific Gameplay Effect has been applied to the target actor's Ability System Component. Supports exact application counts and instigator filtering.

Usage

// Assert an instant damage effect was applied exactly once by Howitzer
await expect(steelActor).toHaveAppliedGameplayEffect(
  "GE_Howitzer_BasicAttack",
  { count: 1, instigator: howitzerActor }
);

// Assert a buff/debuff effect is applied without strict count
await expect(steelActor).toHaveAppliedGameplayEffect("GE_SlowDebuff");

// Assert an effect was NOT applied
await expect(steelActor).not.toHaveAppliedGameplayEffect("GE_Stun");

Arguments

  • effectNameOrClassstring
    The Gameplay Effect class name, asset path, or tag.
  • optionsObject(optional)
    Configuration object: { count?: number, instigator?: string | ActorLocator, timeout?: number }.

Returns

  • Promise<void>

expect(actor).toHaveActiveGameplayEffect

Event-driven assertion that passes when the actor currently has an active, ongoing Gameplay Effect applied to its Ability System Component, with optional stack count and level matching.

Usage

// Assert an active shield buff with exact 3 stacks
await expect(steelActor).toHaveActiveGameplayEffect("GE_ShieldBuff", {
  stacks: 3,
  level: 1,
});

Arguments

  • effectClassPathstring
    The Gameplay Effect class name or asset path.
  • optionsObject(optional)
    Configuration object: { stacks?: number, level?: number, timeout?: number }.

Returns

  • Promise<void>

expect(actor).toHaveGameplayAbility

Verifies the actor has been granted a specific Gameplay Ability.

Usage

await expect(hero).toHaveGameplayAbility("/Game/Abilities/GA_Dash");

Arguments

  • abilityClassPathstring
    The ability class path.
  • optionsObject(optional)
    Configuration object. Supports { timeout: number }.

Returns

  • Promise<void>

expect(actor).toHaveActivatedAbility

Verifies that a specific Gameplay Ability was activated on the actor's Ability System Component. Supports exact activation counts (times) to catch duplicate triggers and inline trigger callbacks.

Usage

// Assert Howitzer's basic attack activates exactly once
await expect(howitzerActor).toHaveActivatedAbility(
  "Ability.Slot.BasicAttack.SingleShot",
  { times: 1 }
);

// Inline trigger action with exact count verification
await expect(howitzerActor).toHaveActivatedAbility(
  "Ability.Slot.Q",
  { times: 1 },
  async () => {
    await howitzerActor.pressKey("Q");
  }
);

Arguments

  • abilitystring
    The ability class path, tag, or name.
  • optionsOrTriggerObject | Function(optional)
    Configuration object { timeout?: number, times?: number } or trigger action callback.
  • triggerActionFunction(optional)
    Action callback to execute while listening for ability activations.

Returns

  • Promise<void>

expect(actor).toBeExecutingAbility

Verifies the actor is currently actively executing a specific Gameplay Ability.

Usage

await expect(hero).toBeExecutingAbility("/Game/Abilities/GA_Ultimate");

Arguments

  • abilityClassPathstring
    The ability class path.

Returns

  • Promise<void>

expect(actor).toHaveAbilityCooldown

Polls the cooldown of a specific ability until it meets the configured operator condition.

Usage

await expect(hero).toHaveAbilityCooldown("/Game/Abilities/GA_Dash", { operator: "<=", expectedValue: 0 });

Arguments

  • abilityClassPathstring
    The ability class path.
  • optionsObject(optional)
    Configuration object: { operator?: string, expectedValue?: number, timeout?: number }.

Returns

  • Promise<void>

expectAll

Executes multiple assertions concurrently and verifies that all conditions pass atomically without race conditions against a synchronized game state snapshot. In the In-Engine Trace Viewer, failures render as an interactive 2D Results Matrix Grid with actor rows, assertion columns, live cell diffs, and aggregate failure diagnostics.

Usage

import { expectAll } from "@specter-automation/test";

// Atomically verify state across multiple actors and systems
await expectAll([
  expect(steelActor).toHaveAttributeValue("HealthSet", "Health", 2000),
  expect(steelActor).toHaveActiveGameplayEffect("GE_ShieldBuff"),
  expect(howitzerActor).toHaveGameplayTag("Cooldown.Ability.Q"),
]);

Arguments

  • assertionsPromise<void>[]
    An array of Specter expect assertion promises to evaluate concurrently.

Returns

  • Promise<void>

Movement & Spatial

Assertions for positioning, physics, and character movement tests.

expect(actor).toBeFalling

Verifies the actor's movement component is currently in a falling state.

Usage

await expect(enemy).toBeFalling();

Returns

  • Promise<void>

expect(actor).toBeCrouching

Verifies the actor's movement component is currently in a crouching state.

Usage

await expect(player).toBeCrouching();

Returns

  • Promise<void>

expect(actor).toBeFlying

Verifies the actor's movement component is currently in a flying state.

Usage

await expect(drone).toBeFlying();

Returns

  • Promise<void>

expect(actor).toHaveVelocity

Verifies the actor's current linear velocity / speed satisfies the comparison criteria.

Usage

// Pass if speed >= 600 cm/s
await expect(playerActor).toHaveVelocity(600);

// Pass if specific bone is moving with high velocity
await expect(playerActor).toHaveVelocity(1200, { boneName: 'weapon_r', operator: '>=' });

Arguments

  • expectedSpeednumber
    The target speed threshold in Unreal Engine units (cm/s).
  • optionsObject(optional)
    • operator'>' | '<' | '>=' | '<=' | '==='(optional)Defaults to '>='
      Comparison operator to evaluate actual physics speed against expectedSpeed.
    • boneNamestring(optional)
      Specific bone or body instance name to query velocity for (e.g. 'hand_r'). Defaults to root primitive component.
    • timeoutnumber(optional)Defaults to 5000
      Time to retry the assertion for in milliseconds. Defaults to timeout in TestConfig.expect.

Returns

  • Promise<void>

expect(actor).toBeWithinDistanceOf

Verifies the actor is within a specific distance of another actor.

Usage

await expect(enemy).toBeWithinDistanceOf(world.actor('Player'), 200);

Arguments

  • otherActorLocatorActorLocator
    The locator of the target actor.
  • maxDistancenumber
    The maximum distance allowed (in cm).

Returns

  • Promise<void>

expect(actor).toBeFacing

Verifies the actor is currently facing towards another actor's location.

Usage

await expect(turret).toBeFacing(world.actor('Player'));

Arguments

  • otherActorLocatorActorLocator
    The locator of the target actor.

Returns

  • Promise<void>

expect(actor).toHaveMovedFurtherThan

A powerful spatial assertion that ensures the actor's 3D location has changed by at least the specified distance from a starting point.

Usage

const startPos = await enemy.getLocation();
await world.console('cheat knockback');

await expect(enemy).toHaveMovedFurtherThan(startPos, 500, { timeout: 8000 });

Arguments

  • startPosVector3
    The starting 3D coordinate.
  • distancenumber
    The minimum distance in Unreal Units (cm) the actor must have moved.
  • optionsObject(optional)
    • timeoutnumber(optional)Defaults to 5000
      Time to retry the assertion for in milliseconds. Defaults to timeout in TestConfig.expect.

Returns

  • Promise<void>

expect(actor).toHaveLocation

Polls the actor's 3D position until it is within the specified tolerance radius of the expected location.

Usage

await expect(enemy).toHaveLocation({ x: 100, y: 200, z: 0 }, 10.0, { timeout: 8000 });

Arguments

  • expectedLocationVector3
    The expected {x, y, z} world coordinate.
  • tolerancenumber(optional)Defaults to 5.0
    The maximum acceptable distance from the target in cm.
  • optionsObject(optional)
    • timeoutnumber(optional)Defaults to 5000
      Time to retry the assertion for in milliseconds. Defaults to timeout in TestConfig.expect.

Returns

  • Promise<void>

Animation & Montages

Assertions for testing attack hitboxes or ability timings.

expect(skeleton).toBePlayingMontage

Verifies the skeletal mesh is actively playing the specified animation montage.

Usage

await expect(heroSkeleton).toBePlayingMontage("/Game/Animations/AM_Attack");

Arguments

  • montageClassPathstring
    The montage class path.

Returns

  • Promise<void>

expect(skeleton).toHaveMontageSection

Verifies the currently playing montage is within a specific named montage section.

Usage

await expect(heroSkeleton).toHaveMontageSection("Recovery");

Arguments

  • expectedSectionstring
    The section name.

Returns

  • Promise<void>

AI & Behavior Trees

Assertions for enemy decision-making, blackboard values, line of sight, and pathfinding navigation.

expect(aiController).toBeRunningBehaviorTree

Verifies the AI controller is actively running the specified Behavior Tree.

Usage

await expect(aiCon).toBeRunningBehaviorTree("/Game/AI/BT_Zombie");

Arguments

  • treeClassPathstring
    The behavior tree class path.

Returns

  • Promise<void>

expect(aiController).toHaveBlackboardValue

Verifies the AI's Blackboard has the expected value for the specified key.

Usage

await expect(aiCon).toHaveBlackboardValue("TargetActor", world.actor('Player'));

Arguments

  • keyNamestring
    The blackboard key name.
  • expectedValueany
    The expected value for the key.

Returns

  • Promise<void>

expect(aiController).toHaveLineOfSightTo

Verifies the AI controller has line of sight to the specified actor.

Usage

await expect(aiCon).toHaveLineOfSightTo(world.actor('Player'));

Arguments

  • otherActorLocatorActorLocator
    The locator of the target actor.

Returns

  • Promise<void>

expect(actor).toBeAINavigating

Verifies the actor's AI Controller is currently navigating along a path (PathFollowingStatus is Moving). Automatically resolves from Pawn to AI Controller. Supports .not negation.

Usage

// Assert AI is navigating towards the player
await expect(aiPawn).toBeAINavigating();

// Assert AI has stopped navigating
await expect(aiPawn).not.toBeAINavigating({ timeout: 10000 });

Arguments

  • optionsObject(optional)
    • timeoutnumber(optional)Defaults to 5000
      Time to retry the assertion for in milliseconds. Defaults to timeout in TestConfig.expect.

Returns

  • Promise<void>

Camera & FOV

Assertions for camera field of view, camera shakes, and view targets.

expect(actor).toHaveCameraFOV

Polls the actor's camera FOV until it matches the expected value within tolerance.

Usage

await expect(player).toHaveCameraFOV(90, { tolerance: 1.0 });

Arguments

  • expectedFOVnumber
    The expected FOV angle in degrees.
  • optionsObject(optional)
    • tolerancenumber(optional)Defaults to 0.5
      Allowed deviation in FOV degrees before failing assertion.
    • timeoutnumber(optional)Defaults to 5000
      Time to retry the assertion for in milliseconds. Defaults to timeout in TestConfig.expect.

Returns

  • Promise<void>

expect(actor).toBeCameraShaking

Verifies the actor's PlayerCameraManager currently has active camera shakes. Supports .not negation.

Usage

// Assert camera is shaking after explosion
await expect(player).toBeCameraShaking();

// Assert camera is NOT shaking after it subsides
await expect(player).not.toBeCameraShaking();

Arguments

  • optionsObject(optional)
    • timeoutnumber(optional)Defaults to 5000
      Time to retry the assertion for in milliseconds. Defaults to timeout in TestConfig.expect.

Returns

  • Promise<void>

expect(actor).toHaveCameraViewTarget

Polls until the actor's camera view target matches the expected actor name.

Usage

await expect(player).toHaveCameraViewTarget('BP_PlayerCharacter');

Arguments

  • actorNamestring
    The expected name of the camera's view target actor.
  • optionsObject(optional)
    • timeoutnumber(optional)Defaults to 5000
      Time to retry the assertion for in milliseconds. Defaults to timeout in TestConfig.expect.

Returns

  • Promise<void>

Controller & Possession

Assertions for verifying Pawn possession, player vs AI control, and local client ownership.

expect(actor).toBePossessed

Asserts that the Pawn is possessed by any active Controller (AI or Human). Supports .not negation.

Usage

// Assert minion is possessed
await expect(minion).toBePossessed();

// Assert vehicle is currently unpossessed / empty
await expect(emptyCar).not.toBePossessed();

Arguments

  • optionsObject(optional)
    • timeoutnumber(optional)Defaults to 5000
      Time to retry the assertion for in milliseconds. Defaults to timeout in TestConfig.expect.

Returns

  • Promise<void>

expect(actor).toBePlayerControlled

Asserts that the Pawn is possessed specifically by a Human/Network PlayerController (excludes AI bot controllers). Supports .not negation.

Usage

// Assert hero is driven by a real player
await expect(playerMarshmallow).toBePlayerControlled();

// Assert minion is driven by AI, not a human player
await expect(aiMinion).not.toBePlayerControlled();

Arguments

  • optionsObject(optional)
    • timeoutnumber(optional)Defaults to 5000
      Time to retry the assertion for in milliseconds. Defaults to timeout in TestConfig.expect.

Returns

  • Promise<void>

expect(actor).toBeLocallyControlled

Asserts that the Pawn is controlled by the local viewport client. Essential for client-server and multi-client multiplayer tests.

Usage

// Assert pawn belongs to the active client connection
await expect(localPlayer).toBeLocallyControlled();

Arguments

  • optionsObject(optional)
    • timeoutnumber(optional)Defaults to 5000
      Time to retry the assertion for in milliseconds. Defaults to timeout in TestConfig.expect.

Returns

  • Promise<void>

expect(actor).toHaveController

Asserts that the Pawn has an attached Controller, and optionally verifies that the Controller class or name matches.

Usage

// Assert attached to specific AI controller class
await expect(boss).toHaveController("BP_BossAIController");

// Assert attached to player controller
await expect(player).toHaveController("BP_MarshmallowPlayerController");

// Verify any controller is attached
await expect(pawn).toHaveController();

Arguments

  • expectedClassstring(optional)
    The expected Controller class name or substring (e.g. 'BP_BossAIController'). If omitted, checks for any attached controller.
  • optionsObject(optional)
    • timeoutnumber(optional)Defaults to 5000
      Time to retry the assertion for in milliseconds. Defaults to timeout in TestConfig.expect.

Returns

  • Promise<void>

Team System

Assertions for the Generic Team Agent Interface.

expect(actor).toHaveTeamId

Polls until the actor's Generic Team ID matches the expected value.

Usage

await expect(player).toHaveTeamId(0);
await expect(spectator).not.toHaveTeamId(1);

Arguments

  • expectedTeamIdnumber
    The expected team ID (255 = NoTeam).
  • optionsObject(optional)
    • timeoutnumber(optional)Defaults to 5000
      Time to retry the assertion for in milliseconds. Defaults to timeout in TestConfig.expect.

Returns

  • Promise<void>

expect(actor).toBeHostileTowards

Verifies the actor's team attitude towards another actor is Hostile. Supports .not negation.

Usage

await expect(player).toBeHostileTowards(enemy);
await expect(player).not.toBeHostileTowards(ally);

Arguments

  • otherActorActorLocator
    The other actor to evaluate attitude towards.
  • optionsObject(optional)
    • timeoutnumber(optional)Defaults to 5000
      Time to retry the assertion for in milliseconds. Defaults to timeout in TestConfig.expect.

Returns

  • Promise<void>

State & Rendering

expect(actor).toHaveCount

Verifies that the locator resolves to exactly the expected number of elements in the engine.

Usage

await expect(world.actor('BP_Minion')).toHaveCount(5);

Arguments

  • expectedCountnumber
    The expected number of matching elements.
  • optionsObject(optional)
    • timeoutnumber(optional)Defaults to 5000
      Time to retry the assertion for in milliseconds. Defaults to timeout in TestConfig.expect.

Returns

  • Promise<void>

expect(actor).toBeVisible

Verifies that the actor's 3D mesh was actively rendered on screen (inside the camera frustum and not completely occluded) on the last frame.

Usage

await expect(world.actor('BP_Minion_Range')).toBeVisible({ onScreen: true, timeout: 10000 });

Arguments

  • optionsObject(optional)
    • onScreenboolean(optional)Defaults to false
      When true, strictly requires the actor's bounding geometry to be visible inside the viewport camera frustum.
    • timeoutnumber(optional)Defaults to 5000
      Time to retry the assertion for in milliseconds. Defaults to timeout in TestConfig.expect.

Returns

  • Promise<void>

expect(actor).toBeInViewport

Verifies that the actor's 3D mesh or UMG widget element is actively rendered inside the active camera viewport frustum.

Usage

await expect(enemy).toBeInViewport();

Arguments

  • optionsObject(optional)
    • timeoutnumber(optional)Defaults to 5000
      Time to retry the assertion for in milliseconds. Defaults to timeout in TestConfig.expect.

Returns

  • Promise<void>

expect(actor).toBeDestroyed

Polls until the targeted actor is destroyed (marked PendingKill, destroyed, or garbage-collected from the UWorld). Supports .not negation to verify the actor remains alive/valid.

Usage

// Assert actor is destroyed after lethal damage
await expect(enemyKeep).toBeDestroyed();

// Assert actor has NOT been destroyed
await expect(player).not.toBeDestroyed();

Arguments

  • optionsObject(optional)
    • timeoutnumber(optional)Defaults to 5000
      Time to retry the assertion for in milliseconds. Defaults to timeout in TestConfig.expect.

Returns

  • Promise<void>

expect(actor).toBeNiagaraActive

Verifies that a Niagara particle system component on the actor is currently active and emitting particles.

Usage

await expect(explosionEffect).toBeNiagaraActive();

Arguments

  • optionsObject(optional)
    • timeoutnumber(optional)Defaults to 5000
      Time to retry the assertion for in milliseconds. Defaults to timeout in TestConfig.expect.

Returns

  • Promise<void>

expect(actor).toHaveNiagaraAsset

Verifies that the actor's Niagara component is set to a specific Niagara system asset path.

Usage

await expect(fireVFX).toHaveNiagaraAsset("NS_Fire_Loop");

Arguments

  • expectedAssetstring
    The expected Niagara system asset path substring.
  • optionsObject(optional)
    • timeoutnumber(optional)Defaults to 5000
      Time to retry the assertion for in milliseconds. Defaults to timeout in TestConfig.expect.

Returns

  • Promise<void>

expect(actor).toBeAudioPlaying

Verifies that an Audio Component attached to the actor is actively playing sound.

Usage

await expect(footstepAudio).toBeAudioPlaying();

Arguments

  • optionsObject(optional)
    • timeoutnumber(optional)Defaults to 5000
      Time to retry the assertion for in milliseconds. Defaults to timeout in TestConfig.expect.

Returns

  • Promise<void>

expect(actor).toHaveSoundAsset

Verifies that the actor's Audio Component is playing a sound asset matching the specified name.

Usage

await expect(bgmAudio).toHaveSoundAsset("SoundWave_BossTheme");

Arguments

  • expectedSoundstring
    The expected sound asset path or name substring.
  • optionsObject(optional)
    • timeoutnumber(optional)Defaults to 5000
      Time to retry the assertion for in milliseconds. Defaults to timeout in TestConfig.expect.

Returns

  • Promise<void>

expect(actor).toBePhysicsSimulating

Verifies that the actor's primitive or skeletal mesh is simulating physics (ragdoll).

Usage

await expect(deadEnemy).toBePhysicsSimulating({ boneName: "pelvis" });

Arguments

  • optionsObject(optional)
    • boneNamestring(optional)
      Specific bone/body instance name to query physics simulation on (e.g. 'pelvis').
    • timeoutnumber(optional)Defaults to 5000
      Time to retry the assertion for in milliseconds. Defaults to timeout in TestConfig.expect.

Returns

  • Promise<void>

expect(actor).toBePhysicsAsleep

Verifies that a rigid body physics object has come to rest and entered a sleeping state.

Usage

await expect(crate).toBePhysicsAsleep();

Arguments

  • optionsObject(optional)
    • boneNamestring(optional)
      Specific bone/body instance name to check sleep state on.
    • timeoutnumber(optional)Defaults to 5000
      Time to retry the assertion for in milliseconds. Defaults to timeout in TestConfig.expect.

Returns

  • Promise<void>

Enhanced Input (UE5)

Assertions for verifying active Input Mapping Contexts and Input Action values.

expect(actor).toHaveInputMappingContext

Verifies that an Enhanced Input Local Player Subsystem has a specific Input Mapping Context (IMC) applied.

Usage

await expect(player).toHaveInputMappingContext("IMC_DefaultPlayer");

Arguments

  • contextNameOrPathstring
    The IMC asset name or path.
  • optionsObject(optional)
    • timeoutnumber(optional)Defaults to 5000
      Time to retry the assertion for in milliseconds. Defaults to timeout in TestConfig.expect.

Returns

  • Promise<void>

expect(actor).toHaveInputActionValue

Verifies the current value of an Enhanced Input Action (IA).

Usage

await expect(player).toHaveInputActionValue("IA_Sprint", true);

Arguments

  • actionNameOrPathstring
    The Input Action name or path.
  • expectedValueany
    The expected action value (boolean, float, or Vector3).
  • optionsObject(optional)
    • timeoutnumber(optional)Defaults to 5000
      Time to retry the assertion for in milliseconds. Defaults to timeout in TestConfig.expect.

Returns

  • Promise<void>

expect(actor).toHavePlayerScore

Verifies the player's current score on their PlayerState.

Usage

await expect(player).toHavePlayerScore(100, { operator: ">=" });

Arguments

  • expectedScorenumber
    The expected score threshold.
  • optionsObject(optional)
    • operator'>' | '<' | '>=' | '<=' | '==='(optional)Defaults to '>='
      Comparison operator to evaluate actual score against expectedScore.
    • timeoutnumber(optional)Defaults to 5000
      Time to retry the assertion for in milliseconds. Defaults to timeout in TestConfig.expect.

Returns

  • Promise<void>

UI & Widgets

Assertions for validating player HUDs or Menus.

expect(widget).toBeVisible

Directly queries the Slate rendering pipeline. Bypasses blueprint state and verifies if the widget was actively drawn to the screen on the last frame without occlusion.

Usage

const modal = world.widget("ConfirmPurchaseModal");
await expect(modal).toBeVisible();

Arguments

  • optionsObject(optional)
    • timeoutnumber(optional)Defaults to 5000
      Time to retry the assertion for in milliseconds. Defaults to timeout in TestConfig.expect.

Returns

  • Promise<void>

expect(widget).toBeEnabled

Verifies if the Slate widget is interactable (not disabled).

Usage

const submitBtn = world.widget("SubmitButton");
await expect(submitBtn).toBeEnabled();

Arguments

  • optionsObject(optional)
    • timeoutnumber(optional)Defaults to 5000
      Time to retry the assertion for in milliseconds. Defaults to timeout in TestConfig.expect.

Returns

  • Promise<void>

expect(widget).toHaveText

Polls the UTextBlock or URichTextBlock widget until its visible text matches the expected string.

Usage

const title = world.widget("HeaderTitle");
await expect(title).toHaveText("Main Menu");

Arguments

  • expectedTextstring | RegExp
    The exact expected text string or RegExp pattern.
  • optionsObject(optional)
    • timeoutnumber(optional)Defaults to 5000
      Time to retry the assertion for in milliseconds. Defaults to timeout in TestConfig.expect.

Returns

  • Promise<void>

expect(widget).toContainText

Polls the UTextBlock or URichTextBlock widget until its text contains the specified substring.

Usage

const subtitle = world.widget("WBP_Modal").getChild("SubtitleText");
await expect(subtitle).toContainText("cannot be undone");

Arguments

  • substringstring
    The substring to search for within the widget text.
  • optionsObject(optional)
    • timeoutnumber(optional)Defaults to 5000
      Time to retry the assertion for in milliseconds. Defaults to timeout in TestConfig.expect.

Returns

  • Promise<void>

expect(widget).toHaveValue

Polls the UEditableText or UEditableTextBox widget until its input value matches the expected string.

Usage

const usernameInput = world.widget("WBP_Login").getChild("UsernameInput");
await expect(usernameInput).toHaveValue("Player1");

Arguments

  • expectedValuestring
    The expected input string value.
  • optionsObject(optional)
    • timeoutnumber(optional)Defaults to 5000
      Time to retry the assertion for in milliseconds. Defaults to timeout in TestConfig.expect.

Returns

  • Promise<void>

Materials & Visuals

Assertions for verifying Material assignments, Dynamic Material Instances (MIDs), and polling material scalar, vector, and texture parameters. Supported on both Actors and UMG Widgets.

expect(locator).toHaveMaterialScalarParameter

Asserts on float/scalar material parameters (e.g., Dissolve, Opacity, HitFlash, Health Percent). Automatically traverses nested UMG containers to locate the assigned Image/Border.

Usage

await expect(healthImage).toHaveMaterialScalarParameter('Percent', 0.5, { operator: '<=' });

Arguments

  • parameterNamestring
    The name of the scalar parameter in the material.
  • expectedValuenumber
    The expected float value.
  • optionsObject(optional)
    • operator'>' | '<' | '>=' | '<=' | '===' | '!='(optional)Defaults to '==='
      The logical operator to evaluate.
    • tolerancenumber(optional)Defaults to 0.001
      Epsilon tolerance for floating point comparisons.
    • slotIndexnumber(optional)Defaults to 0
      The material slot index to inspect.
    • componentNamestring(optional)
      If inspecting an Actor, the specific primitive component name to query. If omitted, uses the root mesh.
    • timeoutnumber(optional)Defaults to 5000
      Time to retry the assertion in milliseconds.

Returns

  • Promise<void>

expect(locator).toHaveMaterialVectorParameter

Asserts on vector/color material parameters (e.g., TeamColor, GlowColor). Supports Hex strings, arrays, or objects.

Usage

await expect(shield).toHaveMaterialVectorParameter('GlowColor', '#00FFCC');

Arguments

  • parameterNamestring
    The name of the vector parameter in the material.
  • expectedColorstring | number[] | {r,g,b,a?}
    The expected color (e.g. '#FF0000', [1,0,0,1], {r:1,g:0,b:0}).
  • optionsObject(optional)
    • tolerancenumber(optional)Defaults to 0.01
      Epsilon tolerance for per-channel float comparisons.
    • slotIndexnumber(optional)Defaults to 0
      The material slot index.
    • componentNamestring(optional)
    • timeoutnumber(optional)Defaults to 5000

Returns

  • Promise<void>

expect(locator).toHaveMaterial

Verifies which material asset is assigned to a slot.

Usage

await expect(terrain).toHaveMaterial('M_Snow');

Arguments

  • expectedMaterialstring | RegExp
    The name of the material to expect (e.g. 'M_Frozen_Ice' or /^M_Hero_/).
  • optionsObject(optional)
    • slotIndexnumber(optional)Defaults to 0
    • componentNamestring(optional)
    • timeoutnumber(optional)Defaults to 5000

Returns

  • Promise<void>

expect(locator).toBeDynamicMaterial

Asserts that the material at the specified slot is a UMaterialInstanceDynamic (MID). Useful for catching bugs where CreateDynamicMaterialInstance() was forgotten.

Usage

await expect(healthBarImage).toBeDynamicMaterial();

Arguments

  • optionsObject(optional)
    • slotIndexnumber(optional)Defaults to 0
    • componentNamestring(optional)
    • timeoutnumber(optional)Defaults to 5000

Returns

  • Promise<void>

expect(locator).toHaveMaterialTextureParameter

Asserts that a specific UTexture asset is bound to a texture parameter (e.g. Player portraits, custom emblems, render targets).

Usage

await expect(emblem).toHaveMaterialTextureParameter('Icon', 'T_Skull');

Arguments

  • parameterNamestring
    The name of the texture parameter.
  • expectedTexturestring | RegExp
    The expected texture name.
  • optionsObject(optional)
    • slotIndexnumber(optional)Defaults to 0
    • componentNamestring(optional)
    • timeoutnumber(optional)Defaults to 5000

Returns

  • Promise<void>

Visual Assertions

Perceptual pixel comparison assertions integrated directly with Playwright snapshot testing (__snapshots__). Catch broken shaders, missing models, animation pops, and VFX glitches that functional logic tests miss.

expect(world).toMatchScreenshot

Captures the current viewport frame and asserts it matches the golden reference snapshot within configurable perceptual tolerances.

Usage

// Wait for impact visual and assert against golden snapshot
await expect(world).toMatchScreenshot("steel_shield_slam_impact.png", {
  threshold: 0.15,         // 15% color perception threshold
  maxDiffPixelRatio: 0.02, // Allow up to 2% differing pixels
  showUI: false,           // Ignore HUD/UMG overlays
  timeout: 2000,           // Retries until visual stabilizes
});

Arguments

  • snapshotNamestring
    The name of the snapshot file (e.g. 'steel_shield_slam_impact.png').
  • optionsObject(optional)
    • thresholdnumber(optional)Defaults to 0.2
      Perceptual color difference threshold between 0 (strict) and 1 (lenient).
    • maxDiffPixelRationumber(optional)
      Acceptable ratio of differing pixels between 0 and 1 (e.g. 0.02 for 2%).
    • maxDiffPixelsnumber(optional)
      Absolute maximum count of differing pixels allowed.
    • showUIboolean(optional)Defaults to false
      Whether to include Slate/UMG viewport overlays in the capture.
    • timeoutnumber(optional)Defaults to 5000
      Time in milliseconds to poll and retry for visual stabilization.

Returns

  • Promise<void>

Performance Budget Assertions

Enforce FPS thresholds, frame time spike ceilings, and memory consumption guardrails directly in CI gameplay tests.

expect(world).toMaintainPerformanceBudget

Samples engine performance over a designated time window and asserts that minimum FPS, maximum frame time spikes, and memory limits are strictly honored.

Usage

// Enforce a strict 60 FPS performance budget during ultimate VFX
await expect(world).toMaintainPerformanceBudget({
  minFps: 60,
  maxFrameTimeMs: 16.6,
  maxMemoryMb: 4096,
  sampleDurationSec: 5.0,
});

Arguments

  • budgetObject
    Performance budget parameters: { minFps?: number, maxFrameTimeMs?: number, maxMemoryMb?: number, sampleDurationSec?: number }.

Returns

  • Promise<void>

expect(world).toHaveFPS

Polls engine performance metrics until the instantaneous or smoothed frame rate meets the target threshold.

Usage

// Assert viewport maintains at least 60 FPS
await expect(world).toHaveFPS(60, { operator: ">=" });

Arguments

  • expectedFpsnumber
    Target frame rate threshold in frames per second.
  • optionsObject(optional)
    Configuration object: { operator?: '>=' | '<=' | '>', timeout?: number }.

Returns

  • Promise<void>

expect(world).toHaveFrameTimeBelow

Asserts that the engine's frame time (delta seconds in milliseconds) remains below the specified spike ceiling.

Usage

// Catch hitches and frame spikes exceeding 16.6ms
await expect(world).toHaveFrameTimeBelow(16.6);

Arguments

  • maxFrameTimeMsnumber
    Maximum allowable frame time in milliseconds (e.g. 16.6ms for 60 FPS, 33.3ms for 30 FPS).
  • optionsObject(optional)
    Configuration object with timeout.

Returns

  • Promise<void>