/// <summary>
        /// Launches SafeCom with the specified authenticator using the given authentication mode
        /// </summary>
        /// <param name="authenticator">The authenticator.</param>
        /// <param name="authenticationMode">The authentication mode, eager or lazy.</param>
        public override void Launch(IAuthenticator authenticator, AuthenticationMode authenticationMode)
        {
            if (authenticationMode.Equals(AuthenticationMode.Eager))
            {
                RecordEvent(DeviceWorkflowMarker.DeviceButtonPress, "Sign In");
                _controlPanel.PressToNavigate(JediWindjammerLaunchHelper.SIGNIN_BUTTON, JediWindjammerLaunchHelper.SIGNIN_FORM, true);
                Authenticate(authenticator, JediWindjammerLaunchHelper.HOMESCREEN_FORM);

                RecordEvent(DeviceWorkflowMarker.AppButtonPress, "SafeCom " + SolutionButtonTitle);
                _controlPanel.ScrollPressWait("mAccessPointDisplay", "Title", SolutionButtonTitle, JediWindjammerLaunchHelper.OxpdFormIdentifier, StringMatch.Contains, TimeSpan.FromSeconds(30));
            }
            else // AuthenticationMode.Lazy
            {
                RecordEvent(DeviceWorkflowMarker.AppButtonPress, "SafeCom " + SolutionButtonTitle);
                //_controlPanel.ScrollPressWait("mAccessPointDisplay", "Title", SolutionButtonTitle, JediWindjammerLaunchHelper.SIGNIN_FORM, TimeSpan.FromSeconds(30));
                _controlPanel.ScrollPressNavigate("mAccessPointDisplay", "Title", SolutionButtonTitle, JediWindjammerLaunchHelper.SIGNIN_FORM, true);
                Authenticate(authenticator, JediWindjammerLaunchHelper.OxpdFormIdentifier);
            }
        }
        /// <summary>
        /// Launches the Copy application on the device.
        /// </summary>
        public void Launch()
        {
            try
            {
                RecordEvent(DeviceWorkflowMarker.AppButtonPress, "Copy");
                _controlPanel.ScrollPressNavigate("mAccessPointDisplay", "Copy", "CopyAppMainForm", true);
                RecordEvent(DeviceWorkflowMarker.AppShown);
                Pacekeeper.Pause();
            }
            catch (ControlNotFoundException ex)
            {
                string currentForm = _controlPanel.CurrentForm();
                if (currentForm == "HomeScreenForm")
                {
                    throw new DeviceWorkflowException("Copy application button was not found on device home screen.", ex);
                }
                else
                {
                    throw new DeviceWorkflowException($"Cannot launch the Copy application from {currentForm}.", ex);
                }
            }
            catch (WindjammerInvalidOperationException ex)
            {
                switch (_controlPanel.CurrentForm())
                {
                case "CopyAppMainForm":
                    // The application launched without prompting for credentials.
                    RecordEvent(DeviceWorkflowMarker.AppShown);
                    Pacekeeper.Reset();
                    return;

                case "OneButtonMessageBox":
                    string message = _controlPanel.GetProperty("mMessageLabel", "Text");
                    throw new DeviceWorkflowException($"Could not launch Copy application: {message}", ex);

                default:
                    throw new DeviceWorkflowException($"Could not launch Copy application: {ex.Message}", ex);
                }
            }
        }
        /// <summary>
        /// Checks the device job status by querying Job Status button on control panel
        /// </summary>
        /// <returns></returns>
        protected override bool CheckDeviceJobStatusByControlPanel()
        {
            bool ready = false;

            _controlPanel.PressKey(JediHardKey.Menu);
            Thread.Sleep(TimeSpan.FromSeconds(1));
            _controlPanel.ScrollPressNavigate("mAccessPointDisplay", "Title", "Job Status", "JobStatusMainForm", true);
            var cp = _controlPanel;
            var activeJobButtonText = cp.GetProperty("mActiveJobListBox_Item0", "Column1Text");

            if (string.IsNullOrEmpty(activeJobButtonText))
            {
                ready = true;
            }
            else
            {
                // inconclusive, could not find expected button which means unexpected screen may be up
                ready = false;
            }

            return(ready);
        }
Exemplo n.º 4
0
 private void PressSolutionButton()
 {
     RecordEvent(DeviceWorkflowMarker.AppButtonPress, _initMethod.GetDescription());
     _controlPanel.ScrollPressNavigate("mAccessPointDisplay", "Title", _solutionButton, JediWindjammerLaunchHelper.SIGNIN_FORM, ignorePopups: true);
 }