Automated Tests for editor utility widgets?

Hi, I’m new to UE and I wanted to try to develop it while using automated tests, sort of a TDD. So Im trying to build a Visual Novel and after researching about the data storage, I decided to use DataAssets for a Chapter and DialogueNode. But as it can be overwhelming for non-programmers, I also decided to build alongside an editor tool to manage the data.

I have managed to set up an Edito Utility Widget, where we will be able to select a chapter, show it and edit.

Right now it searches all DataAssets of type Chapter to the combo box and shows the selected one to the other text, and when you click on Create New, it creates a new DA Chapter and saves it to the Content Browser and selects it.

I tried to do my first Editor Utility Test as follows:



But it just fails because the editor widget does not have a World all components inside the editor widget are None.

I have tried to search anything similar but I failed. Anyone knows what could cause this?

What class is Event Prepare Test in?
In my case it works if it is in Data Asset (I don’t know why, but this works too) and it works if it is in Editor Utility Widget.

Basically, you need a main widget for your editor (Utility Widget) from which all other widgets (tabs) will be created.
You need to open it through the context menu of the Utility Widget asset (Run Editor Utility Widget item).
You also can create a tab using Blueprint using the Editor Utility Subsystem → Spawn And Register Tab function.

The tests are in Editor Utility Blueprint derived from class Editor Utility Test.

The Editor tool that I created (EUW_ChapterEditor) is an Editor Utility Widget that I am constructing at the Prepare Test. To normal use, I use the Run Editor Utility Widget.

As for Editor Utilty Tests on Widgets, I cant see the option to create those
image

I have widget objects created correctly (using construct object function), but AddToViewport does not work in the editor (and it should not).
As I said above - to create a new Utility Widget via Blueprint you need to use Editor Utility Subsystem → Spawn And Register Tab.

Or instead of AddToViewport you need to add the created widget to the Utility Widget slot (overlay, canvas etc.) that is already on the screen.

Thank you, it worked!

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.