Exemplo n.º 1
0
        public void Dashboard_Login_ErrorMessage()
        {
            TestBaseWebDriver test    = base.TestContainer[Gallio.Framework.TestContext.CurrentContext.Test.Name];
            GeneralMethods    utility = test.GeneralMethods;

            string[,] accounts = new string[, ] {
                { "", "", "", "Username is required" },
                { "", "FT4life!", "dc", "Username is required" },
                { "ft.tester", "", "dc", "Password is required" },
                { "ft.tester", "FT4life!", "", "Church code is required" },
                { "ft.tester", "FT4life!", "dc$", "Your login attempt has failed. Church is not found." },
                { "ft.tester", "FT4life!*", "dc", "Your login attempt has failed. Your account will be locked out after 10 attempts." },
                { "ft.tester&", "FT4life!", "dc", "Your login attempt has failed" },
                { "ft.tester~!@#$%^&*(}>|]", "FT4life!ft.tester~!@#$%^&*(}>|]", "dcft.tester~!@#$%^&*(}>|]", "Your login attempt has failed. Church is not found" }
            };

            test.Dashboard.OpenLoginWebDriver();
            DashboardLoginPage loginPage = new DashboardLoginPage(test.Driver, test.GeneralMethods);

            try
            {
                for (int i = 0; i < accounts.GetLength(0); i++)
                {
                    TestLog.WriteLine(string.Format("{0}|{1}|{2}", accounts[i, 0], accounts[i, 1], accounts[i, 2]));
                    loginPage.login(accounts[i, 0], accounts[i, 1], accounts[i, 2]);
                    TestLog.WriteLine(loginPage.getLoginErrorText());
                    Assert.IsTrue(loginPage.getLoginErrorText().Contains(accounts[i, 3]));
                }
            }
            finally
            {
                //clear failed login attempts
                loginPage.login("ft.tester", "FT4life!", "dc");
            }
        }
Exemplo n.º 2
0
        public void LoginWebDriver(string username, string password, string churchCode = "DC")
        {
            TestLog.WriteLine(string.Format("Enter Login Web Driver {0}/{1}/{2}", username, password, churchCode));

            GeneralMethods utility = this._generalMethods;

            TestLog.WriteLine("Login to: " + this._driver.Url.ToString());
            this.OpenLoginWebDriver();
            utility.WaitForPageIsLoaded();
            DashboardLoginPage loginPage = new DashboardLoginPage(this._driver, this._generalMethods);

            loginPage.login(username, password, churchCode);
        }