-
Notifications
You must be signed in to change notification settings - Fork 65
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Help with parameterized tests #11
Comments
Hey @tyler-pugmire. are you able to cast the parameter? Or is the parameter invalid immediately at the beginning of Act? Also, can you confirm that the example parametrized tests of the plugin are working (just to rule out a regression in the plugin itself)? You might need to enable "Show plugin content" for your content browser to see them. |
Yeah the example tests work as far as I can tell. Running the tests again this morning the parameters are valid just can't be casted back to original type. Using this test I tried a couple different parameter types. Both of these are child blueprints of BP_Move_Params which inherits from Object. With these params the output of the test looked like
I then tried with just BP_Move_Params which inherits from Object and got the following output.
|
I too am having the same issue, though I believe it is two separate issues. The first issue is that, when I load up the editor, if I already had my parameters set in my test, the Parameter.IsValid check always fails and returns nullptr. If I remove my parameter and add it back then run the test, the parameter loads fine. The second half of this is that I do not seem to be able to cast my parameters UObject to my Parameter subclass. It seems that the parameter reference is not a UObject reference but actually a UBlueprint reference. |
I am having the same casting problems. Did you find solutions? Thanks. |
Ok for the parameter casting problem I found a great article explaining why. https://1danielcoelho.github.io/unreal-engine-basics-base-classes/ As a solution I created a function that gets the CDO from the GeneratedClass to access the "value" members via GetValue(). FString ADaeTestActor::GetStringValueFromParameter(UObject* loadedBP) |
Hello, my team is looking to use this plugin for automated tests. I've been looking at the parameterized tests and may be misunderstanding how to use them.
I'll use a movement test as an example of how I picture them working:
BP_MoveTest: The test blueprint will apply InputAxis based on parameters provided and use a trigger box to confirm.
BP_MoveParams: Base class for parameters inherited from Object.
BP_MoveForwardParams: Inherits from BP_MoveParams providing correct parameters to test moving forward. This would be a parameter added to an instance of BP_MoveTest
BP_MoveRightParams: Similar to BP_MoveForwardParams but for moving right
After trying it this way it appears to not be correct as the parameters passed to the test won't be valid. Your examples use 2 different blueprint classes both inherited from Object, but only use display name as a difference between the tests. I am struggling to figure out how you would retrieve data from the parameter object.
It's been a while since I've used Unreal so probably something obvious that I'm missing. Thanks for any help.
The text was updated successfully, but these errors were encountered: