Hi all,
So I’m trying to make a custom automated test that will open up all the maps that are located in a plugin in my project. But after implmenting the complex automated test I’m not able to see it under the Automation tab in the Session Frontend window. This is the code for the test:
IMPLEMENT_COMPLEX_AUTOMATION_TEST(FLoadAllMapsInGameTest, "Maps.LoadAllInGame", EAutomationTestFlags::EditorContext | EAutomationTestFlags::EngineFilter)
void FLoadAllMapsInGameTest::GetTests(TArray<FString>& OutBeautifiedNames, TArray <FString>& OutTestCommands) const
{
TArray<FString> FileList;
FString ProjectDirectory = FPaths::ProjectPluginsDir();
const FString extension = FPackageName::GetMapPackageExtension();
IFileManager::Get().FindFiles(FileList, *ProjectDirectory, *extension);
OutBeautifiedNames.Add(FString("Butts"));
OutTestCommands.Add(FString("Butts2"));
// Iterate over all files, adding the ones with the map extension..
for (int32 FileIndex = 0; FileIndex < FileList.Num(); FileIndex++)
{
const FString& Filename = FileList[FileIndex];
OutBeautifiedNames.Add(FPaths::GetBaseFilename(Filename));
OutTestCommands.Add(Filename);
}
}
bool FLoadAllMapsInGameTest::RunTest(const FString& Parameters)
{
FString MapName = Parameters;
UE_LOG(LogTemp, Error, TEXT("Running All maps in Game Test..."))
AutomationOpenMap(MapName);
ADD_LATENT_AUTOMATION_COMMAND(FEnqueuePerformanceCaptureCommands());
return true;
}
Note: This was added to have something in those arrays, but even that didn’t make the test appear.
OutBeautifiedNames.Add(FString("Butts"));
OutTestCommands.Add(FString("Butts2"));
Does anyone know why this isn’t showing up?
Also I’m not sure if this line will actually get me all the map files within my plugin, please tell me if you have a better idea of how to get all the maps inside a plugin.
TArray<FString> FileList;
FString ProjectDirectory = FPaths::ProjectPluginsDir();
const FString extension = FPackageName::GetMapPackageExtension();
IFileManager::Get().FindFiles(FileList, *ProjectDirectory, *extension);
Also I have implemented the simple automated test “Placeholder test” found here: Automation Technical Guide | Unreal Engine Documentation
So I believe that my automated test plugin is set up correctly.
If you can help me out, that would be great!
-London