protected static void RunGameTest(GameTestBase game) { game.CurrentTestContext = TestContext.CurrentContext; game.ScreenShotAutomationEnabled = !ForceInteractiveMode; GameTester.RunGameTest(game); var failedTests = new List <string>(); if (game.ScreenShotAutomationEnabled) { foreach (var testName in game.FrameGameSystem.TestNames) { if (!ImageTester.RequestImageComparisonStatus(testName)) { failedTests.Add(testName); } } } if (failedTests.Count > 0) { Assert.Fail($"Some image comparison tests failed: {string.Join(", ", failedTests.Select(x => x))}"); } }
protected static void RunGameTest(GameTestBase game) { game.CurrentTestContext = TestContext.CurrentContext; game.ScreenShotAutomationEnabled = !ForceInteractiveMode; GameTester.RunGameTest(game); if (game.ScreenShotAutomationEnabled) { Assert.IsTrue(ImageTester.RequestImageComparisonStatus(game.CurrentTestContext.Test.FullName), "The image comparison returned false."); } }
/// <summary> /// Send the data of the test to the server. /// </summary> /// <param name="image">The image to send.</param> /// <param name="testName">The name of the test.</param> public void SendImage(Image image, string testName) { var currentVersion = CurrentVersion.ToString(); if (CurrentVersionExtra != null) { currentVersion += CurrentVersionExtra; } // TODO: Allow textual frame names (and use FrameIndex if not properly set) var frameIndex = FrameIndex++; ImageTester.SendImage(new TestResultImage { CurrentVersion = currentVersion, Frame = frameIndex.ToString(), Image = image, TestName = testName }); }
/// <summary> /// Send the data of the test to the server. /// </summary> /// <param name="image">The image to send.</param> /// <param name="serial">The serial of the device.</param> /// <param name="testName">The name of the test.</param> public void SendImage(Image image, string serial, string testName, int frameIndex) { ImageTester.SendImage(new TestResultImage { BaseVersionFileName = BaseVersionFileName, BaseVersion = BaseVersionNumber, CurrentVersion = CurrentVersionNumber, Image = image }, testName); }