Ejemplo n.º 1
0
        /// <summary>
        /// Writes the given text into the given control ID.
        /// </summary>
        /// <param name="objectId">string</param>
        /// <param name="textToType">int</param>
        private void PlayKeyboard(string objectId, string textToType)
        {
            _engine.PressElementById(objectId);

            _controlPanel.WaitForControl("mKeyboard", TimeSpan.FromSeconds(3));
            _controlPanel.TypeOnVirtualKeyboard("mKeyboard", textToType);

            Thread.Sleep(2000);

            _controlPanel.Press("ok");
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Enables email notification for this job.
        /// </summary>
        /// <param name="condition">The condition under which to send notification.</param>
        /// <param name="address">The email address to receive the notification.</param>
        /// <param name="thumbNail">if set to<c>true>enable thumbnail;otherwise,disable it</c></param>//We have added thumbnail parameter but not yet implemented it
        public void EnableEmailNotification(NotifyCondition condition, string address, bool thumbNail)
        {
            ScrollToOption("NotificationDialogButton");
            Pacekeeper.Pause();

            string notificationDialogName = "DSNotificationDialog";

            try
            {
                _controlPanel.PressToNavigate("NotificationDialogButton", "DSNotificationDialog", ignorePopups: false);
            }
            catch (WindjammerInvalidOperationException)
            {
                // Form name is different on some firmware versions
                if (_controlPanel.CurrentForm() == "DSNotificationSettingsDialog")
                {
                    notificationDialogName = "DSNotificationSettingsDialog";
                }
                else
                {
                    throw;
                }
            }
            Pacekeeper.Pause();
            _controlPanel.Press(condition == NotifyCondition.OnlyIfJobFails ? "AllErrors" : "Always");
            Pacekeeper.Sync();

            // On some devices (digital senders) this button doesn't exist, since only email is available
            if (_controlPanel.GetControls().Contains("Email"))
            {
                _controlPanel.Press("Email");
                Pacekeeper.Sync();
            }

            // Enter the email address and exit
            _controlPanel.PressToNavigate("mEmailAddressTextBox", "DataDrivenTextEntryForm", ignorePopups: false);
            Pacekeeper.Pause();
            _controlPanel.TypeOnVirtualKeyboard("mKeyboard", address);
            Pacekeeper.Sync();
            _controlPanel.PressToNavigate("ok", notificationDialogName, ignorePopups: false);
            Pacekeeper.Pause();
            _controlPanel.PressToNavigate("m_OKButton", _appMainForm, ignorePopups: false);
            Pacekeeper.Pause();
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Logs in to the Safecom on the device control panel using ID CODE
        /// </summary>
        /// <param name="pin">PIN</param>
        /// <returns></returns>
        public void AuthenticateSafecom(string pin)
        {
            try
            {
                var preparationManager = DevicePreparationManagerFactory.Create(_device);
                preparationManager.WakeDevice();

                //Go to Home Screen
                _controlPanel.PressKey(JediHardKey.Menu);

                //Enter Credentials
                _controlPanel.PressToNavigate("b7396880-ec17-11df-98cf-0800200c9a66", "SignInForm", true);
                _controlPanel.PressToNavigate("m_textBox", "SignInKeyboardForm", true);
                // SafeCom ID authenticiation uses a unique personal identification code (PIC) that has been assigned to each user.  Our convention is that it's the username with the u lopped off
                // e.g. u00001  =>  00001; u00038 => 00038
                _controlPanel.TypeOnVirtualKeyboard("mKeyboard", _credential.UserName.Substring(1)); //Enter Username as ID CODE
                _controlPanel.PressToNavigate("ok", "SignInForm", true);
                _controlPanel.PressToNavigate("mOkButton", "OxpUIAppMainForm800X300", true);         //Sign In
            }
            catch (Exception ex)
            {
                throw new Exception($"Safecom navigation failed with exception:{ex.Message}");
            }
        }