Beispiel #1
0
        void LicenseValidation()
        {
            Thread.Sleep(1500);
            BaseTest.Driver.FindElement(By.XPath("//*[@id='dashbdNav']/div/a[2]/i")).Click();
            Thread.Sleep(1000);
            iconClick = BaseTest.Driver.FindElement(By.XPath("//*[@id='dashbdFilters']/div[3]/div/i"));

            ScrollToView(By.CssSelector("#dashbdFilters > div:nth-child(1) > div"));
            iconClick.Click();                                                                                                                                      // Open License Type List

            BaseTest.Driver.FindElement(By.XPath("(.//*[normalize-space(text()) and normalize-space(.)='Filter by License Types'])[1]/following::div[2]")).Click(); //Select Certificate of Authority
            BaseTest.Driver.FindElement(By.XPath("(.//*[normalize-space(text()) and normalize-space(.)='Lender'])[1]/following::div[1]")).Click();                  //Select Third Party Administration

            //Assert Certificate of Authority in results pane
            BaseTest.Driver.FindElement(By.XPath("(.//*[normalize-space(text()) and normalize-space(.)='(Primary location)'])[1]/following::td[1]")).Click();
            Assert.AreEqual("Certificate of Authority", BaseTest.Driver.FindElement(By.XPath("(.//*[normalize-space(text()) and normalize-space(.)='(Primary location)'])[1]/following::td[1]")).Text);
            //Assert Third party administrator in results pane
            BaseTest.Driver.FindElement(By.XPath("(.//*[normalize-space(text()) and normalize-space(.)='(Primary location)'])[2]/following::td[1]")).Click();
            Assert.AreEqual("Third Party Administrator", BaseTest.Driver.FindElement(By.XPath("(.//*[normalize-space(text()) and normalize-space(.)='(Primary location)'])[2]/following::td[1]")).Text);

            BaseTest.WriteTestResult("Renewals License Filter Validated");
        }
        void ValidateDownload()
        {
            //PdfLoadedDocument loadedDocument = new PdfLoadedDocument(@"C:\Users\CstoneAdmin\Downloads\Cornerstone-ServiceItemReports.pdf");

            //PdfPageBase page = loadedDocument.Pages[0];

            //string extractedTexts = page.ExtractText(true);

            //BaseTest.WriteReportResult(extractedTexts);

            //loadedDocument.Close(true);

            PdfViewerControl documentViewer = new PdfViewerControl();

            documentViewer.Load(@"C:\Users\CstoneAdmin\Downloads\Cornerstone-ServiceItemReports.pdf");

            Dictionary <int, List <RectangleF> > textSearch = new Dictionary <int, List <RectangleF> >();

            bool IsMatchFound = documentViewer.FindText("Portal Demo", out textSearch);

            documentViewer.Dispose();

            BaseTest.WriteTestResult("Changes Service item Report Output Validated");
        }
        private void JurisdictionFilter()
        {
            Thread.Sleep(1000);
            ScrollToView(By.CssSelector("#dashbdFilters > div:nth-child(1) > div"));
            BaseTest.Driver.FindElement(By.CssSelector("#dashbdFilters > div:nth-child(1) > div > i")).Click();
            BaseTest.Driver.FindElement(By.XPath("(.//*[normalize-space(text()) and normalize-space(.)='Jurisdiction'])[1]/following::div[2]")).Click();
            BaseTest.Driver.FindElement(By.XPath("(.//*[normalize-space(text()) and normalize-space(.)='Filter by Jurisdiction'])[1]/following::div[2]")).Click();
            BaseTest.Driver.FindElement(By.XPath("(.//*[normalize-space(text()) and normalize-space(.)='Alaska'])[2]/following::div[1]")).Click();
            BaseTest.Driver.FindElement(By.XPath("(.//*[normalize-space(text()) and normalize-space(.)='Oregon'])[1]/following::div[1]")).Click();


            //Validate Alaska is present
            for (int second = 0; ; second++)
            {
                if (second >= 60)
                {
                    Assert.Fail("timeout");
                }
                try
                {
                    if ("ALASKA" == BaseTest.Driver.FindElement(By.XPath("//*[@id='listView']/div/div[2]/table/tbody/tr[1]/td/div")).Text)
                    {
                        Console.WriteLine("Alaska Test Succeeded");
                        break;
                    }
                }
                catch (Exception)
                { }
                Thread.Sleep(1000);
            }

            //Validate Arizona is present
            for (int second = 0; ; second++)
            {
                if (second >= 60)
                {
                    Assert.Fail("timeout");
                }
                try
                {
                    if ("ARIZONA" == BaseTest.Driver.FindElement(By.XPath("//*[@id='listView']/div/div[2]/table/tbody/tr[5]/td/div")).Text)
                    {
                        Console.WriteLine("Arizona Test Succeeded");
                        break;
                    }
                }
                catch (Exception)
                { }
                Thread.Sleep(1000);
            }

            //Validate Utah is present
            for (int second = 0; ; second++)
            {
                if (second >= 60)
                {
                    Assert.Fail("timeout");
                }
                try
                {
                    if ("UTAH" == BaseTest.Driver.FindElement(By.XPath("//*[@id='listView']/div/div[2]/table/tbody/tr[9]/td/div")).Text)
                    {
                        Console.WriteLine("Utah Test Succeeded");
                        break;
                    }
                }
                catch (Exception)
                { }
                Thread.Sleep(1000);
            }

            BaseTest.WriteTestResult("All Inventory Jurisdiction Filter Validated");
        }