/// <summary> /// Waits for the restore action to finish and checks /// if the action was successful /// </summary> /// <returns>True if successful</returns> public bool IsRestoreFinished() { var repo = GUI.DeviceCareApplication.Instance; var statusbarFunctions = new StatusArea.Statusbar.Statusbar_Functions(); // get event message string msg = statusbarFunctions.GetStatusMessage(); Report.Debug("Message: " + msg); while (repo.StatusArea.ProgressIndicator.Visible == false) { Delay.Milliseconds(200); } // wait for progress to finish statusbarFunctions.IsActionFinished(); // check event log string msg2 = statusbarFunctions.GetStatusMessage(); Report.Debug("Message: " + msg2); if (msg2.Contains("unsuccessful")) { Report.Failure("Restoring DTM data was unsuccessful"); return(false); } return(true); }
/// <summary> /// Performs the playback of actions in this module. /// </summary> /// <remarks>You should not call this method directly, instead pass the module /// instance to the <see cref="TestModuleRunner.Run(ITestModule)"/> method /// that will in turn invoke this method.</remarks> void ITestModule.Run() { Mouse.DefaultMoveTime = 300; Keyboard.DefaultKeyPressTime = 100; Delay.SpeedFactor = 1.0; var eventLog = new Page_Settings_Functions(); // TODO: Rename instance to something useful var statusFunction = new StatusArea.Statusbar.Statusbar_Functions(); statusFunction.OpenEventLog(); // check if event log has entries List <Element> children = eventLog.GetChildrenList(); if (children.Count >= 1) { if (children.Count == 1) { eventLog.LogContainsExactlyOneEvent = true; } eventLog.PopulateListsWithEventLogMessages(); eventLog.ConstructEventLog(); for (int i = 0; i <= eventLog.EventLogMessages.Count - 1; i++) { Report.Info(eventLog.EventLogMessages[i]); } } else { Report.Info("Eventlog is empty. No messages to provide"); eventLog.EventLogMessages = null; } statusFunction.CloseEventLog(); }
/// <summary> /// Clicks the 'Automatic' button and waits until the action is finished /// </summary> /// <returns>True if scanning was successful and Device DTM is online</returns> public bool PerformAutomaticScan() { var statusbarFunction = new StatusArea.Statusbar.Statusbar_Functions(); if (statusbarFunction.GetUSBModemCount() > 1) { Report.Failure("More than one communication unit connected. Automatic connect disabled"); return(false); } string modem = Protocol.AutoScan_ModemRelations.GetCommDriverName(statusbarFunction.GetCommUnitName()); Report.Info("Starting automatic scanning process..."); this.ClickAutomatic(); // problem: es soll gewartet werden, dass das device dtm online ist und das comm dtm soll missachtet werden. es muss also einen möglichkeit geben, von einem // modem auf ein commDTM zu schließen // lösung: GetCommDriverName(string modemName) löst von commUnit auf commDTM auf (das sind fest definierte beziehungen, welches modem für welches commDTM // automatisch scannt statusbarFunction.WaitForScanning(modem); Report.Success("Device was found and is online"); return(true); }
/// <summary> /// Performs an FDT download and waits until the action is finished /// </summary> /// <returns>True if upload was successful</returns> public bool WriteToDevice() { var repo = GUI.DeviceCareApplication.Instance; var statusbarFunctions = new StatusArea.Statusbar.Statusbar_Functions(); repo.MenuArea.MainMenu.ProgramFunctions.Focus(); repo.MenuArea.MainMenu.ProgramFunctionsMenuItems.WriteToDevice.Click(); bool actionFinished = statusbarFunctions.IsActionFinished(); if (actionFinished) { string msg = statusbarFunctions.GetStatusMessage(); if (msg.Contains("unsuccessful")) { return(false); } return(true); } return(false); }
/// <summary> /// Performs an FDT upload and waits until the action is finished /// </summary> /// <returns>True if upload was successful</returns> public bool ReadFromDevice() { var repo = GUI.DeviceCareApplication.Instance; var statusbarFunctions = new StatusArea.Statusbar.Statusbar_Functions(); repo.DeviceCare.MenuArea.Menu_DeviceScreen.MainMenu.ProgramFunctions.Focus(); repo.DeviceCare.MenuArea.Menu_DeviceScreen.MainMenu.ProgramFunctionsMember.DeviceOfflineSupport.ReadFromDevice.Click(); bool actionFinished = statusbarFunctions.IsActionFinished(); if (actionFinished) { string msg = statusbarFunctions.GetStatusMessage(); if (msg.Contains("unsuccessful")) { return(false); } return(true); } return(false); }