Exemplo n.º 1
0
        public static void Ereg_Release4Reference()
        {
            //Create BrowserWindow

            BrowserWindow browind = new BrowserWindow();

            //Agreement Pane
            browind.WaitForControlReady(20000);
            browind.SearchProperties[UITestControl.PropertyNames.Name] = "Release for Reference Checks and Verification of Information";

            //check checkbox
            HtmlCheckBox chkBox = new HtmlCheckBox(browind);

            chkBox.SearchProperties[HtmlCheckBox.PropertyNames.Id] = "ack3_agree";
            chkBox.DrawHighlight();


            //Button Save And Continue
            HtmlControl SaveCont = new HtmlControl(browind);

            SaveCont.SearchProperties[HtmlButton.PropertyNames.Id] = "ForwardButton_button";
            SaveCont.DrawHighlight();

            //chkBox.DrawHighlight();
            if (chkBox.Checked == false)
            {
                //Verify SaveNContinue button is unable
                Assert.IsFalse(SaveCont.Enabled);
                chkBox.SetProperty(HtmlCheckBox.PropertyNames.Checked, true);
            }
            else
            {
                Assert.IsTrue(SaveCont.Enabled);
            }


            // Progress Meter

            HtmlCustom progress = new HtmlCustom(browind);

            progress.SearchProperties[HtmlCustom.PropertyNames.Id] = "progressmeter";
            bool   availabilty   = (bool)progress.GetProperty(HtmlCustom.PropertyNames.Exists);
            string workflowEvent = PersonalInformation1.ReadData(1, "WORKFLOW");

            if (workflowEvent == "S1PROSPECT")
            {
                Assert.IsTrue(availabilty, "Progress Meter is not showing");

                HtmlSpan bar = new HtmlSpan(browind);
                bar.SearchProperties[HtmlSpan.PropertyNames.Id] = "meterlabel";
                string percentage = (string)bar.GetProperty(HtmlSpan.PropertyNames.InnerText);
                Assert.AreEqual(percentage, "95%");
            }
            else
            {
                Assert.IsFalse(availabilty, "Progress Meter is showing");
            }

            //Click Save And Continue

            Mouse.Click(SaveCont);
            browind.WaitForControlReady(2000);
        }
        public static void eReg_EncryptionConsent()
        {
            //*****************/
            //Create browserwindow
            /*****************/
            BrowserWindow browind = new BrowserWindow();

            browind.SearchProperties[UITestControl.PropertyNames.Name] = "Encryption Consent";

            //Verify References pane is available
            HtmlControl EncryptionConsentPane = new HtmlControl(browind);

            EncryptionConsentPane.FilterProperties[HtmlDiv.PropertyNames.InnerText] = "Encryption Consent";

            // CheckBox I have read, understand, and agree to the policy above.

            //check checkbox
            HtmlCheckBox checkBox = new HtmlCheckBox(browind);

            checkBox.SearchProperties[HtmlCheckBox.PropertyNames.Id] = "encrypt_consent_ack";
            checkBox.DrawHighlight();
            Mouse.Click(checkBox);


            //chkBox.DrawHighlight();
            if (checkBox.Checked == true)
            {
                //Verify SaveNContinue button is Enable

                Assert.IsTrue(checkBox.Enabled);
                checkBox.SetProperty(HtmlCheckBox.PropertyNames.Checked, true);
                Mouse.Click(checkBox);
            }
            else
            {
                Assert.IsTrue(checkBox.Enabled, "I have read, understand, and agree to the policy above");
            }

            /*****************/
            /* Progress Meter*/
            /*****************/
            HtmlCustom progress = new HtmlCustom(browind);

            progress.SearchProperties[HtmlCustom.PropertyNames.Id] = "progressmeter";
            progress.DrawHighlight();
            bool   availabilty   = (bool)progress.GetProperty(HtmlCustom.PropertyNames.Exists);
            string workflowEvent = PersonalInformation1.ReadData(1, "WORKFLOW");

            if (workflowEvent == "S1PROSPECT")
            {
                Assert.IsTrue(availabilty, "Progress Meter is not showing");

                HtmlSpan bar = new HtmlSpan(browind);
                bar.SearchProperties[HtmlSpan.PropertyNames.Id] = "progressmeterdiv";
                bar.DrawHighlight();
                string percentage = (string)bar.GetProperty(HtmlSpan.PropertyNames.InnerText);
                Assert.AreEqual(percentage, "95%");
            }
            else
            {
                Assert.IsFalse(availabilty, "Progress Meter is showing");
            }


            //Click button Save And Continue
            HtmlSpan SaveAndContinue = new HtmlSpan(browind);

            SaveAndContinue.SearchProperties[HtmlSpan.PropertyNames.Id] = "ForwardButton_button";
            // SaveAndCountinue.DrawHighlight();
            Mouse.Click(SaveAndContinue);

            browind.WaitForControlReady(2000);
        }