Automation Test Delay after latent command

I’m having a hard time figuring out how to write this particular automation test. The basic flow is:

  • Store map of actors in TMap X
  • Travel to Map 2
  • Travel back to Map 1
  • Store map of actors in TMap Y
  • Compare TMap X & TMap Y

My problem is that to travel to system Y/X I am using a latent automation command:
ADD_LATENT_AUTOMATION_COMMAND(FWarpToSystem(FString("/Game/Maps/System2")));

The problem is that once I run one latent command, I can’t run anything else besides latent commands in the test (because subsequent code executes before the latent command finishes). Because the latent commands don’t allow TestTrue/TestEqual I can’t encapsulate the final testing in a latent command.

What is a better way of doing this?

Could you create a custom latent command that waits for a specific condition? E.g. FWaitForMatineeToCompleteLatentCommand in AutomationTestCommon.cpp

In your case it could be waiting until Warping to System2 is complete.

I’m working on something similar right now and realized my original answer doesn’t help. You should be able to pass the FAutomationTestBase* to your latent command so you can use the TestTrue/TestEqual() functions. E.g.

DEFINE_LATENT_AUTOMATION_COMMAND_ONE_PARAMETER(FMyLatentCommand, FAutomationTestBase*, Test);
bool FMyLatentCommand::Update()
{
check(Test);
Test->TestFalse(TEXT(“Verifying a false condition”), AreMyActorsVisible());
return true;
}

1 Like