Hey! I have some weird suggestions:
A. Can you run this functional test from the SessionFrontend menu in the UnrealEditor?
B. You mentioned the FuntionalTest has EAutomationTest flags. Those flags are for use in AutomationTests (Unit Tests), and not FunctionalTests (Integration Tests). To define an automation test, you need to use a maco, and then implement the RunTest function in the class that macro defines for you.
`IMPLEMENT_SIMPLE_AUTOMATION_TEST(FMyAutomationTestWhichAlwaysPasses, “Project.MyAutomationTests.This test always passes”,
EAutomationTestFlags::EditorContext | EAutomationTestFlags::ProductFilter)
bool FMyAutomationTestWhichAlwaysPasses::RunTest(const FString& Parameteres)
{
return true;
}`
In order to make a CPP functional test, it should likely be in its own file, and then you inherit from it to make a BP object, which is then placed into a game world.
`#pragma once
include <CoreMinimal.h>
include <FunctionalTest.h>
// this has to come last
include “MyFunctionalTestBase.generated.h”
// also declare a log category so you don’t have to use LogTemp
MYPROJECT_API DECLARE_LOG_CATEGORY_EXTERN(LogMyFunctionalTest, Log, All)
// in ONE cpp file, you add
// DEFINE_LOG_CATEGORY(LogMyFunctionalTest)
//
// Then you can log with:
// UE_LOG(LogMyFunctionalTest, Warning, TEXT(“This is the name of some actor: %s”), *AActor::Name);
UCLASS()
class AMyFunctionalTestBase
{
GENERATED_BODY()
// this is called for every test at the same time, when BeginPlay is called
virtual void BeginPlay() override;
// this is for loading and stuff
virtual void PrepareTest() override;
// this is called when a specific instance of this test is allowed to begin
virtual void StartTest() override;
// before a test “starts”, the test framework will give it a chance to being loading
// periodically, it will call AFunctionalTest::IsReady, and if that fn returns true,
// then the test is allowed to proceed. You can use this mechanism to enforce some
// amount of loading time
virtual bool IsReady_Implementation() override { return true; }
// most of an integration test will happen in the tick fn, but if you
// can finish “on the first frame”, then you can probably put all your code in StartTest
virtual void Tick(float deltaTime_s) override;
// after the test ends, ie: after you call FinishTest
// this is a good place to clean up stuff
virtual void CleanUp() override;
}`Sorry if the above is all obvious recap.
C. Does anything change if you capitalize the runtest parameter to say “-RunTest=MyFunctionalTest”
D. Is your packaged build in the `…\UE5\<Project>\Saved\StagedBuilds\<Platform>` directory? (I’ve found it behaves badly anywhere else)
E. When you take your FunctionalTest and place it in a level (extra work if it’s a world partition level), are you taking the name of that specific object from the level, and using that name to launch the test?
ie: if you put your MyFunctionalTest in a map, and renamed it (“LoadTest”, for instance), are you then using “LoadTest” when you try to launch the test, or are you still using “MyFunctionalTest”?
Also, good luck! There’s a lot of process-of-elimination with this system.