コード例 #1
0
        public void Should_Change_Payment_Methods()
        {
            MaximizeWindow();

            username = RandomString();
            password = RandomString();
            string roleName = "role_" + RandomString();
            var    user     = CreateUser(username, password, roles: new string[] { "Access", "Edit", "Admin" });

            FinanceTestUtils.CreateMockPaymentProcessor(db, PaymentProcessTypes.OnlineRegistration, GatewayTypes.Transnational);
            Login();

            OrgId = CreateOrgWithFee();

            SettingUtils.UpdateSetting("UseRecaptcha", "false");

            PayRegistration(OrgId, true);

            var startNewTransaction = Find(xpath: "//a[contains(text(),'Start a New Transaction')]");

            startNewTransaction.ShouldNotBeNull();

            var paymentInfo = db.PaymentInfos.SingleOrDefault(x => x.PeopleId == user.PeopleId);

            if (paymentInfo != null)
            {
                paymentInfo.PreferredPaymentType.ShouldBe("B");
            }
        }
コード例 #2
0
        public void Should_Payment_Form_Contain_NoRecaptcha()
        {
            MaximizeWindow();

            username = RandomString();
            password = RandomString();
            string roleName = "role_" + RandomString();
            var    user     = CreateUser(username, password, roles: new string[] { "Access", "Edit", "Admin" });

            FinanceTestUtils.CreateMockPaymentProcessor(db, PaymentProcessTypes.OnlineRegistration, GatewayTypes.Transnational);
            Login();

            OrgId = CreateOrgWithFee();

            SettingUtils.UpdateSetting("UseRecaptcha", "false");

            Open($"{rootUrl}OnlineReg/{OrgId}");

            Find(id: "otheredit").Click();
            WaitForElement("#submitit", 3);
            Find(id: "submitit").Click();

            Wait(4);

            var element = Find(css: ".noRecaptcha");

            element.ShouldNotBeNull();
        }
コード例 #3
0
        public void Should_Hide_Deceased_People()
        {
            username = RandomString();
            password = RandomString();

            var FamilyMember = FamilyUtils.CreateFamilyWithDeceasedMember();

            var user = CreateUser(username, password, person: FamilyMember);

            Login();

            SettingUtils.UpdateSetting("HideDeceasedFromFamily", "false");

            Open($"{rootUrl}Person2/{FamilyMember.PeopleId}");
            WaitForElement("#family_members", 10);

            var deceasedMember = Find(css: "#family_members > li.alert-danger");

            deceasedMember.ShouldNotBe(null);

            SettingUtils.UpdateSetting("HideDeceasedFromFamily", "true");

            Open($"{rootUrl}Person2/Current");
            WaitForElement("#family_members", 10);

            deceasedMember = Find(css: "#family_members > li.alert-danger");
            deceasedMember.ShouldBe(null);
        }
コード例 #4
0
        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\">");
        }
コード例 #5
0
        public void Should_Find_Transacionts()
        {
            MaximizeWindow();

            username = RandomString();
            password = RandomString();
            string roleName = "role_" + RandomString();
            var    user     = CreateUser(username, password, roles: new string[] { "Access", "Edit", "Admin" });

            FinanceTestUtils.CreateMockPaymentProcessor(db, PaymentProcessTypes.OnlineRegistration, GatewayTypes.Transnational);
            Login();

            OrgId = CreateOrgWithFee();

            SettingUtils.UpdateSetting("UseRecaptcha", "false");

            PayRegistration(OrgId, true);

            Open($"{rootUrl}Transactions/");

            var people = db.People.FirstOrDefault(p => p.PeopleId == user.PeopleId);

            Find(xpath: "//input[@id='name']").Clear();
            Find(xpath: "//input[@id='name']").SendKeys(people.FirstName);

            Find(xpath: "//form[@id='form']/div/div[2]/div[6]/div/div[2]/label").Click();
            Find(xpath: "//a[@id='filter']").Click();

            var element = Find(xpath: "//table[@id='resultsTable']/tbody/tr/td[7]");

            element.ShouldNotBeNull();
        }
コード例 #6
0
        public void Should_Exclude_In_Small_Group_Filter()
        {
            var SGFxml = SpecialContentUtils.CreateSpecialContent(1, "SGF-MockedXML.xml", null);

            SpecialContentId = SGFxml.Id;
            SpecialContentUtils.UpdateSpecialContent(SpecialContentId, SGFxml.Name, SGFxml.Name, "<?xml version=\"1.0\" encoding=\"utf-8\"?>  <SGF divisionid=\"30\" layout=\"SGF-Layout\" gutter=\"SGF-Gutter\">    <SGFSettings>     <SGFSetting name=\"SubmitText\" value=\"Find Groups\" />     <SGFSetting name=\"ShowHeaders\" value=\"true\" />     <SGFSetting name=\"TextSize\" value=\"18\" />     <SGFSetting name=\"FontFamily\" value=\"Verdana,Arial,Helvetica,sans-serif\" />     <SGFSetting name=\"BGColor\" value=\"#FFFFFF\" />     <SGFSetting name=\"FGColor\" value=\"#000000\" />  </SGFSettings>    <SGFFilters>     <SGFFilter name=\"SGF:Gender\" title=\"Gender\" locked=\"false\" lockedvalue=\"\" />     <SGFFilter name=\"SGF:Childcare\" title=\"Childcare\" locked=\"false\" lockedvalue=\"\" />     <SGFFilter name=\"SGF:Location\" title=\"Location\" locked=\"false\" lockedvalue=\"\" />     <SGFFilter name=\"Campus\" title=\"Church\" locked=\"false\" lockedvalue=\"\" exclude=\"Do Not Attend\" />  </SGFFilters>    </SGF>", null, null, null);

            SettingUtils.UpdateSetting("SGF-OrgTypes", "MockedOrgType, Do Not Attend");

            SmallGroupFinderModel m = new SmallGroupFinderModel();

            m.load("MockedXML");

            var filter = m.getFilterItems(3);

            filter[0].value.ShouldBe("-- All --");
        }
コード例 #7
0
        public void Should_Show_Pledge_Giving_Tab()
        {
            SettingUtils.UpdateSetting("CombinedGivingSummary", "false");

            username = RandomString();
            password = RandomString();
            var user = CreateUser(username, password);

            Login();

            Open($"{rootUrl}Person2/{user.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("#giving", 10);

            PageSource.ShouldContain("Contributions");
            PageSource.ShouldContain("Pledges");
        }
コード例 #8
0
        public void TestSearchBuilderOrgsDropdownOption()
        {
            const string finddivision = "input[type=radio][value$='First Division']";
            const string findorg      = "input[type=radio][value$='Online Giving']";
            const string settingname  = "ShowAllOrgsByDefaultInSearchBuilder";

            LoginAsAdmin();

            SettingUtils.DeleteSetting(settingname);
            WaitForPageLoad();
            DisplayOrgDropdowns();
            IsElementPresent(finddivision).ShouldBeTrue();
            IsElementPresent(findorg).ShouldBeTrue();

            SettingUtils.UpdateSetting(settingname, "false");
            WaitForPageLoad();
            DisplayOrgDropdowns();
            IsElementPresent(finddivision).ShouldBeFalse();
            IsElementPresent(findorg).ShouldBeFalse();
        }
コード例 #9
0
        public void Relaxed_Questions_Should_Not_Be_Visible()
        {
            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();

            SettingUtils.UpdateSetting("RelaxedReqAdminOnly", "true");

            Open($"{rootUrl}Org/{OrgId}#tab-Registrations-tab");
            WaitForElementToDisappear(loadingUI);

            Find(css: "#Registration > form > div.row > div:nth-child(2) > div > a.btn.edit.ajax.btn-primary").Click();
            WaitForElementToDisappear(loadingUI);

            var inputDOB = Find(id: "ShowDOBOnFind");

            inputDOB.ShouldBeNull();
        }
コード例 #10
0
        public void Should_Hide_Giving_Tab()
        {
            SettingUtils.UpdateSetting("HideGivingTabMyDataUsers", "false");

            username = RandomString();
            password = RandomString();
            var user = CreateUser(username, password);

            Login();

            Open($"{rootUrl}Person2/{user.PeopleId}");
            WaitForElement(".active:nth-child(2) > a", 10);
            PageSource.ShouldContain("<a href=\"#giving\" aria-controls=\"giving\" data-toggle=\"tab\">Giving</a>");

            SettingUtils.UpdateSetting("HideGivingTabMyDataUsers", "true");

            Open($"{rootUrl}Person2/Current"); //refresh page
            WaitForElement(".active:nth-child(2) > a", 5);
            PageSource.ShouldNotContain("<a href=\"#giving\" aria-controls=\"giving\" data-toggle=\"tab\">Giving</a>");

            SettingUtils.DeleteSetting("HideGivingTabMyDataUsers");
        }
コード例 #11
0
        public void Should_RetrieveBatchDates_With_No_Date()
        {
            MaximizeWindow();

            username = RandomString();
            password = RandomString();
            string roleName = "role_" + RandomString();
            var    user     = CreateUser(username, password, roles: new string[] { "Access", "Edit", "Admin" });

            FinanceTestUtils.CreateMockPaymentProcessor(db, PaymentProcessTypes.OnlineRegistration, GatewayTypes.Acceptiva);
            Login();
            Wait(3);
            OrgId = CreateOrgWithFee();
            SettingUtils.UpdateSetting("UseRecaptcha", "false");
            SettingUtils.UpdateSetting("AutomaticSettle", "true");
            SettingUtils.UpdateSetting("AutoSyncBatchDates", "true");
            SettingUtils.UpdateSetting("AutoSyncBatchDatesWindow", "10");
            PayRegistration(OrgId);

            db.RetrieveBatchData(testing: true);
            var transaction = db.Transactions.FirstOrDefault(t => t.OrgId == OrgId);

            transaction.Settled.ShouldNotBeNull();
        }
コード例 #12
0
        public void New_Resources_Should_Be_Displayed()
        {
            SettingUtils.UpdateSetting("Resources-Enabled", "true");

            username = RandomString();
            password = RandomString();

            Role roleManageResources = db.Roles.Where(x => x.RoleName == "ManageResources").SingleOrDefault();

            if (roleManageResources == null)
            {
                roleManageResources = new Role {
                    RoleName = "ManageResources"
                };
                db.Roles.InsertOnSubmit(roleManageResources);
                db.SubmitChanges();
            }

            Role roleViewResources = db.Roles.Where(x => x.RoleName == "ViewResources").SingleOrDefault();

            if (roleViewResources == null)
            {
                roleViewResources = new Role {
                    RoleName = "ViewResources"
                };
                db.Roles.InsertOnSubmit(roleViewResources);
                db.SubmitChanges();
            }

            var user = CreateUser(username, password, roles: new string[] { "Access", "Edit", "Admin", "ManageResources", "ViewResources" });

            Login();

            using (var db = CMSDataContext.Create(Util.Host))
            {
                var ResourceType = new ResourceType()
                {
                    Name         = "MockResourceType",
                    DisplayOrder = 0
                };
                db.ResourceTypes.InsertOnSubmit(ResourceType);
                db.SubmitChanges();

                var ResourceCategory = new ResourceCategory()
                {
                    Name           = "MockResourceCategory",
                    ResourceTypeId = ResourceType.ResourceTypeId,
                    DisplayOrder   = 0
                };
                db.ResourceCategories.InsertOnSubmit(ResourceCategory);
                db.SubmitChanges();
            }

            Open($"{rootUrl}Resources");
            WaitForElement("#addresource", maxWaitTimeInSeconds: 5);

            Find(id: "addresource").Click();
            WaitForElement("#Name", maxWaitTimeInSeconds: 5);

            Find(id: "Name").Clear();
            Find(id: "Name").SendKeys("MockResource");
            Find(css: "#new-resource-modal>div>form>div.modal-footer>a.btn.btn-primary.validate.submit").Click();

            Open($"{rootUrl}Person2/1#tab-resources");
            WaitForElement(css: "#resources>ul>li>a", maxWaitTimeInSeconds: 5);

            PageSource.ShouldContain("MockResource");
        }