| | 1 | | using System.Collections; |
| | 2 | | using DCL.Components; |
| | 3 | | using DCL.Helpers; |
| | 4 | | using DCL.Models; |
| | 5 | | using NUnit.Framework; |
| | 6 | | using UnityEngine; |
| | 7 | | using UnityEngine.TestTools; |
| | 8 | | using UnityGLTF; |
| | 9 | |
|
| | 10 | | public class GLTFImporterVisualTests : VisualTestsBase |
| | 11 | | { |
| | 12 | | [UnityTest] |
| | 13 | | [VisualTest] |
| | 14 | | [Explicit] |
| | 15 | | [Category("Explicit")] |
| 0 | 16 | | public IEnumerator ProcessTextureOffsetAndScale_Generate() { yield return VisualTestHelpers.GenerateBaselineForTest( |
| | 17 | |
|
| | 18 | | [UnityTest] |
| | 19 | | [VisualTest] |
| | 20 | | [Category("Explicit")] |
| | 21 | | [Explicit] |
| | 22 | | public IEnumerator ProcessTextureOffsetAndScale() |
| | 23 | | { |
| 0 | 24 | | yield return InitVisualTestsScene("GLTFImporterVisualTests_ProcessTextureOffsetAndScale"); |
| | 25 | |
|
| 0 | 26 | | GLTFShape gltfShape = TestHelpers.CreateEntityWithGLTFShape(scene, Vector3.zero, TestAssetsUtils.GetPath() + "/G |
| | 27 | |
|
| 0 | 28 | | yield return gltfShape.routine; |
| 0 | 29 | | yield return new WaitForAllMessagesProcessed(); |
| 0 | 30 | | yield return new WaitUntil(() => GLTFComponent.downloadingCount == 0); |
| | 31 | |
|
| 0 | 32 | | Vector3 camPos = new Vector3(0f, 2f, 5f); |
| 0 | 33 | | Vector3 camTarget = new Vector3(7.5f, 0f, 10f); |
| | 34 | |
|
| 0 | 35 | | VisualTestHelpers.RepositionVisualTestsCamera(VisualTestController.i.camera, camPos, camTarget); |
| 0 | 36 | | yield return new WaitForAllMessagesProcessed(); |
| | 37 | |
|
| 0 | 38 | | yield return VisualTestHelpers.TakeSnapshot(); |
| 0 | 39 | | } |
| | 40 | |
|
| | 41 | | [UnityTest] |
| | 42 | | [VisualTest] |
| | 43 | | [Explicit] |
| | 44 | | [Category("Explicit")] |
| 0 | 45 | | public IEnumerator ProcessTexturesUVs_Generate() { yield return VisualTestHelpers.GenerateBaselineForTest(ProcessTex |
| | 46 | |
|
| | 47 | | [UnityTest] |
| | 48 | | [VisualTest] |
| | 49 | | [Category("Explicit")] |
| | 50 | | [Explicit] |
| | 51 | | public IEnumerator ProcessTexturesUVs() |
| | 52 | | { |
| 0 | 53 | | yield return InitVisualTestsScene("GLTFImporterVisualTests_ProcessTexturesUVs"); |
| | 54 | |
|
| 0 | 55 | | GLTFShape gltfShape = TestHelpers.CreateEntityWithGLTFShape(scene, Vector3.zero, TestAssetsUtils.GetPath() + "/G |
| | 56 | |
|
| 0 | 57 | | yield return gltfShape.routine; |
| 0 | 58 | | yield return new WaitForAllMessagesProcessed(); |
| 0 | 59 | | yield return new WaitUntil(() => GLTFComponent.downloadingCount == 0); |
| | 60 | |
|
| 0 | 61 | | Vector3 camPos = new Vector3(0f, 2f, 5f); |
| 0 | 62 | | Vector3 camTarget = new Vector3(7.5f, 0f, 10f); |
| | 63 | |
|
| 0 | 64 | | VisualTestHelpers.RepositionVisualTestsCamera(VisualTestController.i.camera, camPos, camTarget); |
| 0 | 65 | | yield return new WaitForAllMessagesProcessed(); |
| | 66 | |
|
| 0 | 67 | | yield return VisualTestHelpers.TakeSnapshot(); |
| 0 | 68 | | } |
| | 69 | | } |