private void NavigateAndLogin()
        {
            new HomePage(Driver).ClickFormAuthenticationLink();
            FormAuthenticationPage form = new FormAuthenticationPage(Driver);

            form.EnterUsername("tomsmith");
            form.EnterPassword("SuperSecretPassword!");
            form.ClickSubmit();
        }
예제 #2
0
        public void ShouldTryLoginWithInvalidCredentials()
        {
            new HomePage(Driver).ClickFormAuthenticationLink();
            FormAuthenticationPage form = new FormAuthenticationPage(Driver);

            form.EnterUsername("Peeter-Eeter Termomeeter");
            form.EnterPassword("CorrectHorseBatteryStaple");
            form.ClickSubmit();

            form.IsErrorNotificationDisplayed().Should().BeTrue();
        }
예제 #3
0
        public void ShouldLoginWithValidCredentials()
        {
            new HomePage(Driver).ClickFormAuthenticationLink();
            FormAuthenticationPage form = new FormAuthenticationPage(Driver);

            form.EnterUsername("tomsmith");
            form.EnterPassword("SuperSecretPassword!");
            form.ClickSubmit();

            form.IsSuccessNotificationDisplayed().Should().BeTrue();
        }
        public void FormAuthenticationPageTest(IDictionary<string, string> parameters)
        {
            new InternetPage(this.DriverContext).OpenHomePage().GoToFormAuthenticationPage();

            var formFormAuthentication = new FormAuthenticationPage(this.DriverContext);
            formFormAuthentication.EnterUserName(parameters["user"]);
            formFormAuthentication.EnterPassword(parameters["password"]);
            formFormAuthentication.LogOn();
            Verify.That(
                this.DriverContext,
                () => Assert.AreEqual(parameters["message"], formFormAuthentication.GetMessage));
        }
        public void Exercise_5_Test()
        {
            // TODO: Add your test code here
            var internetPage = new InternetPage(this.DriverContext);

            internetPage.OpenHomePage();
            internetPage.GoToPage("login");
            var formFormAuthentication = new FormAuthenticationPage(this.DriverContext);

            formFormAuthentication.EnterUserName(BaseConfiguration.Username);
            formFormAuthentication.EnterPassword(BaseConfiguration.Password);
            formFormAuthentication.LogIn();
            Assert.AreEqual("You logged into a secure area!", formFormAuthentication.GetMessageSecure());
        }
예제 #6
0
        public void FormAuthenticationPageTestCSV(IDictionary <string, string> parameters)
        {
            var basicAuthPage = new InternetPage(this.DriverContext);

            basicAuthPage.OpenHomePage();
            basicAuthPage.GoToPage("login");
            var formFormAuthentication = new FormAuthenticationPage(this.DriverContext);

            formFormAuthentication.EnterUserName(parameters["user"]);
            formFormAuthentication.EnterPassword(parameters["password"]);
            formFormAuthentication.LogIn();
            Verify.That(
                this.DriverContext,
                () => Assert.AreEqual(parameters["message"], formFormAuthentication.GetMessageSecure()));
        }