示例#1
0
        private void authtype_ComboBox_SelectedIndexChanged(object sender, EventArgs e)
        {
            RegusKioskAuthType authtype = EnumUtil.GetByDescription <RegusKioskAuthType>(authtype_ComboBox.Text);

            switch (authtype)
            {
            case RegusKioskAuthType.Card:
                id_TextBox.Enabled  = false;
                pwd_TextBox.Enabled = false;
                pin_TextBox.Enabled = false;
                id_Label.Enabled    = false;
                pwd_Label.Enabled   = false;
                pin_Label.Enabled   = false;
                break;

            case RegusKioskAuthType.Login:
                id_TextBox.Enabled  = true;
                pwd_TextBox.Enabled = true;
                pin_TextBox.Enabled = false;
                id_Label.Enabled    = true;
                pwd_Label.Enabled   = true;
                pin_Label.Enabled   = false;
                break;

            case RegusKioskAuthType.Pin:
                id_TextBox.Enabled  = false;
                pwd_TextBox.Enabled = false;
                pin_TextBox.Enabled = true;
                id_Label.Enabled    = false;
                pwd_Label.Enabled   = false;
                pin_Label.Enabled   = true;
                break;
            }
        }
示例#2
0
        /// <summary>
        /// Verify screen after Login
        /// <param name="authType">authType for Login</param>
        /// <param name="id">Navigate to destination by FilePath</param>
        /// </summary>
        private void VerifyLogin(RegusKioskAuthType authType, string id)
        {
            if (!JetAdvantageLinkControlHelper.WaitingObjectAppear(new UiSelector().ResourceId($"{KioskPackageName}:id/homeLayout"), 500, 120))
            {
                if (LinkUI.Controller.DoesScreenContains(new UiSelector().ResourceId($"{RegusPackageName}:id/loading_msg_textview")))
                {
                    DeviceWorkflowException e = new DeviceWorkflowException($"The sign in Please Wait popup message did not disappear within 60 seconds.");
                    throw e;
                }
                else
                {
                    CheckServerErrorPopup();
                    DeviceWorkflowException e = new DeviceWorkflowException($"Home layout after login is not displayed :: {authType}");
                    e.Data.Add(_exceptionCategoryData, ConnectorExceptionCategory.SignIn.GetDescription());
                    throw e;
                }
            }

            if (authType.Equals(RegusKioskAuthType.Login))
            {
                if (!LinkUI.Controller.GetText(new UiSelector().ResourceId($"{KioskPackageName}:id/userName")).Contains(id))
                {
                    DeviceWorkflowException e = new DeviceWorkflowException($"Displayed ID is wrong: {LinkUI.Controller.GetText(new UiSelector().ResourceId($"{KioskPackageName}:id/userName"))}");
                    e.Data.Add(_exceptionCategoryData, ConnectorExceptionCategory.SignIn.GetDescription());
                    throw e;
                }
            }
            RecordEvent(DeviceWorkflowMarker.AuthenticationEnd);
        }