Ejemplo n.º 1
0
        public void GivenTheAdminIsAtEligibilityDataScreen()
        {
            Thread.Sleep(5000);
            LinkHelper.ClickLink(By.XPath("//span[@class='route-title animate__animated animate__slideInDown ng-tns-c155-1'][contains(text(),'Eligibility')]"));
            Thread.Sleep(5000);
            LinkHelper.ClickLink(By.XPath("//span[@class='sub-route route-title animate__animated animate__slideInDown ng-tns-c155-1'][contains(text(),'Add')]"));
            Thread.Sleep(5000);
            IJavaScriptExecutor jse = (IJavaScriptExecutor)ObjectRepository.Driver;

            //jse.ExecuteScript("scroll(0, 250)");
            Thread.Sleep(5000);
            //LinkHelper.ClickLink(By.XPath("//h5[contains(text(),'Employment Details')]"));
            JavaScriptExecutor.ScrollToAndClick(By.XPath("//h5[contains(text(),'Employment Details')]"));

            // Actions action = new Actions(ObjectRepository.Driver);
            IWebElement element = ObjectRepository.Driver.FindElement(By.XPath("//*[@id='mat-select-3']"));

            ObjectRepository.Driver.Manage().Timeouts().ImplicitWait = TimeSpan.FromSeconds(15);

            //action.MoveToElement(element).Click().Build().Perform();
            jse.ExecuteScript("arguments[0].click(); ", element);
            Thread.Sleep(5000);



            TakeScreenShots.CaptureScreenshoots("Test");
            //LinkHelper.ClickLink(By.XPath("//span[text()=' 101 - T-Mobile ']"));
            JavaScriptExecutor.ScrollToAndClick(By.XPath("//span[text()=' 101 - T-Mobile ']"));
            Thread.Sleep(5000);
            TextBoxHelper.TypeInTexBox(By.XPath("//input[@formcontrolname='employeeDepartmentName']"), "sdgfjsjdsgh");
            IWebElement element2 = ObjectRepository.Driver.FindElement(By.XPath("//mat-slide-toggle[@formcontrolname='isUnionEmployee']//input"));
            Boolean     status   = CheckBoxHelper.IsCheckBoxChecked(By.XPath("//mat-slide-toggle[@formcontrolname='isUnionEmployee']//input"));

            if (status == false)
            {
                jse.ExecuteScript("arguments[0].click(); ", element2);
            }
            //JavaScriptExecutor.ScrollToAndClick(By.XPath("//*[@id='mat-expansion-panel-header-2']"));
            IWebElement element1 = ObjectRepository.Driver.FindElement(By.XPath("//*[@id='mat-expansion-panel-header-2']"));

            jse.ExecuteScript("window.scrollBy(0,-250)", "");
            jse.ExecuteScript("arguments[0].click(); ", element1);

            TextBoxHelper.TypeInTexBox(By.XPath("//input[@formcontrolname='employeePreviousEmployerName']"), "hgdsajas");


            Thread.Sleep(10000);
        }
Ejemplo n.º 2
0
 public void WhenUserSelectsAnyOfTheGivenProperties()
 {
     LinkHelper.ClickLink(By.XPath("//input[@name='from']"));
     Thread.Sleep(2000);
     //String text_Before=ObjectRepository.Driver.FindElement(By.XPath("(//div[@class='mat-chip-list-wrapper'])[1]")).Text;
     //Console.WriteLine(text_Before);
     //Actions act = new Actions(ObjectRepository.Driver);
     //act.MoveToElement(ObjectRepository.Driver.FindElement(By.XPath("(//mat-chip/i)[1]"))).Perform();
     JavaScriptExecutor.ScrollToAndClick(By.XPath("(//mat-chip/i)[1]"));
     TextBoxHelper.TypeInTexBox(By.XPath("//input[@name='from']"), "*****@*****.**");
     LinkHelper.ClickLink(By.XPath("//input[@name='toEmail']"));
     JavaScriptExecutor.ScrollToAndClick(By.XPath("(//mat-chip/i)[2]"));
     TextBoxHelper.TypeInTexBox(By.XPath("//input[@name='toEmail']"), "*****@*****.**");
     LinkHelper.ClickLink(By.XPath("//input[@placeholder='Cc']"));
     JavaScriptExecutor.ScrollToAndClick(By.XPath("(//mat-chip/i)[3]"));
     TextBoxHelper.TypeInTexBox(By.XPath("//input[@placeholder='Cc']"), "*****@*****.**");
     TextBoxHelper.TypeInTexBox(By.XPath("//input[@placeholder='Subject']"), "sub1");
     LinkHelper.ClickLink(By.XPath("//span[text()='Send']"));
 }