Ejemplo n.º 1
0
        public void IsZipCodeNumeric()
        {
            DemoMainPageService.ClickOnDemo();

            PersonalityTestPageService.SetZipCode("00977");
            Assert.True(PersonalityTestPageService.CheckNumericZip);
        }
Ejemplo n.º 2
0
        public void OnSubmit()
        {
            DemoMainPageService.ClickOnDemo();

            PersonalityTestPageService.SetFullName("Shreya Shrestha");
            PersonalityTestPageService.SelectGender();
            PersonalityTestPageService.SetEmail("*****@*****.**");
            PersonalityTestPageService.SetPassword("jakdjflkajfdk");
            PersonalityTestPageService.SetCity("Kathmandu");
            PersonalityTestPageService.SetState("Nepalmandal");
            PersonalityTestPageService.SetZipCode("00977");
            PersonalityTestPageService.SetContactNo("9849310444");
            PersonalityTestPageService.SetIntroduction(SiteDriver.ReplicateString("intro "));
            PersonalityTestPageService.SetHobbies(SiteDriver.ReplicateString("replicate"));
            PersonalityTestPageService.ClickFavFood();
            PersonalityTestPageService.SelectSkills("Coding");
            PersonalityTestPageService.SelectCountry("Switzerland");
            PersonalityTestPageService.SelectFavItem();

            string curUrl = SiteDriver.GetCurrentUrl();

            PersonalityTestPageService.ClickSubmitButton();
            string nextpage = SiteDriver.GetCurrentUrl();

            Assert.True(curUrl != nextpage);
        }
Ejemplo n.º 3
0
        public void ClickOnDemo()
        {
            string prevUrl = SiteDriver.GetCurrentUrl();

            DemoMainPageService.ClickOnDemo();
            string currUrl = SiteDriver.GetCurrentUrl();

            Assert.True(prevUrl != currUrl);
        }
Ejemplo n.º 4
0
        public void ValidateEmalId()
        {
            DemoMainPageService.ClickOnDemo();
            PersonalityTestPageService.SetEmail("*****@*****.**");
            string email   = PersonalityTestPageService.getEmailAddress();
            int    atIndex = email.IndexOf("@");

            Assert.True(atIndex > 1 && atIndex < (email.Length - 1));
        }
Ejemplo n.º 5
0
        public void NoFillSubmit()
        {
            DemoMainPageService.ClickOnDemo();
            string curUrl = SiteDriver.GetCurrentUrl();

            PersonalityTestPageService.ClickSubmitButton();
            string nexturl = SiteDriver.GetCurrentUrl();

            Assert.True(curUrl != nexturl);
        }
Ejemplo n.º 6
0
        public void OnReset()
        {
            DemoMainPageService.ClickOnDemo();
            string curUrl = SiteDriver.GetCurrentUrl();

            PersonalityTestPageService.SetFullName("Shreya Shrestha");
            PersonalityTestPageService.SelectGender();
            PersonalityTestPageService.SetEmail("*****@*****.**");
            PersonalityTestPageService.SetPassword("jakdjflkajfdk");
            PersonalityTestPageService.SetCity("Kathmandu");
            PersonalityTestPageService.ClickResetButton();
            string diffUrl = SiteDriver.GetCurrentUrl();

            Assert.True(curUrl == diffUrl);
        }
Ejemplo n.º 7
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));
        }
Ejemplo n.º 8
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));
        }
Ejemplo n.º 9
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));
        }
Ejemplo n.º 10
0
        public MainProgram(IWebDriver webDriver) : base(webDriver)
        {
            string prevUrl = SiteDriver.GetCurrentUrl();

            DemoMainPageService.ClickOnDemo();
            string currUrl = SiteDriver.GetCurrentUrl();


            verifyDiffUrl(prevUrl, currUrl);

            PersonalityTestPageService.SetFullName("Shreya Shrestha");
            PersonalityTestPageService.SelectGender();
            PersonalityTestPageService.SetEmail("*****@*****.**");
            PersonalityTestPageService.SetPassword("jakdjflkajfdk");
            PersonalityTestPageService.SetCity("Kathmandu");
            PersonalityTestPageService.SetState("Nepalmandal");
            PersonalityTestPageService.SetZipCode("00977");
            PersonalityTestPageService.SetContactNo("9849310444");
            PersonalityTestPageService.SetIntroduction(SiteDriver.ReplicateString("intro "));
            PersonalityTestPageService.SetHobbies(SiteDriver.ReplicateString("hobbies "));
            PersonalityTestPageService.ClickFavFood();
            PersonalityTestPageService.SelectSkills("Coding");
            PersonalityTestPageService.SelectCountry("Switzerland");
            PersonalityTestPageService.SelectFavItem();

            prevUrl = currUrl;
            PersonalityTestPageService.ClickSubmitButton();
            //bool moveahead = false;
            //try
            //{
            //    List<IWebElement> elements = SiteDriver.FindElements("input:invalid", "CSSSelector");
            //    foreach(IWebElement e in elements)
            //    {
            //        Console.WriteLine(e.)
            //    }
            //}
            //catch(NoSuchElementException e)
            //{
            //    moveahead = true;
            //}

            currUrl = SiteDriver.GetCurrentUrl();
            verifyDiffUrl(prevUrl, currUrl);

            SiteDriver.closeDriver();
        }
Ejemplo n.º 11
0
 public void MutipleSelectionOnFavFood()
 {
     DemoMainPageService.ClickOnDemo();
     Assert.True(PersonalityTestPageService.SelectMutipleFavFood() > 1);
 }
Ejemplo n.º 12
0
 public void MultipleSelectionOnGender()
 {
     DemoMainPageService.ClickOnDemo();
     Assert.True(PersonalityTestPageService.SelectMultipleGender() == 1);
 }
Ejemplo n.º 13
0
 public void MultipleSelectionOnSkills()
 {
     DemoMainPageService.ClickOnDemo();
     Assert.True(PersonalityTestPageService.IsMultipleSkillSelect);
 }
Ejemplo n.º 14
0
 public void MutlipleSelectionsOnCountry()
 {
     DemoMainPageService.ClickOnDemo();
     Assert.True(PersonalityTestPageService.IsMultipleCountrySelect);
 }