예제 #1
0
        //Filter By Design name
        public static void FilterByDeisgnName()
        {
            log4net.Config.XmlConfigurator.Configure();
            ILog logger = LogManager.GetLogger(typeof(MyProjectsPage));

            test = Base.extent.CreateTest("VerifyListOfTemplates");
            try
            {
                IList <IWebElement> templates = Element.getElements(BeforeTemplates);
                Console.WriteLine("Number of templates present in a page is " + templates.Count());
                for (int i = 0; i < templates.Count; i++)
                {
                    SearchBox.Type(templates[i].Text);
                    Wait.WaitVisible(SearchButton);
                    SearchButton.Click();
                    SearchBox.Type(Keys.Control + "a");
                    SearchBox.Type(Keys.Clear);
                    MyProject.Click();
                    if (i == 0)
                    {
                        break;
                    }
                }
            }
            catch (Exception e)
            {
                test.Fail("Filter by deisgn name failed" + e);
                Driver.Quit();
                throw e;
            }
        }
예제 #2
0
        //Click on Projects
        public static void ClickOnProjects()
        {
            log4net.Config.XmlConfigurator.Configure();
            ILog logger = LogManager.GetLogger(typeof(MyProjectsPage));

            try
            {
                Wait.WaitVisible(MyProject);
                MyProject.Click();
            }
            catch (Exception e)
            {
                logger.Error("Click on Projects failed due to : " + e);
                //**Closing browser
                Driver.Quit();
                throw e;
            }
        }
예제 #3
0
        public static void VerifyHomePage()
        {
            log4net.Config.XmlConfigurator.Configure();
            ILog logger = LogManager.GetLogger(typeof(HomePage));

            try
            {
                //Check the Title of Home page
                String actual_title = Driver.Title;
                Assert.IsTrue(actual_title.Contains("Home Page"), actual_title + "Error msg -Title does not contain Home Page");

                //Check the Diageo Logo
                Wait.WaitVisible(DiageoLogo, 20);
                bool status_of_logo = DiageoLogo.IsElementDisplayed();
                Console.WriteLine("Status of logo is " + status_of_logo);
                Assert.IsTrue(status_of_logo);

                //Check Your Account Button
                Wait.WaitVisible(YourAccount, 20);
                bool status_of_myaacount = YourAccount.IsElementEnabled();
                Console.WriteLine("Status of account button is " + status_of_myaacount);

                //Check My Project Button
                Wait.WaitVisible(MyProject, 20);
                bool status_of_myproject = YourAccount.IsElementEnabled();
                Console.WriteLine("Status of projects button is " + status_of_myproject);

                //Click on My Project Button
                MyProject.Click();
            }
            catch (Exception e)
            {
                logger.Error("VerifyHomePage failed due to: " + e);
                //**Closing browser
                Driver.Quit();
                throw e;
            }
        }