Hi, I am looking into functional testing features provided in unreal engine. I setup a very basic functional test which uses the ‘Take Automation Screenshot of UI’ function to capture the screenshot of the viewport and compare it with the golden. Sounds fun!
However, I ran into some problems and found some solutions but checking if other people have solved it differently.
- This function disregards the resolution and some other options that are provided as input to this function. Some documentation around it would have been easier than reading the c++ code.
- My test kept failing because it was taking the screenshot with different resolution on each run. This function takes the screenshot from the actual viewport, unlike the other functions of this category which use a camera instead. It turned out to be a bug in unreal which changes the viewport size of ‘play in editor’ window with each run. The solution is to set a viewport resolution for PIE in editor settings and check the ‘always center …’ setting.
I am hoping that there should be some way of setting up the PIE viewport resolution right from the test or level itself?