x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

How do I get a custom Complex Automation Test to show up in session frontend?

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: https://docs.unrealengine.com/en-us/Programming/Automation/TechnicalGuide So I believe that my automated test plugin is set up correctly.

If you can help me out, that would be great!

-London

Product Version: UE 4.21
Tags:
more ▼

asked Apr 22 '19 at 11:50 PM in C++ Programming

avatar image

LDOGLONDON
105 5 7 8

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

2 answers: sort voted first

I got them to work, I think the problem was that I wasn't including somthing in my plugins build.cs file, maybe? But I basically copied EditorTest.Build.cs and EditorTest.cpp/h and was able to get the complex automation test working.

more ▼

answered Apr 24 '19 at 05:05 PM

avatar image

LDOGLONDON
105 5 7 8

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

Hi London!

The Automation TechnicalGuide is still out of date, I think. I have a tutorial on AutomationTesting on my blog, which you may want to check out instead: https://blog.squareys.de/ue4-automation-testing

Try adding EAutomationTestFlags::ClientContext.

Cheers, Jonathan

more ▼

answered Apr 23 '19 at 09:41 AM

avatar image

Squareys
106 2 7 8

avatar image LDOGLONDON Apr 23 '19 at 07:16 PM

Hey Jonathan,

Thanks for the comment. I used your post to make my test plugin and got the IMPLEMENT_SIMPLE_AUTOMATION_TEST to work and show up, but so far I haven't been able to get the IMPLEMENT_COMPLEX_AUTOMATION_TEST working. I tried adding

EAutomationTestFlags::ClientContext

but that didn't help. Thanks tho

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question