Esempio n. 1
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);
        }
Esempio n. 2
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);
        }
Esempio n. 3
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();
        }