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()); }
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"); } }
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"); }); }
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()); }
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()); }); }
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()); }); }
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); }
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); }); }
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"); }); }
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(); }); }
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; } }
public void IncorrectPassword() { HomeActions.NavigateToLoginForm(); LoginActions.FillLoginForm(Data.Credentials.Valid.EmailRequester, Data.Credentials.Invalid.Password.Incorrect); Assert.AreEqual(Data.ErrorMessages.Login.InvalidUserPass, LoginActions.GetErrorMessageInvalidUserPass()); }
public void SignUp() { HomeActions.NavigateToRegisterForm(); SignUpActions.FillSignUpForm(Data.Credentials.Valid.PasswordRequester); Assert.AreEqual(Data.Texts.SignUp.ConfirmEmail, SignUpActions.GetConfirmationMessage()); }
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; } }
public void NonRegisteredEmail() { HomeActions.NavigateToLoginForm(); LoginActions.FillLoginForm(Data.Credentials.Invalid.Email.NonRegistered, Data.Credentials.Valid.PasswordRequester); Assert.AreEqual(Data.ErrorMessages.Login.InvalidUserPass, LoginActions.GetErrorMessageInvalidUserPass()); }