示例#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());
 }
示例#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");
            }
        }
示例#3
0
 public void Index_GET_Renders()
 {
     Test(async http =>
     {
         await http.GetAsync(HomeActions.Index());
     });
 }
        public void Index_GET()
        {
            WebAppTest(client =>
            {
                var response = client.Get(HomeActions.Index());

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

                response.Doc.Document.Body.TextContent.Should().Contain("password protected");
            });
        }
        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");
            });
        }
示例#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());
 }
示例#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());
            });
        }
示例#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());
            });
        }
示例#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);
        }
示例#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);
            });
        }
示例#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");
            });
        }
示例#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();
            });
        }
示例#14
0
文件: Form1.cs 项目: GiveCampUK/PPT
        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;
            }
        }
示例#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());
 }
示例#16
0
 public void SignUp()
 {
     HomeActions.NavigateToRegisterForm();
     SignUpActions.FillSignUpForm(Data.Credentials.Valid.PasswordRequester);
     Assert.AreEqual(Data.Texts.SignUp.ConfirmEmail, SignUpActions.GetConfirmationMessage());
 }
示例#17
0
文件: Form1.cs 项目: GiveCampUK/PPT_2
        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;
            }

        }
示例#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());
 }