Exemplo n.º 1
0
        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);
        }
Exemplo n.º 2
0
        public void OrgSearchByName(string searchString, int count)
        {
            List <Organization> orgList = new List <Organization>();

            for (int i = 0; i < count; i++)
            {
                string       orgName = searchString + " Organization Testing " + i.ToString();
                Organization org     = MockOrganizations.CreateOrganization(db, orgName);
                orgList.Add(org);
            }

            int?programId  = 0;
            int?divisionId = 0;
            int?typeId     = 0;
            int?campusId   = 0;
            int?scheduleId = 0;
            int?statusId   = 30;
            int?onlineReg  = -1;
            int?userId     = db.Users.Where(u => u.Username == "Admin").FirstOrDefault().UserId;
            int?tagDiv     = null;

            int expectedCount = orgList.Count();

            var actualCount = db.OrgSearch(searchString, programId, divisionId, typeId, campusId, scheduleId, statusId, onlineReg, userId, tagDiv);

            Assert.Equal(expectedCount, actualCount.Count());

            foreach (var item in orgList)
            {
                MockOrganizations.DeleteOrganization(db, item);
            }
        }
Exemplo n.º 3
0
        public void Should_Display_Correct_Class_Date()
        {
            username = RandomString();
            password = RandomString();
            string roleName = "role_" + RandomString();
            var    user     = CreateUser(username, password, roles: new string[] { "Access", "Edit", "Admin", "Checkin" });

            var org = MockOrganizations.CreateOrganization(db, RandomString());

            org.RegistrationTypeId = RegistrationTypeCode.JoinOrganization;
            db.SubmitChanges();

            var people = db.People.SingleOrDefault(p => p.PeopleId == user.PeopleId);
            var phone  = RandomPhoneNumber();

            people.CellPhone = phone;
            db.SubmitChanges();

            var currentDate     = DateTime.Now;
            var dayOfTheWeek    = currentDate.DayOfWeek.ToString();
            var datePlus30      = currentDate.AddMinutes(30);
            var strinDatePlus30 = $"{datePlus30.Hour}:{datePlus30.Minute} {datePlus30.ToString("tt", new CultureInfo("en-US"))}";

            Login();
            Wait(5);

            Open($"{rootUrl}OnlineReg/{org.OrganizationId}");
            Wait(4);
            Find(id: "otheredit").Click();
            Wait(2);
            Find(id: "submitit").Click();
            Wait(2);

            Open($"{rootUrl}Org/{org.OrganizationId}#tab-Settings-tab");
            Wait(7);

            Find(xpath: "//a[contains(@href, '#Attendance')]").Click();
            Wait(5);
            Find(css: ".pull-right:nth-child(1) > .edit").Click();
            Wait(5);
            Find(id: "addsch").Click();
            Wait(5);

            var dropdown      = Find(xpath: "//div[@id='schedules']/div/div/div/div/select");
            var selectElement = new SelectElement(dropdown);

            selectElement.SelectByText(dayOfTheWeek);

            Find(xpath: "//div[@id='schedules']/div/div/div[2]/div/div/input").Clear();
            Find(xpath: "//div[@id='schedules']/div/div/div[2]/div/div/input").SendKeys(strinDatePlus30);

            Find(xpath: "(//a[contains(text(),'Save')])[3]").Click();
            Wait(3);

            Find(xpath: "//a[contains(@href, '#CheckIn')]").Click();
            Wait(3);
            Find(xpath: "//div[@id='CheckIn']/form/div[2]/div[2]/div/div/div/label").Click();
            Find(xpath: "(//a[contains(text(),'Save')])[3]").Click();
            Wait(2);

            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);

            Find(name: "phone").SendKeys(phone);
            Find(name: "phone").SendKeys(Keys.Enter);

            PageSource.ShouldContain(strinDatePlus30);
        }