Exemplo n.º 1
0
 public static void AfterScenario()
 {
     Console.WriteLine("AfterScenario Hook");
     if (ScenarioContext.Current.TestError != null)
     {
         string name = ScenarioContext.Current.ScenarioInfo.Title + ".jpeg";
         TakeScreenShots.CaptureScreenshoots(name);
         Console.WriteLine(ScenarioContext.Current.TestError.Message);
         Console.WriteLine(ScenarioContext.Current.TestError.StackTrace);
     }
 }
Exemplo n.º 2
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);
        }