Exemplo n.º 1
0
 public void SignOff()
 {
     HomeActions.NavigateToLoginForm();
     LoginActions.FillLoginForm(Data.Credentials.Valid.EmailRequester, Data.Credentials.Valid.PasswordRequester);
     SignOffActions.SignOff();
     Assert.AreEqual(Data.Texts.Login.LoginButton, HomeActions.GetLoginLinkText());
 }
Exemplo n.º 2
0
        public void Cancel()
        {
            App.GoTo(HomeActions.Testing());
            App.Navigate("Modal");

            App.ShouldSeeText("Modal");

            var setScript = "$('#insidePjaxPartial').text('modified');";
            var getScript = "return $('#insidePjaxPartial').text();";

            if (!JsDisabled())
            {
                App.Exec(setScript);
                App.Exec(getScript).Should().Be("modified");
            }

            App.Navigate("Modal1");

            App.ShouldSeeText("Page1");

            App.Navigate("Cancel");

            App.ShouldSeeText("ModalIndex");
            App.ShouldNotSeeText("Page1");

            if (!JsDisabled())
            {
                App.Exec(getScript).Should().Be("modified", "cancelling dialog should not refresh page");
            }
        }
Exemplo n.º 3
0
 public void Index_GET_Renders()
 {
     Test(async http =>
     {
         await http.GetAsync(HomeActions.Index());
     });
 }
Exemplo n.º 4
0
        public void Index_GET()
        {
            WebAppTest(client =>
            {
                var response = client.Get(HomeActions.Index());

                response.Doc.Document.Body.TextContent.Should().Contain("Start a new application");
            });
        }
Exemplo n.º 5
0
        public void Password_GET()
        {
            WebAppTest(client =>
            {
                var response = client.Get(HomeActions.Password());

                response.Doc.Document.Body.TextContent.Should().Contain("password protected");
            });
        }
Exemplo n.º 6
0
        public void Password_POST_IncorrectPassword()
        {
            WebAppTest(client =>
            {
                var response = client.Get(HomeActions.Password() + "?name=value").Form <PasswordPostModel>(1)
                               .SetText(m => m.Password, "wrong")
                               .Submit(client);

                response.ActionResultOf <RedirectResult>().Url.Should().BeAction(HomeActions.Password() + "?name=value");
            });
        }
Exemplo n.º 7
0
 public void BlockedEmail()
 {
     HomeActions.NavigateToLoginForm();
     for (int i = 0; i < 5; i++)
     {
         LoginActions.ClearFields();
         LoginActions.FillLoginForm(Data.Credentials.Invalid.Email.Blocked, Data.Credentials.Invalid.Password.Incorrect);
         Driver.WaitForElementUpTo(Data.ElementsWaitingTimeout);
     }
     Assert.AreEqual(Data.ErrorMessages.Login.BlockedEmail, LoginActions.GetErrorMessageBlockedEmail());
 }
Exemplo n.º 8
0
        public void ValidLoginAmbassador()
        {
            HomeActions.NavigateToLoginForm();
            LoginActions.FillLoginForm(Data.Credentials.Valid.EmailAmbassador, Data.Credentials.Valid.PasswordAmbassador);

            Assert.Multiple(() =>
            {
                Assert.AreEqual(Data.Credentials.Valid.EmailAmbassador, UserPanelActions.GetUserEmail());
                Assert.That(UserPanelActions.isStatisticsSectionDisplayed());
            });
        }
Exemplo n.º 9
0
        public void ValidLoginRequester()
        {
            HomeActions.NavigateToLoginForm();
            LoginActions.FillLoginForm(Data.Credentials.Valid.EmailRequester, Data.Credentials.Valid.PasswordRequester);

            Assert.Multiple(() =>
            {
                Assert.AreEqual(Data.Credentials.Valid.EmailRequester, UserPanelActions.GetUserEmail());
                Assert.That(UserPanelActions.isBtnNewRequestDisplayed());
            });
        }
Exemplo n.º 10
0
        public void RequestWithDesign(string selectArm, string selectAmp, string selectColor)
        {
            string Comments;

            HomeActions.NavigateToLoginForm();
            LoginActions.FillLoginForm(Data.Credentials.Valid.EmailRequester, Data.Credentials.Valid.PasswordRequester);
            UserPanelActions.ClickOnNewRequestButton();
            Comments = NewRequestActions.NewRequestWithDesign(selectArm, selectAmp, selectColor);
            UserPanelActions.NavigateToLastRequest();

            Assert.AreEqual(ViewRequestActions.GetComments(), Comments);
        }
Exemplo n.º 11
0
        public void RequestWithoutDesign(string selectArm, string selectAmp)
        {
            string Comments;

            HomeActions.NavigateToLoginForm();
            LoginActions.FillLoginForm(Data.Credentials.Valid.EmailRequester, Data.Credentials.Valid.PasswordRequester);
            UserPanelActions.ClickOnNewRequestButton();
            Comments = NewRequestActions.NewRequestWithoutDesign(selectArm, selectAmp);
            UserPanelActions.NavigateToLastRequest();

            Assert.Multiple(() =>
            {
                Assert.AreEqual(ViewRequestActions.GetComments(), Comments);
                Assert.That(ViewRequestActions.IsNoDesignTextDisplayed);
            });
        }
Exemplo n.º 12
0
        public void Password_POST_CorrectPassword()
        {
            WebAppTest(client =>
            {
                // stub out authentication response
                var responseAuthenticated = false;
                EntryFilter.Authenticate  = r => { responseAuthenticated = true; };

                var url = HomeActions.Password() + $"?{HomeController.PasswordReturnUrlName}={HttpUtility.UrlEncode("http://www.google.com")}";

                var response = client.Get(url).Form <PasswordPostModel>(1)
                               .SetText(m => m.Password, HomeController.PasswordValue)
                               .Submit(client);

                response.ActionResultOf <RedirectResult>().Url.Should().Be("http://www.google.com");
                responseAuthenticated.Should().BeTrue("entry cookie should be added");
            });
        }
Exemplo n.º 13
0
        public void Overview_POST_StartsForm()
        {
            WebAppTest(client =>
            {
                ExecutorStub.SetupCommand(It.IsAny <StartChangeOfCircs>(), new NextSection
                {
                    Id      = "form123",
                    Section = Sections.Consent,
                });

                var response = client.Get(HomeActions.Index()).Form <object>(1)
                               .Submit(client);

                ExecutorStub.Executed <StartChangeOfCircs>().Length.Should().Be(1);

                response.ActionResultOf <RedirectResult>().Url.Should().NotBeNullOrWhiteSpace();
            });
        }
Exemplo n.º 14
0
        public void Action(HomeActions action)
        {
            switch (action)
            {
                case HomeActions.DisplayErrors:

                    DisplayErrors();
                    break;
                case HomeActions.DisplayProgressBar:
                    _progressBar.ShowDialog();
                    break;
                case HomeActions.HideProgressBar:
                        _progressBar.Hide();
                    break;
                default:
                    MessageBox.Show("HomeAction not handled");
                    break;
            }
        }
Exemplo n.º 15
0
 public void IncorrectPassword()
 {
     HomeActions.NavigateToLoginForm();
     LoginActions.FillLoginForm(Data.Credentials.Valid.EmailRequester, Data.Credentials.Invalid.Password.Incorrect);
     Assert.AreEqual(Data.ErrorMessages.Login.InvalidUserPass, LoginActions.GetErrorMessageInvalidUserPass());
 }
Exemplo n.º 16
0
 public void SignUp()
 {
     HomeActions.NavigateToRegisterForm();
     SignUpActions.FillSignUpForm(Data.Credentials.Valid.PasswordRequester);
     Assert.AreEqual(Data.Texts.SignUp.ConfirmEmail, SignUpActions.GetConfirmationMessage());
 }
Exemplo n.º 17
0
        public void Action(HomeActions action)
        {
            switch (action)
            {
                case HomeActions.DisplayErrors:

                    DisplayErrors();
                    break;
                case HomeActions.DisplayProgressBar:
                    _progressBar.ShowDialog();
                    break;
                case HomeActions.HideProgressBar:
                        _progressBar.Hide();
                    break;
                case HomeActions.ImportComplete:
                    MessageBox.Show("Import complete!!\n\r\n\rThis import was brought to you by the sleepy volunteers at GiveCampUK!!");
                    break;
                default:
                    MessageBox.Show("HomeAction not handled");
                    break;
            }

        }
Exemplo n.º 18
0
 public void NonRegisteredEmail()
 {
     HomeActions.NavigateToLoginForm();
     LoginActions.FillLoginForm(Data.Credentials.Invalid.Email.NonRegistered, Data.Credentials.Valid.PasswordRequester);
     Assert.AreEqual(Data.ErrorMessages.Login.InvalidUserPass, LoginActions.GetErrorMessageInvalidUserPass());
 }