public void Should_Remember_Last_Year_Selected() { SettingUtils.UpdateSetting("CombinedGivingSummary", "false"); var username1 = RandomString(); var password1 = RandomString(); var user1 = CreateUser(username1, password1); var username2 = RandomString(); var password2 = RandomString(); var user2 = CreateUser(username2, password2); var admin = LoginAsAdmin(); Open($"{rootUrl}Person2/{user1.PeopleId}"); WaitForElement(".active:nth-child(2) > a", 10); PageSource.ShouldContain("<a href=\"#giving\" aria-controls=\"giving\" data-toggle=\"tab\">Giving</a>"); Find(text: "Giving").Click(); WaitForElement("#GivingYear", 10); WaitForElementToDisappear(loadingUI); var dropdown = Find(css: "#GivingYear"); var selectElement = new SelectElement(dropdown); selectElement.SelectByText("All Years"); WaitForElement("#Giving-detail-section", 10); Open($"{rootUrl}Person2/{user2.PeopleId}"); WaitForElement("#GivingYear", 10); PageSource.ShouldContain("<input name=\"Year\" type=\"hidden\" value=\"All Years\">"); }
public void Should_Show_Closed_Funds() { var fund = new ContributionFund { FundId = RandomNumber(500, 1000), CreatedBy = 1, CreatedDate = DateTime.Now, FundName = RandomString(), FundStatusId = 2, FundTypeId = 1, FundPledgeFlag = false }; db.ContributionFunds.InsertOnSubmit(fund); db.SubmitChanges(); username = RandomString(); password = RandomString(); var user = CreateUser(username, password, roles: new string[] { "Access", "Edit", "Admin", "Finance" }); Login(); Open($"{rootUrl}Funds/"); Find(xpath: "//a[contains(@href, '/Funds?status=2')]").Click(); PageSource.ShouldContain(fund.FundName); db.ContributionFunds.DeleteOnSubmit(fund); db.SubmitChanges(); }
public void Should_Not_Show_Deceased_Person_In_Family_Attendance() { MaximizeWindow(); username = RandomString(); password = RandomString(); var user = CreateUser(username, password, roles: new string[] { "Access", "Edit", "Admin" }); var org = MockOrganizations.CreateOrganization(db, RandomString()); org.RegistrationTypeId = RegistrationTypeCode.RecordFamilyAttendance; db.SubmitChanges(); var family = user.Person.Family; var deceasedPerson = CreatePerson(family); deceasedPerson.DeceasedDate = DateTime.Now.AddYears(-10); db.SubmitChanges(); Login(); Wait(3); Open($"{rootUrl}OnlineReg/{org.OrganizationId}"); Wait(3); PageSource.ShouldContain(user.Person.FirstName); PageSource.ShouldNotContain(deceasedPerson.FirstName); }
public void Should_Show_Basic_People_Search() { username = RandomString(); password = RandomString(); var user = CreateUser(username, password, roles: new string[] { "Access", "Edit", "Admin", "Finance" }); Login(); Wait(3); Open($"{rootUrl}Bundles/"); Find(text: "Create New Bundle").Click(); Find(id: "Bundle_TotalCash").SendKeys("1000"); Find(xpath: "//button[@type='submit']").Click(); var bundleHeaderId = db.BundleHeaders.OrderByDescending(b => b.CreatedDate).FirstOrDefault().BundleHeaderId; Open($"{rootUrl}PostBundle/{bundleHeaderId}"); Find(xpath: "//input[@id='pid']").SendKeys("1"); Find(xpath: "//input[@id='amt']").SendKeys("100"); Find(xpath: "(//a[contains(text(),'Update')])[4]").Click(); Wait(3); Find(xpath: "//table[@id='bundle']/tbody/tr/td/a").Click(); Wait(3); PageSource.ShouldContain("People to add..."); }
public void Should_Open_Datepicker_On_Mobile_Resolutions(int width) { driver.Manage().Window.Size = new Size(width, 667); username = RandomString(); password = RandomString(); string roleName = "role_" + RandomString(); var user = CreateUser(username, password, roles: new string[] { "Access", "Edit", "Admin", "Finance" }); Login(); Open($"{rootUrl}Bundle/Edit/{new FinanceTestUtils(db).BundleHeader.BundleHeaderId}"); Wait(5); PageSource.ShouldContain("Contribution Bundle"); Check_If_DateTimePicker_Exists(); Open($"{rootUrl}Person2/{user.PeopleId}"); Wait(5); PageSource.ShouldContain("General"); Find(css: ".edit-basic").Click(); Wait(2); ScrollTo(id: "WeddingDate"); Check_If_DateTimePicker_Exists(); Find(css: ".navbar-toggle").Click(); Wait(1); Find(css: "#navbar>.navbar-nav>.dropdown:nth-child(5)").Click(); ScrollTo(xpath: "//a[contains(@href, '/FinanceReports/TotalsByFundAgeRange')]"); Wait(1); Find(xpath: "//a[contains(@href, '/FinanceReports/DonorTotalSummary')]").Click(); Check_If_DateTimePicker_Exists(); }
public void Should_Allow_Login_and_Logout() { username = RandomString(); password = RandomString(); var user = CreateUser(username, password, roles: new string[] { "Checkin" }); Open($"{rootUrl}CheckIn/"); WaitForElement("#CheckInApp", 30); Find(name: "username").SendKeys(username); Find(name: "password").SendKeys(password); Find(name: "kiosk").SendKeys("test"); Find(css: "input[type=submit]").Click(); Wait(10); Open($"{rootUrl}CheckIn/"); WaitForElement("#CheckInApp", 30); PageSource.ShouldContain("Enter your phone number"); Open($"{rootUrl}CheckIn/Logout", true); Open($"{rootUrl}CheckIn/"); WaitForElement("#CheckInApp", 30); PageSource.ShouldNotContain("Enter your phone number"); }
public void Delete_Role_Test() { username = RandomString(); password = RandomString(); string roleName = "role_" + RandomString(); var role = new CmsData.Role { RoleName = roleName }; db.Roles.InsertOnSubmit(role); db.SubmitChanges(); var user = CreateUser(username, password, roles: new string[] { "Access", "Edit", "Admin" }); Login(); Open($"{rootUrl}Roles"); PageSource.ShouldContain(roleName); Find(css: $"a[id=\"{role.RoleId}\"].delete").Click(); Wait(0.5); Find(css: "div.showSweetAlert.visible button.confirm").Click(); Wait(1); role = db.Copy().Roles.SingleOrDefault(r => r.RoleName == roleName); role.ShouldBeNull(); }
public void PyscriptWithoutParameters() { LoginAsAdmin(); db.WriteContentPython("HelloWorld", "print 'Hello World'"); Open($"{rootUrl}PyScript/HelloWorld"); PageSource.ShouldContain("Hello World"); }
public void MyData_User_ChangePassword_Test() { username = RandomString(); password = RandomString(); var user = CreateUser(); Login(); var newPassword = RandomString() + "1!"; Find(css: profileMenu).Click(); Find(text: "Change Password").Click(); CurrentUrl.ShouldBe($"{rootUrl}Account/ChangePassword/"); Find(id: "currentPassword").SendKeys(password); Find(id: "newPassword").SendKeys(newPassword); Find(id: "confirmPassword").SendKeys(newPassword); Find(css: "input[type=submit]").Click(); PageSource.ShouldContain("Password Changed"); Find(text: "Return to Home").Click(); Logout(); Login(withPassword: newPassword); PageSource.ShouldContain(user.Person.Name); PageSource.ShouldContain(user.Person.EmailAddress); }
public void PyScriptFormTest() { db.WriteContentText("jsondata", @"{'Records':[ { 'Id': 1, 'Name': 'John Adams', 'City': 'Boston', 'Work': 'attorney' }, { 'Id': 2, 'Name': 'Betsy Ross', 'City': 'Philadelphia', 'Work': 'seamstress' } ]}"); db.WriteContentPython("record", R.PyScriptFormTest); LoginAsAdmin(); Open($"{rootUrl}PyScriptForm/Record/display/2"); PageSource.ShouldContain("Philadelphia"); Find(id: "submitit").Click(); WaitForElement("input[name=City]"); Find(name: "City").Clear(); Find(name: "City").SendKeys("New York"); Find(id: "submitit").Click(); PageSource.ShouldContain("New York"); /* need a new data context * since changes were made in another process * and the values will still be cached in the current data context */ db = CMSDataContext.Create(DatabaseFixture.Host); var json = db.ContentText("jsondata", null); json.ShouldContain("New York"); }
public ParsePage VerifyMethodPageSourceNextAmp(ListingType mode) { if (mode != ListingType.Share) { VerifyRobotsPresentWithNoIndexFollow(); VerifyCanonicalNotPresent(); } else { VerifyCanonicalPresent(); VerifyRobotsPresentWithNoIndexNoFollow(); } if (Url.Contains("&")) { var url1 = Url.Replace("&", "&"); PageSource.ShouldContain("<link rel=\"next\" href=\"" + url1 + "&page=2\""); //RB: Checking next link } else { VerifyNextAmp(); } return(this); }
//[Theory, FeatureTest] //[InlineData(320)] //[InlineData(425)] //[InlineData(768)] //Disabled until we can fix the flakiness public void Should_Open_Datepicker_On_Mobile_Resolutions(int width) { var window = driver.Manage().Window; window.Size = new Size(width, window.Size.Height); username = RandomString(); password = RandomString(); string roleName = "role_" + RandomString(); var user = CreateUser(username, password, roles: new string[] { "Access", "Edit", "Admin", "Finance" }); Login(); Open($"{rootUrl}Bundle/Edit/{new FinanceTestUtils(db).BundleHeader.BundleHeaderId}"); Wait(10); PageSource.ShouldContain("Contribution Bundle"); Check_If_DateTimePicker_Exists("Bundle_ContributionDate"); Open($"{rootUrl}Person2/{user.PeopleId}"); Wait(10); WaitForElement(css: ".edit-basic"); WaitForElementToDisappear(loadingUI); Find(css: ".edit-basic").Click(); Wait(5); ScrollTo(id: "WeddingDate"); Check_If_DateTimePicker_Exists("WeddingDate"); }
public void PythonSearchNamesTest() { var person = LoginAsAdmin().Person; Open($"{rootUrl}PythonSearch/Names?term={person.FirstName.Truncate(4)} {person.LastName.Truncate(4)}"); PageSource.ShouldContain($"{person.LastName}, {person.FirstName}"); }
public ParsePage VerifyCanonicalToDesktopListingAddressPresent(string address) { var desktopListingUrl = ConfigurationHelper.DomainWebServer + "/" + address + "-" + Regex.Match(Url, @"\d+").Value; PageSource.ShouldContain("link rel=\"canonical\" href=\"" + desktopListingUrl + "\""); return(this); }
public ParsePage VerifyRobotsPresentWithNoIndexNoFollow() { PageSource.ShouldContain("meta name=\"robots\" content=\"NOINDEX, NOFOLLOW\""); PageSource.ShouldNotContain("meta name=\"robots\" content=\"NOINDEX, FOLLOW\""); PageSource.ShouldNotContain("meta name=\"robots\" content=\"INDEX, NOFOLLOW\""); return(this); }
public void RunScriptTest() { LoginAsAdmin(); db.WriteContentSql("TestSql", "select 'Hello World'"); Open($"{rootUrl}RunScript/TestSql"); PageSource.ShouldContain("Hello World"); }
public void PyScriptFormTest() { db.WriteContentText("jsondata", @"{""Records"":[ { ""Id"": 1, ""Name"": ""John Adams"", ""City"": ""Boston"", ""Work"": ""attorney"" }, { ""Id"": 2, ""Name"": ""Betsy Ross"", ""City"": ""Philadelphia"", ""Work"": ""seamstress"" } ]}"); db.WriteContentPython("record", R.PyScriptFormTest); LoginAsAdmin(); Open($"{rootUrl}PyScriptForm/Record/display/2"); PageSource.ShouldContain("Philadelphia"); Find(id: "submitit").Click(); Wait(3); Find(name: "City").Clear(); Find(name: "City").SendKeys("New York"); Find(id: "submitit").Click(); PageSource.ShouldContain("New York"); /* need a new data context * since changes were made in another process * and the values will still be cached in the current data context */ db = CMSDataContext.Create(DatabaseFixture.Host); var json = db.ContentText("jsondata", null); json.ShouldContain("New York"); }
public void Should_Show_PushpayFundName_Field() { username = RandomString(); password = RandomString(); var user = CreateUser(username, password, roles: new string[] { "Admin", "Edit", "Access", "Checkin" }); Login(); var org = CreateOrganization(); org.RegistrationTypeId = 1; //Join Organization db.SubmitChanges(); var gatewayAccount = MockGateways.CreateSaveGatewayAccount(db, GatewayTypes.Pushpay); var process = db.PaymentProcess.FirstOrDefault(p => p.ProcessId == (int)PaymentProcessTypes.OnlineRegistration); process.GatewayAccountId = gatewayAccount.GatewayAccountId; db.SubmitChanges(); Open($"{rootUrl}Org/{org.OrganizationId}#tab-Registrations-tab"); WaitForElement("#Registrations-tab"); Wait(4); Find(text: "Fees").Click(); WaitForElement(css: "#Fees h4:nth-child(3)"); PageSource.ShouldContain("Pushpay Fund Name"); }
public void Create_Role_Test() { username = RandomString(); password = RandomString(); string roleName = "role_" + RandomString(); var user = CreateUser(username, password, roles: new string[] { "Access", "Edit", "Admin" }); Login(); Open($"{rootUrl}Lookups/"); PageSource.ShouldContain("Lookup Codes"); Find(text: "Roles").Click(); CurrentUrl.ShouldBe($"{rootUrl}Roles"); RepeatUntil(() => Find(css: ".box-tools button[type=submit]")?.Click(), condition: () => Find(id: "RoleName.NEW") != null); var newRole = Find(id: "RoleName.NEW"); ScrollTo(newRole); RepeatUntil(() => newRole.Click(), condition: () => Find(css: ".editable-input input[type=text]") != null); Find(css: ".editable-input input[type=text]").Clear(); Find(css: ".editable-input input[type=text]").SendKeys(roleName); Find(css: ".editable-buttons button[type=submit]").Click(); Wait(2); var adminRole = db.Roles.SingleOrDefault(r => r.RoleName == "Admin"); var role = db.Roles.SingleOrDefault(r => r.RoleName == roleName); role.ShouldNotBeNull(); role.Priority.GetValueOrDefault().ShouldBeGreaterThan(adminRole.Priority.GetValueOrDefault()); }
public void PyscriptWithParameters() { LoginAsAdmin(); db.WriteContentPython("HelloWorld", "print 'parameters {} {}'.format(Data.p1, Data.p2)"); Open($"{rootUrl}PyScript/HelloWorld/testing/123"); PageSource.ShouldContain("parameters testing 123"); Open($"{rootUrl}PyScript/HelloWorld?p1=testing&p2=123"); PageSource.ShouldContain("parameters testing 123"); }
public ParsePage VerifyRobotsPresentWithIndexFollow() { PageSource.ShouldContain("meta name=\"robots\" content=\"index, follow\""); //RB: there is an issue with lower case, to be consistent it should be <meta name="robots" content="INDEX, FOLLOW" /> PageSource.ShouldNotContain("meta name=\"robots\" content=\"NOINDEX, NOFOLLOW\""); PageSource.ShouldNotContain("meta name=\"robots\" content=\"NOINDEX, FOLLOW\""); PageSource.ShouldNotContain("meta name=\"robots\" content=\"INDEX, NOFOLLOW\""); return(this); }
public void DbInQueryModelShouldBeInstantiatedByModelBinding() { username = RandomString(); password = RandomString(); CreateUser(username, password, roles: new[] { "Access", "Edit", "Admin" }); Login(); Open($"{rootUrl}QueryCode?code=Age>65"); WaitForElement("input[id=totcnt]"); PageSource.ShouldContain("David Carroll"); }
public void MyData_User_Logon_Fail_Test() { username = RandomString(); password = RandomString(); var user = CreateUser(); Login(withPassword: "******"); PageSource.ShouldContain("Logon Error!"); }
public ParsePage VerifyCanonicalPresent() { if (Url.Contains("?")) { var cutUrl = Url.Split('?'); Url = cutUrl[0]; PageSource.ShouldContain("link rel=\"canonical\" href=\"" + Url + "\""); //RB: Checking Canonical link } return(this); }
public ParsePage VerifyURLWithQuerySuburbCanonical() { if (Url.Contains("?")) { var cutUrl = Url.Replace("?suburb=", "").Trim(); Url = cutUrl; PageSource.ShouldContain("link rel=\"canonical\" href=\"" + Url + "\""); //RB: Checking Canonical link } return(this); }
public void MyData_User_Logon_Success_Test() { username = RandomString(); password = RandomString(); var user = CreateUser(); Login(); PageSource.ShouldContain(user.Person.Name); PageSource.ShouldContain(user.Person.EmailAddress); }
/// <summary> /// * This method will check for Sold, Sale, Rent /// and any URLwithout a query type('?' +query type): /// - If the canonical link is present /// - If the meta robots tag /// < NOINDEX, NOFOLLOW> /// is present /// - If the link for next page is present and in a correct format /// * Any pages which contains an URLs with a query type have to contain /// the meta robots tag /// < NOINDEX, FOLLOW> /// . /// * For any Share listings, the method will *not* check /// if the next link is present /// </summary> /// <param name="mode"></param> public ParsePage VerifyPageSource(ListingType mode) { if (mode != ListingType.Share) { if (Url.Contains("?")) { var cutUrl = Url.Split('?'); Url = cutUrl[0]; VerifyCanonicalPresent(); VerifyRobotsPresentWithNoIndexFollow(); PageSource.ShouldContain("<link rel=\"next\" href=\"" + Url + "?page=2\""); } else { if (Url.Contains("auction")) { Url = Url.Replace("http", "https"); VerifyCanonicalPresent(); VerifyRobotsNotPresent(); } else { VerifyCanonicalPresent(); if (Url.Contains("sold")) { VerifyRobotsPresentWithNoIndexFollow(); } else { VerifyRobotsNotPresent(); } PageSource.ShouldContain("<link rel=\"next\" href=\"" + Url + "?page=2\""); //RB: Checking next link } } } else { if (Url.Contains("?")) { var cutUrl = Url.Split('?'); Url = cutUrl[0]; VerifyCanonicalPresent(); VerifyRobotsPresentWithNoIndexFollow(); } else { VerifyCanonicalPresent(); VerifyRobotsNotPresent(); } } return(this); }
public void Column_Number_Out_Of_Range_Should_Show_Error() { CMSDataContext db = CMSDataContext.Create(DatabaseFixture.Host); var requestManager = FakeRequestManager.Create(); var controller = new CmsWeb.Areas.OnlineReg.Controllers.OnlineRegController(requestManager); var routeDataValues = new Dictionary <string, string> { { "controller", "OnlineReg" } }; controller.ControllerContext = ControllerTestUtils.FakeControllerContext(controller, routeDataValues); var FakeOrg = FakeOrganizationUtils.MakeFakeOrganization(requestManager, new CmsData.Organization() { OrganizationName = "MockName", RegistrationTitle = "MockTitle", Location = "MockLocation", RegistrationTypeId = RegistrationTypeCode.JoinOrganization }); OrgId = FakeOrg.org.OrganizationId; username = RandomString(); password = RandomString(); var user = CreateUser(username, password, roles: new string[] { "Edit", "Access" }); Login(); Wait(3); Open($"{rootUrl}Org/{OrgId}#tab-Registrations-tab"); WaitForElementToDisappear(loadingUI); Find(css: "#Questions-tab > .ajax").Click(); WaitForElementToDisappear(loadingUI); Find(css: ".row:nth-child(1) > .col-sm-12 .edit").Click(); WaitForElementToDisappear(loadingUI); Find(text: "Add Question").Click(); Wait(2); Find(text: "Checkboxes").Click(); Wait(2); Find(text: "Done").Click(); Wait(2); Find(css: ".confirm").Click(); Wait(2); Find(xpath: "//div[4]/div/div/input").SendKeys("5"); Find(text: "Save").Click(); Wait(2); PageSource.ShouldContain("The field Columns must be between 0 and 4."); }
public void Page_NotAuthorized_Test() { username = RandomString(); password = RandomString(); var user = CreateUser(); Login(); Open($"{rootUrl}Bundles"); PageSource.ShouldContain("Sign In"); }
public void Should_Display_No_CheckIn_Times() { username = RandomString(); password = RandomString(); string roleName = "role_" + RandomString(); var user = CreateUser(username, password, roles: new string[] { "Access", "Edit", "Admin" }); Login(); Open($"{rootUrl}CheckinTimes/"); PageSource.ShouldContain("no checkin times available"); }