Пример #1
0
        public IEnumerator UnloadSceneTearDown()
        {
            SceneManager.sceneUnloaded += OnSceneUnloaded;

            sceneUnloaded = false;

            SceneManager.UnloadSceneAsync("1");

            while (!sceneUnloaded)
            {
                yield return(null);
            }

            PermittedErrors.ClearAll();
        }
Пример #2
0
        public IEnumerator TestMakeScreenshotDontFail()
        {
            string expectedWarning = "Screenshot comparing fail was ignored: " +
                                     "can't find reference screen shot with path: ReferenceScreenshots/resolution_750_1334/TestMakeScreenshotDontFail/reference to compare it with screen shot: test";
            var waiter = AsyncWait.StartWaitingForLog(expectedWarning,
                                                      LogType.Warning);

            yield return(Interact.MakeScreenshotAndCompare("test", "reference", 0.9f,
                                                           true));

            yield return(waiter);

            string expectedError = "Screenshot equals failed: \n" +
                                   "can't find reference screen shot with path: ReferenceScreenshots/resolution_750_1334/TestMakeScreenshotDontFail/reference to compare it with screen shot: test";

            PermittedErrors.Add(expectedError);
            waiter = AsyncWait.StartWaitingForLog(expectedError, LogType.Error);
            Interact.FailIfScreenShotsNotEquals();
            yield return(waiter);
        }
        private void ApplicationOnLogMessageReceived(string condition, string stackTrace, LogType logType)
        {
            if (!isRunning)
            {
                return;
            }
            logSaver.Write(condition, stackTrace);
            if (logType == LogType.Exception || logType == LogType.Error)
            {
                if (PermittedErrors.IsPermittedError(condition, stackTrace))
                {
                    return;
                }

                StopTestCoroutine();
                if (CurrentPlayingMethodNode.Node != null)
                {
                    exceptionThrown = true;
                    testInfoData.AddFailed(CurrentPlayingMethodNode.Node.FullName,
                                           condition + "   " + stackTrace);
                }
            }
        }