Beispiel #1
0
        public void TestResetPassword(String browserName)
        {
            for (int i = 1; i < 8; i++)
            {
                ExcelOperations.ClearData();
                ExcelOperations.PopulateInCollection(@"C:\Users\baybayal\source\repos\KuboFitResetPassword\KuboFitResetPassword\TestData.xlsx");
                string email           = ExcelOperations.ReadData(1, "email");
                string password        = ExcelOperations.ReadData(i, "password");
                string confirmpassword = ExcelOperations.ReadData(i, "confirmpassword");
                string scenario        = ExcelOperations.ReadData(i, "scenario");

                test = extent.StartTest("[" + (browserName) + "]" + "KuboFit Reset Password Report - " + scenario);

                Setup(browserName);
                int minTestimonialCount = 10;

                //IWebDriver driver = new ChromeDriver();
                driver.Url = "https://account-test.kubofit.com/request-password-reset";
                driver.Manage().Window.Maximize();
                driver.Manage().Timeouts().ImplicitWait = TimeSpan.FromSeconds(60);

                //Go to KuboFit Reset Password Page
                ResetPasswordPage RPPage = new ResetPasswordPage();
                PageFactory.InitElements(driver, RPPage);
                RPPage.EmailAddress.SendKeys(email);
                RPPage.ResetButton.Click();

                //Mailinator
                driver.Url = "https://www.mailinator.com/";
                driver.Manage().Window.Maximize();
                driver.Manage().Timeouts().ImplicitWait = TimeSpan.FromSeconds(60);

                RPPage.EmailMailinator.SendKeys(email);
                RPPage.GoButton.Click();
                RPPage.PassResetRequestButton.Click();
                IWebElement detailFrame = RPPage.ClickIframe;
                driver.SwitchTo().Frame(detailFrame);
                RPPage.ClickBG.Click();
                RPPage.ResetPasswordButton.Click();

                //Reset Password Page
                WaitOnPage(2);
                driver.Manage().Timeouts().ImplicitWait = TimeSpan.FromSeconds(60);
                driver.SwitchTo().Window(driver.WindowHandles.Last());
                RPPage.Password.SendKeys(password);
                RPPage.ConfirmPassword.SendKeys(confirmpassword);
                RPPage.SubmitButton.Click();
                WaitOnPage(2);
                RPPage.VerifyResetPassword();
                test.Log(LogStatus.Pass, scenario + " -Passed");
                extent.EndTest(test);
                DriverQuit();
            }
        }
Beispiel #2
0
        public void TestNonExistentEmail(String browserName)
        {
            ExcelOperations.ClearData();
            ExcelOperations.PopulateInCollection(@"C:\Users\baybayal\source\repos\KuboFitResetPassword\KuboFitResetPassword\TestData.xlsx");
            string email    = ExcelOperations.ReadData(9, "email");
            string scenario = ExcelOperations.ReadData(9, "scenario");

            test = extent.StartTest("[" + (browserName) + "]" + "KuboFit Reset Password Report - " + scenario);

            Setup(browserName);
            int minTestimonialCount = 10;

            //IWebDriver driver = new ChromeDriver();
            driver.Url = "https://account-test.kubofit.com/request-password-reset";
            driver.Manage().Window.Maximize();
            driver.Manage().Timeouts().ImplicitWait = TimeSpan.FromSeconds(60);

            //Go to KuboFit Reset Password Page
            ResetPasswordPage RPPage = new ResetPasswordPage();

            PageFactory.InitElements(driver, RPPage);
            RPPage.EmailAddress.SendKeys(email);
            RPPage.ResetButton.Click();
            RPPage.VerifyEmailResetMessage();
            WaitOnPage(2);

            //Mailinator
            driver.Url = "https://www.mailinator.com/";
            driver.Manage().Window.Maximize();
            driver.Manage().Timeouts().ImplicitWait = TimeSpan.FromSeconds(60);

            RPPage.EmailMailinator.SendKeys(email);
            RPPage.GoButton.Click();
            driver.Manage().Timeouts().ImplicitWait = TimeSpan.FromSeconds(10);
            RPPage.Inbox.Click();
            RPPage.VerifyEmail();

            test.Log(LogStatus.Pass, scenario + " Passed");

            DriverQuit();
        }