/// <summary> /// Checks whether button 'Calculate' is inactive or not /// </summary> /// <returns><c>true</c> if inactive, <c>false</c> otherwise.</returns> public bool Run() { bool result = true; Button calculate = new ToolbarElements().CalculateButton; if (calculate == null) { Log.Error(LogInfo.Namespace(MethodBase.GetCurrentMethod()), "Button 'Calculate' is null."); } else { if (calculate.Enabled) { result = false; Log.Info(LogInfo.Namespace(MethodBase.GetCurrentMethod()), "Button 'Calculate' is active."); } else { Log.Info(LogInfo.Namespace(MethodBase.GetCurrentMethod()), "Button 'Calculate' is inactive."); } } return(result); }
/// <summary> /// Checks if writing coefficients to the device is finished /// </summary> /// <returns> /// true: if write button is enabled and user notification message is shown /// false: if either write button is not enabled or message is not shown /// </returns> public bool Run() { Button buttonWrite = new ToolbarElements().ButtonWrite; if (buttonWrite.Enabled) { return(true); } return(false); }
/// <summary> /// Determines whether the cancel button in toolbar is active/inactive /// </summary> /// <returns> /// true: if button is enabled /// false: if button is not enabled /// </returns> public bool IsCancelButtonActive() { Button button = new ToolbarElements().ButtonCancel; if (button == null) { Log.Error(LogInfo.Namespace(MethodBase.GetCurrentMethod()), "Cancel button == null!"); return(false); } return(button.Enabled); }
/// <summary> /// Determines whether the read button in toolbar is active/inactive /// </summary> /// <returns> /// true: if button is enabled /// false: if button is not enabled /// </returns> public bool IsReadButtonActive() { Button button = new ToolbarElements().ButtonRead; if (button == null) { EH.PCPS.TestAutomation.Common.Tools.Log.Error(LogInfo.Namespace(MethodBase.GetCurrentMethod()), "Read button == null!"); return(false); } return(button.Enabled); }
/// <summary> /// Set focus on combobox DataSet /// </summary> /// <returns> /// <br>True: If call worked fine</br> /// <br>False: If an error occurred</br> /// </returns> public bool Run() { Button button = new ToolbarElements().ButtonParameterSelection; if (button != null && button.Enabled) { Mouse.MoveTo(button, 500); button.Click(); return(true); } EH.PCPS.TestAutomation.Common.Tools.Log.Error(LogInfo.Namespace(MethodBase.GetCurrentMethod()), "Element is not available."); return(false); }
/// <summary> /// Checks if writing to device is finished /// </summary> /// <returns> /// true: if write button is enabled and user notification message is shown /// false: if either write button is not enabled or message is not shown /// </returns> public bool Run() { string actualInfo = new UserMessagesElements().UserNotificationMessage; string actualInfoLowerCase = actualInfo.ToLower(); Button buttonWrite = new ToolbarElements().WriteButton; if ((actualInfoLowerCase.Contains("succ") || actualInfoLowerCase.Contains("info")) && buttonWrite.Enabled) { Log.Info(LogInfo.Namespace(MethodBase.GetCurrentMethod()), "Writing finished"); return(true); } return(false); }
/// <summary> /// Returns whether the new button is enabled /// </summary> /// <returns><c>true</c> if enabled, <c>false</c> otherwise.</returns> public bool Run() { Button newButton = new ToolbarElements().ButtonNew; if (newButton == null) { Log.Error(LogInfo.Namespace(MethodBase.GetCurrentMethod()), "Calculation button is null."); return(false); } else { return(newButton.Enabled); } }
/// <summary> /// Checks if writing coefficients to the device is finished /// </summary> /// <returns> /// true: if write button is enabled and user notification message is shown /// false: if either write button is not enabled or message is not shown /// </returns> public bool Run() { string actualInfo = new UserMessagesElements().UserNotification; string actualInfoLowerCase = actualInfo.ToLower(); Button buttonCalculate = new ToolbarElements().ButtonCalculate; if (actualInfoLowerCase.Contains("calculation") && actualInfoLowerCase.Contains("successful") && buttonCalculate.Enabled) { Log.Info(LogInfo.Namespace(MethodBase.GetCurrentMethod()), "Calculation finished"); return(true); } return(false); }
/// <summary> /// Checks if reading coefficients from the device is finished /// </summary> /// <returns> /// true: if read button is enabled and user notification message is shown /// false: if either read button is not enabled or message is not shown /// </returns> public bool Run() { string actualInfo = new UserMessagesElements().UserNotification; string actualInfoLowerCase = actualInfo.ToLower(); Button buttonRead = new ToolbarElements().ButtonRead; if (actualInfoLowerCase.Contains("read") && actualInfoLowerCase.Contains("from") && actualInfoLowerCase.Contains("device") && buttonRead.Enabled) { Log.Info(LogInfo.Namespace(MethodBase.GetCurrentMethod()), "Reading finished"); return(true); } return(false); }
/// <summary> /// Checks if writing to device is finished /// </summary> /// <returns> /// true: if write button is enabled and user notification message is shown /// false: if either write button is not enabled or message is not shown /// </returns> public bool Run() { string actualInfo = new UserMessagesElements().UserNotificationMessage; string actualInfoLowerCase = actualInfo.ToLower(); Button buttonWrite = new ToolbarElements().WriteButton; if (actualInfoLowerCase.Contains("successfully") && actualInfoLowerCase.Contains("written") && buttonWrite.Enabled) { EH.PCPS.TestAutomation.Common.Tools.Log.Info(LogInfo.Namespace(MethodBase.GetCurrentMethod()), "Writing finished"); return(true); } return(false); }
/// <summary> /// Clicks the go to home location button. /// </summary> /// <returns><c>true</c> if button clicked, <c>false</c> otherwise.</returns> public bool Run() { bool result = true; Button homeLocation = new ToolbarElements().HomeButton; if (homeLocation == null) { result = false; Log.Error(LogInfo.Namespace(MethodBase.GetCurrentMethod()), "Go to home location button is null."); } else { Log.Info(LogInfo.Namespace(MethodBase.GetCurrentMethod()), "Clicking go to home location button."); homeLocation.Click(); } return(result); }
/// <summary> /// Start help via related toolbar-icon /// </summary> /// <returns> /// <br>True: If call worked fine</br> /// <br>False: If an error occurred</br> /// </returns> public bool ViaIcon() { try { Button button = new ToolbarElements().ButtonHelp; if (button != null && button.Enabled) { Mouse.MoveTo(button, 500); button.Click(DefaultValues.locDefaultLocation); return(true); } Log.Error(LogInfo.Namespace(MethodBase.GetCurrentMethod()), "Button is not accessible"); return(false); } catch (Exception excException) { Log.Error(LogInfo.Namespace(MethodBase.GetCurrentMethod()), excException.Message); return(false); } }
/// <summary> /// Start help via related toolbar-icon /// </summary> /// <returns> /// <br>True: If call worked fine</br> /// <br>False: If an error occurred</br> /// </returns> public bool ViaIcon() { try { Button button = new ToolbarElements().HelpButton; if (button != null && button.Enabled) { button.Focus(); button.Click(DefaultValues.locDefaultLocation); return(true); } EH.PCPS.TestAutomation.Common.Tools.Log.Error(LogInfo.Namespace(MethodBase.GetCurrentMethod()), "Button is not accessible"); return(false); } catch (Exception excException) { EH.PCPS.TestAutomation.Common.Tools.Log.Error(LogInfo.Namespace(MethodBase.GetCurrentMethod()), excException.Message); return(false); } }