public void setup()
        {
            var directoryName = TestContext.CurrentContext.Test.Name.ToString();

            //Open Browser
            dr = BrowserFactory.getBrowser(dr);
            //start Extent Test
            ExtentReportClass.StartExtentTest();
            test = ExtentReportClass.test;
            //Create folder for screenshots
            SeleniumScreenshot.CreateDirectoryForScreenshots(directoryName);
            //Login to stating portal
            TestInit.ManageLogin(dr);
            //Explicit wait
            Thread.Sleep(1000);
            ExplicitWaits.ElementExists(By.ClassName("entry-title"));
        }
示例#2
0
        public void TC101_ValidateDefualtDraggable()
        {
            DemoQaHome hm = new DemoQaHome(dr);

            //Validate home page title
            Assert.AreEqual("Home", hm.pageHeading.Text);
            //Take screenshot
            SeleniumScreenshot.TakeScreenShot("Homescreen.png");
            hm.menuItem.interactionMenu.Draggable.ClickOnIt();
            ExplicitWaits.ElementIsVisible(By.TagName("h1"));
            Assert.AreEqual("Draggable", dr.FindElement(By.TagName("h1")).Text);
            test.Log(LogStatus.Pass, "Draggable page title validated");
            DefaultDraggable drg = new DefaultDraggable(dr);

            SeleniumScreenshot.TakeScreenShot("DraggableHome.png");
            drg.moveElementBy(100, 100, drg.draggableBox);
            SeleniumScreenshot.TakeFullPageScreenShot("DraggableElement_afterDrag");
            test.Log(LogStatus.Pass, "Drag operation performed");
        }