/// <summary>
        /// Analysis the user notification messages in the status area
        /// </summary>
        /// <param name="message">
        /// The message.
        /// </param>
        /// <returns>
        /// The <see cref="bool"/>.
        /// </returns>
        public bool Run(string message)
        {
            string actualInfo          = new UserMessagesElements().UserNotification;
            string actualInfoLowerCase = actualInfo.ToLower();

            if (actualInfoLowerCase.Contains(message.ToLower()))
            {
                return(true);
            }

            return(false);
        }
        /// <summary>
        /// Analysis the user notification messages in the status area
        /// </summary>
        /// <returns>
        /// The <see cref="bool"/>.
        /// </returns>
        public bool Run()
        {
            string actualInfo          = new UserMessagesElements().UserNotification;
            string actualInfoLowerCase = actualInfo.ToLower();

            if (actualInfoLowerCase.Contains("error") || actualInfoLowerCase.Contains("fail") || actualInfoLowerCase.Contains("warning"))
            {
                Log.Error(LogInfo.Namespace(MethodBase.GetCurrentMethod()), "Concentration module reports: \"" + actualInfo + "\"");
                return(false);
            }

            return(true);
        }
        /// <summary>
        /// Checks whether the user message contains a particular string
        /// </summary>
        /// <param name="value">String to look for</param>
        /// <returns>
        /// true: if the user message contains the string
        /// false: if string is not found
        /// </returns>
        public bool ContainsString(string value)
        {
            string actualInfo          = new UserMessagesElements().UserNotificationMessage;
            string actualInfoLowerCase = actualInfo.ToLower();
            string valueToLower        = value.ToLower();

            if (actualInfoLowerCase.Contains(valueToLower))
            {
                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("succ") || actualInfoLowerCase.Contains("info")) && buttonWrite.Enabled)
            {
                Log.Info(LogInfo.Namespace(MethodBase.GetCurrentMethod()), "Writing finished");
                return(true);
            }

            return(false);
        }
Exemple #5
0
        /// <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>
        /// Scans the user notification messages in the status area for error messages
        /// </summary>
        /// <returns>
        /// true:  if the text contains any of the keywords
        /// false:  if the text does not contain any of the keywords
        /// </returns>
        public bool ContainsError()
        {
            string actualInfo          = new UserMessagesElements().UserNotificationMessage;
            string actualInfoLowerCase = actualInfo.ToLower();

            if (actualInfoLowerCase.Contains("error") || actualInfoLowerCase.Contains("fail") ||
                actualInfoLowerCase.Contains("warning") || actualInfoLowerCase.Contains("not successful"))
            {
                EH.PCPS.TestAutomation.Common.Tools.Log.Error(
                    LogInfo.Namespace(MethodBase.GetCurrentMethod()),
                    "Viscosity module reports: \"" + actualInfo + "\"");
                return(true);
            }

            return(false);
        }
Exemple #9
0
        /// <summary>
        ///     writes coefficients to device/offline parameterization, waits until "write finished" user notification message is displayed and write button is enabled again
        /// </summary>
        /// <returns>
        ///     true: if coefficients were written
        ///     false: if an error occurred
        /// </returns>
        public bool Run()
        {
            bool isWriting = false;
            var  watch     = new Stopwatch();

            if (new RunWrite().ViaIcon() == false)
            {
                return(false);
            }

            isWriting = true;

            watch.Start();
            while (isWriting)
            {
                string actualInfo          = new UserMessagesElements().UserNotification;
                string actualInfoLowerCase = actualInfo.ToLower();
                bool   isSuccess           = actualInfoLowerCase.Contains("success");
                bool   isFinished          = new IsWriteFinished().Run();

                if (watch.ElapsedMilliseconds > DefaultValues.iTimeoutLong)
                {
                    if (isFinished == false)
                    {
                        Log.Error(LogInfo.Namespace(MethodBase.GetCurrentMethod()), "Button [Write] is not enabled.");
                    }

                    Log.Error(LogInfo.Namespace(MethodBase.GetCurrentMethod()), "Writing did not finish within " + DefaultValues.iTimeoutLong + " milliseconds");
                    return(false);
                }

                if (isSuccess)
                {
                    if (isFinished)
                    {
                        Log.Info(LogInfo.Namespace(MethodBase.GetCurrentMethod()), "Writing finished.");
                        isWriting = false;
                    }
                }
            }

            watch.Stop();
            Log.Info(LogInfo.Namespace(MethodBase.GetCurrentMethod()), "Writing coefficients finished after " + watch.ElapsedMilliseconds + " milliseconds. (Timeout: " + DefaultValues.iTimeoutLong + " milliseconds)");
            return(true);
        }