Esempio n. 1
0
        public void Authentication(string appName)
        {
            // Create Authenticator
            IAuthenticator auth = AuthenticatorFactory.Create(_device, _credential, AuthenticationProvider.Auto);

            try
            {
                var jediWindJammerPrepManager = new JediWindjammerPreparationManager(_device);
                jediWindJammerPrepManager.InitializeDevice(true);

                switch (appName)
                {
                case "Sign In":
                    _device.ControlPanel.PressToNavigate("mSignInButton", "SignInForm", ignorePopups: true);

                    if (_device.ControlPanel.GetControls().Contains("m_RadioButton"))
                    {
                        //Using PressScreen since the small screen doesn't seem to like the mOKButton
                        _device.ControlPanel.PressScreen(250, 250);
                    }

                    auth.Authenticate();
                    break;

                case "Follow-You Printing":
                case "HP AC Secure Pull Print":
                case "My workflow (FutureSmart)":
                case "Pull Print":
                case "Scan To Me":
                case "Scan To My Files":
                case "Scan To Folder":
                case "Public Distributions":
                case "Routing Sheet":
                case "Personal Distributions":
                    _device.ControlPanel.ScrollPressWait("mAccessPointDisplay", "Title", appName, "SignInForm", StringMatch.StartsWith, TimeSpan.FromSeconds(60));
                    auth.Authenticate();
                    break;

                default:
                    AuthenticationHelper.LaunchApp(_device, appName, auth);
                    break;
                }
            }
            catch (Exception ex)
            {
                var    currentScreen = _device.ControlPanel.CurrentForm();
                string message       = $"Unable to authenticate.  Verify EWS authentication configuration and that {appName} button invokes the intended auth method. (current screen: {currentScreen}";
                ExecutionServices.SystemTrace.LogDebug(message + $"; Exception: {ex.Message}");
                throw new DeviceInvalidOperationException(message + ")", ex);
            }
        }
Esempio n. 2
0
        public WindjammerAuthenticatorDriver(JediWindjammerDevice device, string solutionButton, DeviceWorkflowLogger workflowLogger)
        {
            _device             = device;
            _preparationManager = new JediWindjammerPreparationManager(_device);
            _workflowLogger     = workflowLogger;

            _controlPanel = _device.ControlPanel;


            _solutionButton = solutionButton;
            _initMethod     = AuthInitMethod.GetInitiationMethod(_solutionButton);

            PrepareDevice();
        }
Esempio n. 3
0
        private void AuthenticateWindjammer(string deviceIP, string userName)
        {
            IDevice device = DeviceFactory.Create(deviceIP, "!QAZ2wsx");
            AuthenticationCredential credential = new AuthenticationCredential(userName, "1qaz2wsx", "etl.boi.rd.hpicorp.net");

            JediWindjammerPreparationManager prepMgr      = new JediWindjammerPreparationManager(((JediWindjammerDevice)device));
            JediWindjammerControlPanel       controlPanel = ((JediWindjammerDevice)device).ControlPanel;

            // Set up the device for Authentication
            //prepMgr.Reset();
            controlPanel.PressWait(JediWindjammerLaunchHelper.SIGNIN_BUTTON, JediWindjammerLaunchHelper.SIGNIN_FORM);

            //IEnumerable<string> controls = controlPanel.GetControls();
            //foreach (string s in controls)
            //{
            //    System.Diagnostics.Debug.WriteLine(s);
            //}


            IAuthenticator authenticator = AuthenticatorFactory.Create(device, credential, AuthenticationProvider.Auto);

            authenticator.Authenticate();
        }