public static void ClickFavFood()
        {
            List <IWebElement> listElements = SiteDriver.FindElements(PersonalityTestPageObject.favFood, "CSSSelector");


            foreach (IWebElement e in listElements)
            {
                e.Click();
            }
        }
Example #2
0
        public static bool CheckOrder()
        {
            List <IWebElement> listElements = SiteDriver.FindElements(ManCityObject.elementList, "CSSSelector");
            List <string>      listTitle    = new List <string>();

            foreach (IWebElement e in listElements)
            {
                listTitle.Add(e.Text);
            }
            return(SiteDriver._IsOrdered(listTitle, lst));;
        }
Example #3
0
        public static bool CheckOrder1()
        {
            // SiteDriver.MoveToElement(SiteDriver.FindElements(ManCityObject.elementList1, "CSSSelector"));
            List <IWebElement> listElements1 = SiteDriver.FindElements(ManCityObject.elementList1, "CSSSelector");
            List <string>      listTitle     = new List <string>();

            foreach (IWebElement e in listElements1)
            {
                listTitle.Add(e.GetAttribute("title"));
            }
            return(SiteDriver._IsOrdered(listTitle, lst1));
        }
        public static void SelectFavItem()
        {
            List <IWebElement> listElements = SiteDriver.FindElements(PersonalityTestPageObject.fav, "CSSSelector");

            foreach (IWebElement e in listElements)
            {/*
              * if (e.GetAttribute("value").Substring(5, 1) == "1")
              * {*/
                e.Click();
            }
            // }
        }
        public static int SelectMutipleFavFood()
        {
            int count = 0;

            PersonalityTestPageService.ClickFavFood();
            foreach (IWebElement e in SiteDriver.FindElements(PersonalityTestPageObject.favFood, "CSSSelector"))
            {
                count += e.Selected?1:0;
            }
            Console.WriteLine("count:" + count);
            return(count);
        }
Example #6
0
        public void CheckFoodOrder()
        {
            DemoMainPageService.ClickOnDemo();
            List <string> lst = new List <string>()
            {
                "Pizza", "Burger", "Sandwich", "Chapati"
            };
            List <IWebElement> listElements1 = SiteDriver.FindElements(PersonalityTestPageObject.foodList, "CSSSelector");
            List <string>      listFood      = new List <string>();

            foreach (IWebElement e in listElements1)
            {
                listFood.Add(e.Text.Trim());
            }
            Assert.True(SiteDriver._IsOrdered(listFood, lst));
        }
Example #7
0
        public void CheckElementsOrder()
        {
            DemoMainPageService.ClickOnDemo();
            List <string> lst = new List <string>()
            {
                "Full Name", "Gender", "Email", "Username", "Password", "City", "State", "Zip Code", "Contact No", "Introduce yourself", "What are your hobbies", "Favourite Food", "Select Skills", "Country", "Favourite Item A", "Favourite Item B", "Favourite Item C", "Favourite Item D", "Favourite Item E", "Favourite Item F", "Favourite Item G", "Favourite Item I", "Favourite Item J", "Favourite Item K", "Favourite Item L", "Favourite Item L", "Favourite Item N", "Favourite Item O", "Favourite Item P", "Favourite Item Q", "Favourite Item R", "Favourite Item S"
            };
            List <IWebElement> listElements1 = SiteDriver.FindElements(PersonalityTestPageObject.elementsList, "CSSSelector");
            List <string>      listElements  = new List <string>();

            foreach (IWebElement e in listElements1)
            {
                listElements.Add(e.Text);
            }
            Assert.True(SiteDriver._IsOrdered(listElements, lst));
        }
Example #8
0
        public void CheckGenderOrder()
        {
            DemoMainPageService.ClickOnDemo();
            List <string> lst = new List <string>()
            {
                "optionFemale", "optionMale", "optionOther"
            };
            List <IWebElement> listElements1 = SiteDriver.FindElements(PersonalityTestPageObject.gender, "CSSSelector");
            List <string>      listGender    = new List <string>();

            foreach (IWebElement e in listElements1)
            {
                listGender.Add(e.GetAttribute("id"));
            }
            Assert.True(SiteDriver._IsOrdered(listGender, lst));
        }
        public static int SelectMultipleGender()
        {
            List <IWebElement> listElements = SiteDriver.FindElements(PersonalityTestPageObject.gender, "CSSSelector");
            int count = 0;

            foreach (IWebElement e in listElements)
            {
                e.Click();
            }

            foreach (IWebElement e in listElements)
            {
                count += e.Selected?1:0;
            }
            return(count);
        }
 //Products
 public string GetProductsCount() =>
 SiteDriver.FindElements(HomePageObjects.ProductsCssSelector, How.CssSelector).Count().ToString();
        public static void SelectGender(int gender = 1)
        {
            List <IWebElement> listElements = SiteDriver.FindElements(PersonalityTestPageObject.gender, "CSSSelector");

            listElements[gender].Click();
        }