public void ReplayEvents(Action completionHandler = null) { AutoTestSession testSession = new AutoTestSession(); Stopwatch sw = new Stopwatch(); int eventCount = events.Count; state = State.Replaying; sw.Start(); // Each spin of the main loop, remove an event from the queue and replay it. GLib.Idle.Add(() => { RecordEvent ev = events[0]; events.RemoveAt(0); ev.Replay(testSession); if (events.Count > 0) { return(true); } sw.Stop(); LoggingService.LogInfo("Time elapsed to replay {0} events: {1}", eventCount, sw.Elapsed); state = State.Idle; if (completionHandler != null) { completionHandler(); } return(false); }); }
public void AttachApplication() { MonoDevelop.Core.Execution.RemotingService.RegisterRemotingChannel(); string sref = File.ReadAllText(AutoTestService.SessionReferenceFile); byte[] data = Convert.FromBase64String(sref); MemoryStream ms = new MemoryStream(data); BinaryFormatter bf = new BinaryFormatter(); service = (IAutoTestService)bf.Deserialize(ms); session = service.AttachClient(this); }
public void DetachClient(IAutoTestClient client) { if (client == this.client) { this.client = null; currentSession?.Dispose(); currentSession = null; } else { throw new InvalidOperationException("Not connected"); } }
public AutoTestSession AttachClient(IAutoTestClient client) { if (this.client != null) { // Make sure the current client is alive NotifyEvent("Ping"); if (this.client != null) { throw new InvalidOperationException("A client is already connected"); } } this.client = client; if (currentSession == null) { currentSession = new AutoTestSession(); } return(currentSession); }
public override void Replay(AutoTestSession testSession) { AppQuery query = testSession.CreateNewQuery(); AppResult[] results = query.Window().Marked("MonoDevelop.Ide.Gui.DefaultWorkbench").Execute(); if (results.Length == 0) { return; } testSession.Select(results [0]); if (results [0] is AutoTest.Results.GtkWidgetResult) { AutoTest.Results.GtkWidgetResult widgetResult = (AutoTest.Results.GtkWidgetResult)results [0]; widgetResult.EnterText(Text); } }
public override void Replay(AutoTestSession testSession) { // Select the main window and then we can push key events to it. AppQuery query = testSession.CreateNewQuery(); AppResult[] results = query.Window().Marked("MonoDevelop.Ide.Gui.DefaultWorkbench").Execute(); if (results.Length == 0) { return; } testSession.Select(results[0]); // We need the GtkWidgetResult for the main window as we only have the keys as a Gdk key if (results [0] is AutoTest.Results.GtkWidgetResult) { AutoTest.Results.GtkWidgetResult widgetResult = (AutoTest.Results.GtkWidgetResult)results[0]; widgetResult.RealTypeKey(Key, Modifiers); } }
public void AttachApplication () { AutoTestService.SetupRemoting (); string sref = File.ReadAllText (AutoTestService.SessionReferenceFile); byte[] data = Convert.FromBase64String (sref); MemoryStream ms = new MemoryStream (data); BinaryFormatter bf = new BinaryFormatter (); service = (IAutoTestService) bf.Deserialize (ms); session = service.AttachClient (this); }
void IAutoTestClient.Connect (AutoTestSession session) { this.session = session; waitEvent.Set (); }
public AutoTestToolbar(AutoTestSession session) { this.session = session; }
void IAutoTestClient.Connect(AutoTestSession session) { this.session = session; waitEvent.Set(); }
public abstract void Replay (AutoTestSession testSession);
public override void Replay (AutoTestSession testSession) { // Select the main window and then we can push key events to it. AppQuery query = testSession.CreateNewQuery (); AppResult[] results = query.Window ().Marked ("MonoDevelop.Ide.Gui.DefaultWorkbench").Execute (); if (results.Length == 0) { return; } testSession.Select (results[0]); // We need the GtkWidgetResult for the main window as we only have the keys as a Gdk key if (results [0] is AutoTest.Results.GtkWidgetResult) { AutoTest.Results.GtkWidgetResult widgetResult = (AutoTest.Results.GtkWidgetResult) results[0]; widgetResult.RealTypeKey (Key, Modifiers); } }
public override void Replay(AutoTestSession testSession) { testSession.ExecuteCommand(CommandId); }
public AutoTestSession AttachClient (IAutoTestClient client) { if (this.client != null) { // Make sure the current client is alive NotifyEvent ("Ping"); if (this.client != null) throw new InvalidOperationException ("A client is already connected"); } this.client = client; if (currentSession == null) currentSession = new AutoTestSession (); return currentSession; }
public abstract void Replay(AutoTestSession testSession);
public void ReplayEvents (Action completionHandler = null) { AutoTestSession testSession = new AutoTestSession (); Stopwatch sw = new Stopwatch (); int eventCount = events.Count; state = State.Replaying; sw.Start (); // Each spin of the main loop, remove an event from the queue and replay it. GLib.Idle.Add (() => { RecordEvent ev = events[0]; events.RemoveAt (0); ev.Replay (testSession); if (events.Count > 0) { return true; } sw.Stop (); LoggingService.LogInfo ("Time elapsed to replay {0} events: {1}", eventCount, sw.Elapsed); state = State.Idle; if (completionHandler != null) { completionHandler (); } return false; }); }
public override void Replay (AutoTestSession testSession) { testSession.ExecuteCommand (CommandId); }
public override void Replay (AutoTestSession testSession) { AppQuery query = testSession.CreateNewQuery (); AppResult[] results = query.Window ().Marked ("MonoDevelop.Ide.Gui.DefaultWorkbench").Execute (); if (results.Length == 0) { return; } testSession.Select (results [0]); if (results [0] is AutoTest.Results.GtkWidgetResult) { AutoTest.Results.GtkWidgetResult widgetResult = (AutoTest.Results.GtkWidgetResult)results [0]; widgetResult.EnterText (Text); } }