Search Unity

  1. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

Resolved Loading a test scene without adding it to build settings

Discussion in 'Testing & Automation' started by Xtro, Nov 3, 2019.

  1. Xtro

    Xtro

    Joined:
    Apr 17, 2013
    Posts:
    382
    Hello.

    Can I load a test scene during test setup without adding it to build settings scene list?

    because why would I want to add test scenes to build settings...
     
    vestigial likes this.
  2. liortal

    liortal

    Joined:
    Oct 17, 2012
    Posts:
    3,445
    Are you talking about play mode tests? In the Unite Copenhagen talk, they showed you to pre-process your builds and add scenes that will only get included when building the game for testing -
     
  3. Xtro

    Xtro

    Joined:
    Apr 17, 2013
    Posts:
    382
    Thank you @liortal

    With the help of Superpig on Unity Slack channel (he's the person in that video)
    I ended up doing this but I had to upgrade to 2018.4.x version first.

    Code (CSharp):
    1.     [UnitySetUp]
    2.     public IEnumerator SetUp()
    3.     {
    4.         yield return EditorSceneManager.LoadSceneAsyncInPlayMode($"{ScenePath}.unity", new LoadSceneParameters(LoadSceneMode.Additive));
    5.     }
    6.  
    7.     [UnityTearDown]
    8.     public IEnumerator TearDown()
    9.     {
    10.         yield return SceneManager.UnloadSceneAsync(ScenePath);
    11.     }
    12.  
     
  4. liortal

    liortal

    Joined:
    Oct 17, 2012
    Posts:
    3,445
    nice. what slack channel are u talking about ?
     
  5. Xtro

    Xtro

    Joined:
    Apr 17, 2013
    Posts:
    382
    unitydevs.slack.com
     
  6. liortal

    liortal

    Joined:
    Oct 17, 2012
    Posts:
    3,445
    do i need an invitation ?
     
  7. APSchmidt

    APSchmidt

    Joined:
    Aug 8, 2016
    Posts:
    3,793
    The page specifies "If you have an @cmune.com or @unity3d.com email address, you can create an account."

    Edit: ... but it's litterally having an account at Unity3D.com, with an email address at Unity3D.com, username@unity3d.com...

    I guess it's a very private club and apparently it's not free either.
     
  8. Xtro

    Xtro

    Joined:
    Apr 17, 2013
    Posts:
    382
    Wait no! I don't remember how I joined exactly but it was public for sure. There was an announcement about it years ago or something like that.
     
  9. APSchmidt

    APSchmidt

    Joined:
    Aug 8, 2016
    Posts:
    3,793
    How do you create an emai address at unity3d.com?
     
  10. Xtro

    Xtro

    Joined:
    Apr 17, 2013
    Posts:
    382
    I didn't. I am using my personal email to Unity Slack.
     
  11. superpig

    superpig

    Quis aedificabit ipsos aedificatores? Unity Technologies

    Joined:
    Jan 16, 2011
    Posts:
    4,342
  12. APSchmidt

    APSchmidt

    Joined:
    Aug 8, 2016
    Posts:
    3,793
  13. superpig

    superpig

    Quis aedificabit ipsos aedificatores? Unity Technologies

    Joined:
    Jan 16, 2011
    Posts:
    4,342
    Everyone is welcome :)

    Just to clarify: It's in no way an official thing, it is not endorsed by Unity Technologies, etc.
     
    APSchmidt likes this.
unityunity