private void TakeScreenShot(ScreenShotHandler handler) { GUILayout.Space(50); GUILayout.BeginVertical(); if (GUILayout.Button("Take Screenshot", GUILayout.Height(50))) { handler.TakeScreenShot(); } GUILayout.EndVertical(); }
private void Path(SerializedObject so, ScreenShotHandler handler) { GUILayout.BeginVertical("box"); EditorGUILayout.PropertyField(so.FindProperty("path")); if (GUILayout.Button("Select Path")) { handler.path = EditorUtility.OpenFolderPanel("Select Directory", "", "") + "/"; } GUILayout.EndVertical(); }
private void DimensionSettings(SerializedObject so, ScreenShotHandler handler) { GUILayout.BeginVertical("box"); EditorGUILayout.PropertyField(so.FindProperty("device")); if (handler.device == DeviceInfo.custom) { EditorGUILayout.PropertyField(so.FindProperty("width")); EditorGUILayout.PropertyField(so.FindProperty("height")); } GUILayout.EndVertical(); }
public override void OnInspectorGUI() { base.OnInspectorGUI(); ScreenShotHandler handler = (ScreenShotHandler)target; SerializedObject so = new SerializedObject(handler); DimensionSettings(so, handler); Key(so); Camera(so); Path(so, handler); TakeScreenShot(handler); so.ApplyModifiedProperties(); }
public void AfterBaseTest() { try { var status = TestContext.CurrentContext.Result.Outcome.Status; var stacktrace = string.IsNullOrEmpty(TestContext.CurrentContext.Result.StackTrace) ? "" : string.Format("{0}", TestContext.CurrentContext.Result.StackTrace); Status logstatus; switch (status) { case TestStatus.Failed: logstatus = Status.Fail; Test.AddScreenCaptureFromPath(ScreenShotHandler.TakeScreenShot(Driver)); break; case TestStatus.Inconclusive: logstatus = Status.Warning; break; case TestStatus.Skipped: logstatus = Status.Skip; break; default: logstatus = Status.Pass; break; } Test.Log(logstatus, "Test ended with " + logstatus + stacktrace); } catch (Exception e) { Test.Log(Status.Error, "Exception " + e.Message); } finally { LogApplitools(); if (Driver != null) { Driver.Quit(); } } }
private void Awake() { instance = this; myCamera = gameObject.GetComponent <Camera>(); }