Search Unity

Question TestFramework other than unity TestFramework?

Discussion in 'Testing & Automation' started by unity_E5ECC49163B1A7AB5D3B, May 1, 2023.

  1. unity_E5ECC49163B1A7AB5D3B

    unity_E5ECC49163B1A7AB5D3B

    Joined:
    Apr 11, 2023
    Posts:
    3
    Hi, Just started working on VR application, could you guys suggest me on best way to get my VR testcases automated other than unityTestFramework?
     
  2. CodeSmile

    CodeSmile

    Joined:
    Apr 10, 2014
    Posts:
    5,882
    You'd have to write a class library with NO references to UnityEngine/UnityEditor, then you could use NUnit, xUnit, etc. from within your IDE.

    But as soon as you use any of the Unity API you will have to use the TestRunner, and TestRunner only.

    Alternatively you'd have to mock up every Unity API that you are calling using interfaces/mock objects. But even so you would not be able to test anything that progresses over time such as coroutines or physics.

    Why are you asking?
    If it's because of slow test runs, see this thread:
    https://forum.unity.com/threads/uni...-is-minimized-or-the-screen-is-locked.702209/
     
  3. unity_E5ECC49163B1A7AB5D3B

    unity_E5ECC49163B1A7AB5D3B

    Joined:
    Apr 11, 2023
    Posts:
    3
    Thank you for the answers! Reason why i'm asking, I'm coming from web application testing background where we can use extendedReports to report our automation test results. Not seeing that here, is there any way to report my test results than just seeing greentick inthe testRunner.
     
  4. CodeSmile

    CodeSmile

    Joined:
    Apr 10, 2014
    Posts:
    5,882
    You'll want to try the Code Coverage package.

    Personally I'm just using dotCover now, a (paid) plugin for Rider. Both support running Unity TestRunner tests from within the IDE albeit I currently am seeing slowdown issues and have reported several bugs.

    There are other solutions as well, if you don't mind the hefty price tag NDepend is a powerful tool that will analyze test run coverage and provide you with plenty of info.
     
  5. unity_E5ECC49163B1A7AB5D3B

    unity_E5ECC49163B1A7AB5D3B

    Joined:
    Apr 11, 2023
    Posts:
    3
    Thanks. I'll see if its fit my requirement.
     
  6. sbergen

    sbergen

    Joined:
    Jan 12, 2015
    Posts:
    53