public void NCR_UnitTest_GLX()
 {
     Report.Info("Unit test for GLX");
     LoginAs(UserType.Bhoomi);
     NavigateToPage.QARecordControl_General_NCR();
     QaRcrdCtrl_GeneralNCR.ClickTab_CQM_Review();
     QaRcrdCtrl_GeneralNCR.ClickTab_Resolution_Disposition();
     QaRcrdCtrl_GeneralNCR.ClickTab_Developer_Concurrence();
     QaRcrdCtrl_GeneralNCR.ClickTab_DOT_Approval();
     QaRcrdCtrl_GeneralNCR.ClickTab_Verification_and_Closure();
     QaRcrdCtrl_GeneralNCR.ClickTab_All_NCRs();
     QaRcrdCtrl_GeneralNCR.ClickTab_Creating_Revise();
     QaRcrdCtrl_GeneralNCR.ClickBtn_New();
 }
示例#2
0
 public void CDR_UnitTest_Garnet()
 {
     Report.Step("Unit test for Garnet");
     LoginAs(UserType.Bhoomi);
     NavigateToPage.QARecordControl_General_CDR();
     QaRcrdCtrl_GeneralNCR.ClickTab_Review_Assign_NCR();
     QaRcrdCtrl_GeneralNCR.ClickTab_Resolution_Disposition();
     QaRcrdCtrl_GeneralNCR.ClickTab_Engineer_Concurrence();
     QaRcrdCtrl_GeneralNCR.ClickTab_Owner_Concurrence();
     QaRcrdCtrl_GeneralNCR.ClickTab_Originator_Concurrence();
     QaRcrdCtrl_GeneralNCR.ClickTab_Verification();
     QaRcrdCtrl_GeneralNCR.ClickTab_Closed_NCR();
     QaRcrdCtrl_GeneralNCR.ClickTab_Creating_Revise();
     QaRcrdCtrl_GeneralNCR.ClickBtn_New();
 }
        public void NCR_RequiredFieldIDs()
        {
            Report.Info($"Testing, UserAccts for {tenantName}");
            LoginAs(UserType.NCRMgr);
            NavigateToPage.QARecordControl_General_NCR();
            QaRcrdCtrl_GeneralNCR.ClickBtn_New();
            QaRcrdCtrl_GeneralNCR.ClickBtn_SaveForward();

            string requiredFieldXpath = "//span[contains(text(),'Required')]";
            string sibling            = "//following-sibling::";

            string datePickerAddlXpath = "span[contains(@class,'picker')]/span/input";
            string textAreaAddlXpath   = "textarea";
            string ddListAddlXpath     = "span[contains(@class,'dropdown')]/input";
            string textInputAddlXpath  = "input";


            string key;
            string type;
            string name;
            string id;

            List <KeyValuePair <string, string> > reqFieldPairs = new List <KeyValuePair <string, string> >();

            IList <IWebElement> reqFieldElems = Driver.FindElements(By.XPath(requiredFieldXpath));

            System.Console.WriteLine(reqFieldElems.Count);

            var dateElems = Driver.FindElements(By.XPath($"{requiredFieldXpath}{sibling}{datePickerAddlXpath}"));

            if (dateElems != null)
            {
                type = "Date";

                foreach (IWebElement dateElem in dateElems)
                {
                    id   = dateElem.GetAttribute("id");
                    name = dateElem.GetAttribute("name");

                    key = $"{type}\n{name}";
                    reqFieldPairs.Add(new KeyValuePair <string, string>(key, id));
                }
            }

            var ddListElems = Driver.FindElements(By.XPath($"{requiredFieldXpath}{sibling}{ddListAddlXpath}"));

            if (ddListElems != null)
            {
                type = "DDList";

                foreach (IWebElement ddlElem in ddListElems)
                {
                    id   = ddlElem.GetAttribute("id");
                    name = ddlElem.GetAttribute("name");

                    key = $"{type}\n{name}";
                    reqFieldPairs.Add(new KeyValuePair <string, string>(key, id));
                }
            }

            var txtInputElems = Driver.FindElements(By.XPath($"{requiredFieldXpath}{sibling}{textInputAddlXpath}"));

            if (txtInputElems != null)
            {
                type = "TextInput";

                foreach (IWebElement txtInput in txtInputElems)
                {
                    id   = txtInput.GetAttribute("id");
                    name = txtInput.GetAttribute("name");

                    key = $"{type}\n{name}";
                    reqFieldPairs.Add(new KeyValuePair <string, string>(key, id));
                }
            }

            var textAreaElems = Driver.FindElements(By.XPath($"{requiredFieldXpath}{sibling}{textAreaAddlXpath}"));

            if (textAreaElems != null)
            {
                type = "TextArea";

                foreach (IWebElement txtArea in textAreaElems)
                {
                    id   = txtArea.GetAttribute("id");
                    name = txtArea.GetAttribute("name");

                    key = $"{type}\n{name}";
                    reqFieldPairs.Add(new KeyValuePair <string, string>(key, id));
                }
            }


            System.Console.WriteLine($"{tenantName}\n");
            for (int x = 0; x < reqFieldPairs.Count; x++)
            {
                var pairKey = reqFieldPairs[x].Key;
                var value   = reqFieldPairs[x].Value;

                System.Console.WriteLine($"{pairKey}\n{value}\n");
            }
        }