Ejemplo n.º 1
0
        public void Giving_Setup_SubFunds_NotAllow_Delete()
        {
            // Set initial conditions
            string fundName    = "A Test Fund - SF:D";
            string subFundName = "A Test Sub Fund - Delete";

            base.SQL.Giving_SubFunds_Delete(15, fundName, subFundName);
            base.SQL.Giving_Funds_Delete(15, fundName);
            base.SQL.Giving_Funds_Create(15, fundName, true, "SF:U", 1, true, "DC");
            base.SQL.Giving_SubFunds_Create(15, fundName, subFundName, "TSF-D", true, "GL", true);

            string individulaName = "FT Tester";
            int    individualId   = base.SQL.People_Individuals_FetchID(15, individulaName);
            double amountCC       = 10.01;

            //Updated by Jim
            DateTime now = TimeZoneInfo.ConvertTimeFromUtc(DateTime.UtcNow, TimeZoneInfo.FindSystemTimeZoneById("Central Standard Time"));

            // Login to portal
            TestBaseWebDriver test = base.TestContainer[Gallio.Framework.TestContext.CurrentContext.Test.Name];

            try
            {
                test.Portal.LoginWebDriver("ft.tester", "FT4life!", "DC");


                // Store variables
                var startDay   = now.Day.ToString();
                var startMonth = now.ToString("MMMM");


                // Create scheduled contribution
                test.Portal.Giving_ContributorDetails_Schedules_CreditCard_Monthly_WebDriver("FT Tester", fundName, subFundName, amountCC.ToString(), startDay, startMonth, now.AddYears(1).Year.ToString(), null, null,
                                                                                             "FT", "Tester", "Visa", "4111111111111111", "12 - December", now.AddYears(1).Year.ToString());

                // Navigate to giving->sub funds
                test.GeneralMethods.Navigate_Portal(Navigation.Portal.Giving.Setup.Sub_Funds);

                // Delete the sub fund
                int itemRow = test.GeneralMethods.GetTableRowNumberWebDriver(TableIds.Portal.Giving_SubFunds, subFundName, "Sub Fund Name", null);
                test.Driver.FindElementById(TableIds.Portal.Giving_SubFunds).FindElements(By.TagName("tr"))[itemRow].FindElements(By.TagName("td"))[7].FindElement(By.TagName("a")).Click();

                // Click 'Yes' at the confirmation
                test.GeneralMethods.Popups_ConfirmationWebDriver("Yes");


                // Verify the dialog prompting the subfund cannot be deleted comes up
                var handler = test.Driver.CurrentWindowHandle;


                test.Driver.SwitchTo().Window("MessageBoxWindow");


                // string actualText = test.Driver.FindElementById("divMessage").Text.ToString();

                Assert.AreEqual(Regex.IsMatch(test.Driver.FindElementById("divMessage").Text.ToString(), "The Sub Fund " + "\"A Test Sub Fund - Delete\"" + " has one or more dependent items and therefore could not be deleted."), true);

                test.Driver.FindElementByXPath("*//body/*//input[@value='OK']").Click();

                test.Driver.SwitchTo().Window(handler);
                // Verify sub fund was not deleted
                Assert.IsTrue(test.GeneralMethods.ItemExistsInTableWebDriver(TableIds.Portal.Giving_SubFunds, subFundName, "Sub Fund Name", null));
            }


            finally
            {
                base.SQL.Giving_ScheduledContributions_Delete_PortalORWeblink(15, individualId, 10.01, 1);
                base.SQL.Giving_SubFunds_Delete(15, fundName, subFundName);
                base.SQL.Giving_Funds_Delete(15, fundName);

                // Logout of portal
                test.Portal.LogoutWebDriver();
            }
        }
Ejemplo n.º 2
0
        public void Dashboard_Setting_Giving_ReportRights_Show()
        {
            TestBaseWebDriver test    = base.TestContainer[Gallio.Framework.TestContext.CurrentContext.Test.Name];
            GeneralMethods    utility = test.GeneralMethods;

            int churchId = test.SQL.FetchChurchID(test.Dashboard.ChurchCode);
            int userId   = test.SQL.User_FetchID(churchId, test.Dashboard.DashboardEmail, test.Dashboard.DashboardUsername);

            try
            {
                test.Portal.LoginWebDriver(test.Dashboard.DashboardUsername, test.Dashboard.DashboardPassword, test.Dashboard.ChurchCode);

                test.Dashboard.uncheckAllRoles(userId);
                test.Dashboard.checkAccessRight(userId, "Contribution");
                test.Dashboard.uncheckAccessRight(userId, "Contributor Visibility");
                test.Dashboard.uncheckAccessRight(userId, "Contributor Summaries");
                test.Portal.LogoutWebDriver();
                test.Dashboard.LoginWebDriver();
                new DashboardHomePage(test.Driver, test.GeneralMethods).openSettingsPage();
                DashboardSettingsPage settings = new DashboardSettingsPage(test.Driver, test.GeneralMethods, test.SQL);
                //verify giving widget is shown
                Assert.IsTrue(settings.getWidgetName(1).ToLower().Contains("giving"));
                settings.turnOnWidget(1);

                test.Driver.Manage().Cookies.DeleteAllCookies();
                test.Portal.LoginWebDriver(test.Dashboard.DashboardUsername, test.Dashboard.DashboardPassword, test.Dashboard.ChurchCode);
                test.Dashboard.checkAccessRight(userId, "Contributor Visibility");
                test.Dashboard.uncheckAccessRight(userId, "Contribution");
                test.Portal.LogoutWebDriver();
                //test.Dashboard.LoginWebDriver();
                test.Dashboard.OpenLoginWebDriver();
                new DashboardHomePage(test.Driver, test.GeneralMethods).openSettingsPage();
                Assert.IsTrue(settings.getWidgetName(1).ToLower().Contains("giving"));

                test.Driver.Manage().Cookies.DeleteAllCookies();
                test.Portal.LoginWebDriver(test.Dashboard.DashboardUsername, test.Dashboard.DashboardPassword, test.Dashboard.ChurchCode);
                test.Dashboard.checkAccessRight(userId, "Contributor Summaries");
                test.Dashboard.uncheckAccessRight(userId, "Contributor Visibility");
                test.Portal.LogoutWebDriver();
                //test.Dashboard.LoginWebDriver();
                test.Dashboard.OpenLoginWebDriver();
                new DashboardHomePage(test.Driver, test.GeneralMethods).openSettingsPage();
                Assert.IsTrue(settings.getWidgetName(1).ToLower().Contains("giving"));

                test.Driver.Manage().Cookies.DeleteAllCookies();
                test.Portal.LoginWebDriver(test.Dashboard.DashboardUsername, test.Dashboard.DashboardPassword, test.Dashboard.ChurchCode);
                test.Dashboard.checkAccessRight(userId, "Contribution");
                test.Dashboard.checkAccessRight(userId, "Contributor Visibility");
                //test.Dashboard.checkAccessRight(userId, "Contributor Summaries");
                test.Portal.LogoutWebDriver();
                test.Dashboard.OpenLoginWebDriver();
                new DashboardHomePage(test.Driver, test.GeneralMethods).openSettingsPage();
                Assert.IsTrue(settings.getWidgetName(1).ToLower().Contains("giving"));
            }
            finally
            {
                //clear test data
                test.Driver.Manage().Cookies.DeleteAllCookies();
                test.Portal.LoginWebDriver(test.Dashboard.DashboardUsername, test.Dashboard.DashboardPassword, test.Dashboard.ChurchCode);
                test.Dashboard.checkAllRoles(userId);
            }
        }
Ejemplo n.º 3
0
        public void ForgotPassword_Successs()
        {
            // Login to portal
            TestBaseWebDriver test = base.TestContainer[Gallio.Framework.TestContext.CurrentContext.Test.Name];

            string forgotPasswordURL = string.Format("{0}{1}", test.API.GetAPIURL(), "accounts/forgotpassword");

            test.GeneralMethods.OpenURLWebDriver(forgotPasswordURL);

            //Setup
            string emailAddr = "*****@*****.**";
            string password  = "******";
            string _fromAddr = "*****@*****.**";

            string[] _recipients = new string[] { "Test Email" };


            //Enter Valid Account Email
            test.Driver.FindElement(By.Name("email")).SendKeys(emailAddr);

            //Reset password
            test.Driver.FindElement(By.CssSelector("[class='btn input-large']")).Click();
            string emailTimeStamp = TimeZoneInfo.ConvertTimeFromUtc(DateTime.UtcNow, TimeZoneInfo.FindSystemTimeZoneById("Central Standard Time")).ToString("HH:mm");

            //Verify that we sent e-mail
            test.GeneralMethods.WaitForElement(test.Driver, By.CssSelector("[class='alert alert-success']"));
            test.GeneralMethods.VerifyTextPresentWebDriver(emailAddr);

            // Retrieve Email
            string emailSubject = "Change Password Request: Dynamic Church";
            string emailBody    = "A password change was requested for this email address, please navigate to the address below to create a new password.";

            Message grpMsg = test.Portal.Retrieve_Search_Email(emailAddr, password, emailBody);

            test.Portal.Verify_Sent_Email(grpMsg, emailSubject, _fromAddr, "", _recipients, emailBody);

            //Email body (link subject to changes)
            // A password change was requested for this email address, please navigate to the address below to create a new password.
            //https://dc.staging.fellowshiponeapi.com/v1/Accounts/ResetPassword/4392fab3943a4121a809b7e29f18202e
            //Thank you.

            TestLog.WriteLine("Enivornment: " + this.F1Environment.ToString());

            string resetUrl = test.Portal.Get_URL_Email_Body(grpMsg.BodyHtml.Text);

            TestLog.WriteLine("Reset URL: " + resetUrl);
            test.GeneralMethods.OpenURLWebDriver(resetUrl);

            //Are we there yet?
            test.GeneralMethods.WaitForElement(test.Driver, By.Name("password"));

            // Reset Password page
            test.Driver.FindElement(By.Name("password")).SendKeys(password);
            test.Driver.FindElement(By.Name("password-confirm")).SendKeys(password);

            //Reset password
            test.Driver.FindElement(By.CssSelector("[class='btn input-full']")).Click();

            test.GeneralMethods.WaitForElement(test.Driver, By.CssSelector("[class='alert alert-success']"));
            //test.GeneralMethods.VerifyElementDisplayedWebDriver(By.CssSelector("[class='alert alert-success']"));
            test.GeneralMethods.VerifyTextPresentWebDriver("Reset Password");
            test.GeneralMethods.VerifyTextPresentWebDriver("You have successfully updated your password!");

            test.Driver.Close();
        }
Ejemplo n.º 4
0
        public void People_Search_FindAPerson_ViewIndividual_CreateAttributeItem()
        {
            TestBaseWebDriver test       = base.TestContainer[Gallio.Framework.TestContext.CurrentContext.Test.Name];
            string            churchCode = "QAEUNLX0C2";
            int churchId = test.SQL.FetchChurchID(churchCode);

            string individualAttributeGroupName = "Attribute Group FO-7291";
            string individualAttributeName      = "Individual Attribute FO-7291";

            base.SQL.Admin_IndividualAttributeGroups_Delete(churchId, individualAttributeGroupName);
            base.SQL.Admin_IndividualAttributes_Delete(churchId, individualAttributeGroupName, individualAttributeName);
            base.SQL.Admin_IndividualAttributeGroups_Create(churchId, individualAttributeGroupName, true);
            base.SQL.Admin_IndividualAttributes_Create(churchId, individualAttributeGroupName, individualAttributeName, false, false, true, false, true);

            try
            {
                test.Portal.LoginWebDriver("ft.tester", "FT4life!", churchCode);

                // View an individual
                test.Portal.People_ViewIndividual_WebDriver("Madysen Freemen");

                TestLog.WriteLine("Click to add an attribute");
                test.Driver.FindElementByXPath(".//div[@id='ind_attributes']/div/a").Click();
                test.GeneralMethods.WaitForElementDisplayed(By.Id("ddlAttribute"));

                TestLog.WriteLine("Select options to the attribute");
                new SelectElement(test.Driver.FindElementById("ddlAttribute")).SelectByText(individualAttributeName);
                test.GeneralMethods.WaitForElementEnabled(By.Id("individual_attribute_end_date"));

                string endTime = TimeZoneInfo.ConvertTimeFromUtc(DateTime.UtcNow, TimeZoneInfo.FindSystemTimeZoneById("Central Standard Time")).AddYears(1).ToString("MM/dd/yyyy");
                test.Driver.FindElementById("individual_attribute_end_date").SendKeys(endTime);

                TestLog.WriteLine("Click to save the attribute item");
                test.Driver.FindElementByCssSelector("input[value=\"Add attribute\"]").Click();
                test.GeneralMethods.WaitForElementDisplayed(By.LinkText(individualAttributeGroupName));

                TestLog.WriteLine("Click on the attribute group to expand it");
                test.Driver.FindElementByLinkText(individualAttributeGroupName).Click();

                TestLog.WriteLine("Check display of the attribute item");
                test.GeneralMethods.WaitForElementDisplayed(By.XPath(String.Format("//span[contains(text(), '{0}')]", individualAttributeName)));
                bool isLabel = test.GeneralMethods.IsElementExist(By.XPath(String.Format("//span[contains(text(), 'Ends:')]")));
                bool isDate  = test.GeneralMethods.IsElementExist(By.XPath(String.Format("//div[contains(text(), '{0}')]", endTime)));

                TestLog.WriteLine("Delete the attribute");
                test.Driver.FindElementByCssSelector("a[class=\"delete float_right\"]").Click();
                test.Driver.SwitchTo().Alert().Accept();
                TestLog.WriteLine("Wait for the attribute group is gone");
                test.GeneralMethods.WaitForElementInexistent(test.Driver, By.LinkText(individualAttributeGroupName));

                Assert.IsTrue(isLabel && isDate, "Either end label or date isn't display correctly.");
            }
            finally
            {
                // Logout of Portal
                test.Portal.LogoutWebDriver();

                TestLog.WriteLine("Delete the attribute group from DB");
                base.SQL.Admin_IndividualAttributeGroups_Delete(churchId, individualAttributeGroupName);
                base.SQL.Admin_IndividualAttributes_Delete(churchId, individualAttributeGroupName, individualAttributeName);
            }
        }
        public void Portal_EventRegistration_ViewSubmissions_Verify_Resent_Email()
        {
            string mailBox = EmailMailBox.GMAIL.INBOX;
            string confirmationEmailAddr = "*****@*****.**";
            string ccEmailAddr           = "*****@*****.**";
            string password = "******";

            string individualName   = "Matthew Sneeden";
            string formName         = "A Test Form";
            string paymentMethod    = "American Express";
            string creditCardNumber = "378282246310005";
            string date             = TimeZoneInfo.ConvertTimeFromUtc(DateTime.UtcNow, TimeZoneInfo.FindSystemTimeZoneById("Central Standard Time")).ToString("M/d/yyyy");
            double amount           = 2.00;

            // Login to portal
            TestBaseWebDriver test = base.TestContainer[Gallio.Framework.TestContext.CurrentContext.Test.Name];

            test.Portal.LoginWebDriver("ft.tester", "FT4life!", "DC");

            // Commented out by Mady, replaced with code below it. Weblink process is changed to Infellowship in Portal - Add submission
            // Generate a form submisssion
            // string[] confirmRefNum = test.Portal.Weblink_ViewSubmissions_Register(individualName, formName, paymentMethod, "2.00", "DC", false, false, creditCardNumber, false, confirmationEmailAddr, ccEmailAddr);

            test.Portal.Weblink_ViewSubmissions_OpenRegisterWindow(individualName, formName);
            string confirmCode = Infellowship_Reigster(test, new string[] { individualName }, new List <string>()
            {
                individualName
            }, paymentMethod, false, confirmationEmailAddr, ccEmailAddr);

            test.Portal.WebLink_ViewSubmissions_VerifyNewSubmission(formName, confirmCode, individualName, "DC", paymentMethod, "2.00", false);

            string referenceNumber = test.SQL.WebLink_FetchEventRegistrationReference(15, amount, paymentMethod, confirmCode);

            //Send e-mail through view submission
            test.Portal.Weblink_ViewSubmissions_ProcessEmailReceipt(confirmCode, referenceNumber, individualName, date,
                                                                    confirmationEmailAddr);

            // Logout of portal
            test.Portal.LogoutWebDriver();

            //Retrieve Confirmation Email was sent
            MessageCollection msgs = test.Portal.Retrieve_Email(mailBox, EmailMailBox.SearchParse.ALL, confirmationEmailAddr, password);

            //We should only have one e-mail
            int msgCount = test.Portal.Count_Weblink_Confirmation_Email(msgs, confirmCode);

            if (msgCount == 0)
            {
                //Go to SPAM
                mailBox  = EmailMailBox.GMAIL.SPAM;
                msgs     = test.Portal.Retrieve_Email(mailBox, EmailMailBox.SearchParse.ALL, confirmationEmailAddr, password);
                msgCount = test.Portal.Count_Weblink_Confirmation_Email(msgs, confirmCode);
            }

            Assert.AreEqual(msgCount, 1, string.Format("More than/Less Than one [{0}] Confirmation Email for Event Registration [{1}] was sent", msgs.Count, confirmCode));

            //Verify Confirmation email was delivered
            Message email = test.Portal.Search_Weblink_Confirmation_Email(msgs, confirmCode);

            //Verify Info in Email
            test.Portal.Verify_Weblink_Confirmation_Email(email, "*****@*****.**", confirmCode, referenceNumber,
                                                          individualName, formName, amount, date, creditCardNumber);


            //Verify CC Confirmation email was not delivered
            Message email2 = test.Portal.Retrieve_Search_Email(ccEmailAddr, password, confirmCode);

            //Verify No CC Email was found
            Assert.IsNull(email2, string.Format("Confirmation CC Email for Event Registration [{0}] was sent", confirmCode));
        }
Ejemplo n.º 6
0
        public void People_Search_FindAPerson_ViewIndividual_AddAnAddress_InteractionRequired2()
        {
            // Set initial conditions
            string address1 = "11774 SW Swendon Loop";

            base.SQL.People_Addresses_Delete(15, base.SQL.IndividualID, address1);

            // Login to portal
            TestBaseWebDriver test = base.TestContainer[Gallio.Framework.TestContext.CurrentContext.Test.Name];

            test.Portal.LoginWebDriver("msneeden", "Pa$$w0rd", "dc");

            // View an individual
            test.Portal.People_ViewIndividual_WebDriver("Matthew Sneeden");

            // Add an address
            string addressType = "Secondary";

            test.Portal.People_AddAddress("Matthew Sneeden (Head)", addressType, null, address1, null, "Eugene", "Oregon", "97223", null, null);

            // Verify user is prompted for city change
            test.GeneralMethods.WaitForElement(test.Driver, By.TagName("html"));
            Assert.IsTrue(test.Driver.FindElementByTagName("html").Text.Contains("According to the United States Postal Service, the address you entered does not match the data on record for this location. Please either choose the suggested address, or continue with the one you originally entered."));

            Assert.IsFalse(test.Driver.FindElementByTagName("html").Text.Contains("11774 SW Swendon Loop Tigard"));
            Assert.IsTrue(test.Driver.FindElementByTagName("html").Text.Contains(address1));
            Assert.IsTrue(test.Driver.FindElementByTagName("html").Text.Contains("Portland, OR 97223-1603"));

            // Select the address and proceed
            test.Driver.FindElementByXPath("//div[@id='main_content']/div[1]/div[2]/div[1]/div[2]/form/p/input").Click();

            // Verify the address was created
            // Verify the address was created
            test.GeneralMethods.WaitForElement(test.Driver, By.TagName("html"));
            Assert.IsTrue(test.Driver.FindElementByTagName("html").Text.Contains(addressType));
            Assert.IsTrue(test.Driver.FindElementByTagName("html").Text.Contains(address1));
            Assert.IsTrue(test.Driver.FindElementByTagName("html").Text.Contains("Portland, OR 97223-1603"));
            Assert.IsTrue(test.Driver.FindElementByTagName("html").Text.Contains("Last Updated: Today"));

            // Logout of portal
            test.Portal.LogoutWebDriver();
            //test.GeneralMethods.WaitForElement(test.Driver, By.ClassName("addresses"));
            //Boolean isFound = false;
            //int index = 1;

            //try
            //{
            //    while (test.Driver.FindElementByXPath(String.Format("//div[@class='addresses']/ul/li[{0}]/div/div/div[1]", index)) != null)
            //    {
            //        try
            //        {
            //            if (test.Driver.FindElementByXPath(String.Format("//div[@class='addresses']/ul/li[{0}]/div/strong", index)).Text.Equals(addressType))
            //            {
            //                if (test.Driver.FindElementByXPath(String.Format("//div[@class='addresses']/ul/li[{0}]/div/div/div[1]", index)).Text.Equals(address1))
            //                {
            //                    Assert.IsTrue(test.Driver.FindElementByXPath(String.Format("//div[@class='addresses']/ul/li[{0}]/div/div/div[2]", index)).Text.Equals("Portland, OR 97223-1603"), "Address 2 isn't display well");
            //                    Assert.IsTrue(test.Driver.FindElementByXPath(String.Format("//div[@class='addresses']/ul/li[{0}]/div/small", index)).Text.Equals("Last Updated: Today"), "Last Updated time is wrong");
            //                    isFound = true;
            //                    break;
            //                }
            //            }
            //        }
            //        catch (OpenQA.Selenium.NoSuchElementException e) { }

            //        TestLog.WriteLine("Tested address with index: " + index);
            //        index++;
            //    }
            //}
            //catch (OpenQA.Selenium.NoSuchElementException e) { }
            //finally
            //{
            //    // Logout of portal
            //    test.Portal.LogoutWebDriver();

            //    Assert.IsTrue(isFound, "Failed to find new addresses are display well");
            //}
        }
Ejemplo n.º 7
0
        public void People_Search_FindAPerson_Suffix()
        {
            TestBaseWebDriver test = null;

            // Set initial conditions
            string address1       = "1704 S Milbrook Ln";
            string individualName = "Visitor Sneeden";

            try
            {
                base.SQL.People_Addresses_Delete(15, base.SQL.People_Individuals_FetchID(15, individualName), address1);
            }
            catch (Exception e)
            {
                // Login to portal
                test = base.TestContainer[Gallio.Framework.TestContext.CurrentContext.Test.Name];
                test.Portal.LoginWebDriver("msneeden", "Pa$$w0rd", "dc");

                TestLog.WriteLine(e + " happened. Removing suffix");

                // View the individual
                test.Portal.People_ViewIndividual_WebDriver(individualName);

                // Remove the suffix from the individual
                test.Driver.FindElementByXPath(Portal.People.SearchConstants.Edit_individual).Click();
                test.GeneralMethods.WaitForElement(test.Driver, By.Id("ctl00_ctl00_MainContent_content_ctlIndividualFull_txtSuffix"), 20);
                test.Driver.FindElementById("ctl00_ctl00_MainContent_content_ctlIndividualFull_txtSuffix").Clear();
                test.Driver.FindElementById(GeneralButtons.Save).Click();

                test.GeneralMethods.WaitForElement(test.Driver, By.LinkText("Back"));
                test.Driver.FindElementByLinkText("Back").Click();
                test.GeneralMethods.WaitForElement(test.Driver, By.LinkText("sign out"));

                // Logout of portal
                test.Portal.LogoutWebDriver();

                base.SQL.People_Addresses_Delete(15, base.SQL.People_Individuals_FetchID(15, individualName), address1);
            }

            // Login to portal
            if (test == null)
            {
                test = base.TestContainer[Gallio.Framework.TestContext.CurrentContext.Test.Name];
            }

            test.Portal.LoginWebDriver("msneeden", "Pa$$w0rd", "dc");

            // View an individual
            TestLog.WriteLine("View " + individualName);
            test.Portal.People_ViewIndividual_WebDriver(individualName);

            // Edit the individual to add a suffix
            test.GeneralMethods.WaitForElement(test.Driver, By.TagName("html"));
            Assert.IsTrue(test.Driver.FindElementByTagName("html").Text.Contains("Individual Detail"), "Did Not Go To Individual Detail Page");

            test.Driver.FindElementsByXPath(Portal.People.SearchConstants.Edit_individual)[0].Click();
            //ctl00$ctl00$MainContent$content$ctlIndividualFull$txtSuffix
            test.GeneralMethods.WaitForElement(test.Driver, By.Id("ctl00_ctl00_MainContent_content_ctlIndividualFull_txtSuffix"));
            //ctl00_ctl00_MainContent_content_ctlIndividualFull_txtSuffix
            test.Driver.FindElementById("ctl00_ctl00_MainContent_content_ctlIndividualFull_txtSuffix").Clear();
            test.Driver.FindElementById("ctl00_ctl00_MainContent_content_ctlIndividualFull_txtSuffix").SendKeys("Jr");
            test.Driver.FindElementById(GeneralButtons.Save).Click();

            try
            {
                // Add an address to the individual
                test.Portal.People_AddAddress(string.Format("{0}{1}", individualName, ", Jr (Visitor)"), "Secondary", null, address1, null, "Arlington Heights", "Illinois", "60005", null, null);

                // Verify suffix is displayed in the sidebar
                //Assert.AreEqual(string.Format("{0}{1}", individualName, ", Jr"), test.Driver.FindElementByXPath(string.Format("//div[@class='addresses']/p/text()[contains(., '{0}')]", individualName)).Text);
                Assert.AreEqual(string.Format("{0}{1}", individualName, ", Jr"), test.Driver.FindElementByXPath(string.Format("//div[@class='addresses']/p[contains(text(), '{0}')]", individualName)).Text);

                // Verify the name for the communications
                //Assert.AreEqual(string.Format("{0}{1}", individualName, ", Jr"), test.Driver.FindElementByXPath(string.Format("//div[@class='communications']/p/text()[contains(., '{0}')]", individualName)).Text);
                Assert.AreEqual(string.Format("{0}{1}", individualName, ", Jr"), test.Driver.FindElementByXPath(string.Format("//div[@class='communications']/p[contains(text(), '{0}')]", individualName)).Text);

                // View the household
                test.Driver.FindElementByLinkText("View the household");

                // Verify the name for the communications
                //Assert.AreEqual(string.Format("{0}{1}", individualName, ", Jr"), test.Driver.FindElementByXPath(string.Format("//div[@class='communications']/p/text()[contains(., '{0}')]", individualName)).Text);
                Assert.AreEqual(string.Format("{0}{1}", individualName, ", Jr"), test.Driver.FindElementByXPath(string.Format("//div[@class='communications']/p[contains(text(), '{0}')]", individualName)).Text);

                // Verify suffix is displayed in the sidebar
                //Assert.AreEqual(string.Format("{0}{1}", individualName, ", Jr"), test.Driver.FindElementByXPath(string.Format("//div[@class='addresses']/p/text()[contains(., '{0}')]", individualName)).Text);
                Assert.AreEqual(string.Format("{0}{1}", individualName, ", Jr"), test.Driver.FindElementByXPath(string.Format("//div[@class='addresses']/p[contains(text(), '{0}')]", individualName)).Text);
            }
            finally
            {
                // View the individual
                test.Portal.People_ViewIndividual_WebDriver(individualName);


                // Remove the suffix from the individual
                test.GeneralMethods.WaitForElement(test.Driver, By.XPath(Portal.People.SearchConstants.Edit_individual), 20);
                test.Driver.FindElementByXPath(Portal.People.SearchConstants.Edit_individual).Click();
                test.GeneralMethods.WaitForElement(test.Driver, By.Id("ctl00_ctl00_MainContent_content_ctlIndividualFull_txtSuffix"));
                test.Driver.FindElementById("ctl00_ctl00_MainContent_content_ctlIndividualFull_txtSuffix").Clear();
                test.Driver.FindElementById(GeneralButtons.Save).Click();
                test.GeneralMethods.WaitForElement(test.Driver, By.LinkText("Back"));
                test.Driver.FindElementByLinkText("Back").Click();
                test.GeneralMethods.WaitForElement(test.Driver, By.LinkText("sign out"));

                // Logout of portal
                test.Portal.LogoutWebDriver();
            }
        }
 public void CheckInTeacher_UpdateTagCode()
 {
     test = base.TestContainer[Gallio.Framework.TestContext.CurrentContext.Test.Name];
     test.SQL.People_Individuals_UpdateTagCode(churchId, activityName, "Emma Kemp", "cod");
 }
Ejemplo n.º 9
0
        public void People_DataIntegrity_DuplicateFinder_StatusDropDownList()
        {
            #region variables
            string tempStatus = "d!@#$%^&*()\'+/.\\;\"[";
            string origin_Status;
            string changed_Status;
            #endregion

            #region Login to portal
            TestBaseWebDriver test = base.TestContainer[Gallio.Framework.TestContext.CurrentContext.Test.Name];
            TestLog.WriteLine("****Try to login the portal *****");
            test.Portal.LoginWebDriver("izhang2", "123qwe!@#QWE", "DC");
            #endregion

            #region Insert specific value to DB
            //we should create the new status and sub status, the value of status& substatus has the non-characters
            //key point, add the non-character.
            test.SQL.Admin_Status_Delete_SpecCharater(15, tempStatus);
            test.SQL.Admin_Status_Create_SpecCharater(15, "Attendee", tempStatus, true);
            #endregion

            try
            {
                #region Search with Status
                // Navigate to people->Duplicate finder
                if (!test.Driver.Url.Contains("DuplicateFinder"))
                {
                    test.GeneralMethods.Navigate_Portal(Navigation.People.Data_Integrity.Duplicate_Finder);
                    TestLog.WriteLine("Duplicate Finder is opened.");
                }

                //click the  status hyperlink
                test.GeneralMethods.WaitForElement(test.Driver, OpenQA.Selenium.By.LinkText("Status"));
                test.Driver.FindElementByLinkText("Status").Click();
                test.Driver.FindElementById("ctl00_ctl00_MainContent_content_btnFindPotentialDuplicates").Click();
                TestLog.WriteLine("click search btn");
                #endregion

                #region Check Dropdown List
                try
                {
                    //status value will be changed with status group's value

                    //find the status group, status, substatus
                    IWebElement tempObject_StatusGroup = test.Driver.FindElementById("ctl00_ctl00_MainContent_content_ddlFilterStatusGroup");
                    IWebElement tempObject_Status      = test.Driver.FindElementById("ctl00_ctl00_MainContent_content_ddlFilterStatus");
                    IWebElement tempObject_SubStatus   = test.Driver.FindElementById("ctl00_ctl00_MainContent_content_ddlFilterSubStatus");

                    #region Get origin status value
                    SelectElement tempSelect_Status = new SelectElement(tempObject_Status);
                    origin_Status = tempSelect_Status.SelectedOption.Text;
                    TestLog.WriteLine("**origin_Status is " + origin_Status);
                    #endregion

                    #region Get changed status value
                    //change status group
                    SelectElement tempSelect_StatusGroup = new SelectElement(tempObject_StatusGroup);
                    tempSelect_StatusGroup.SelectByText("System");
                    //click search btn
                    test.Driver.FindElementById("ctl00_ctl00_MainContent_content_btnFindPotentialDuplicates").Click();
                    //waiting for the result return
                    test.GeneralMethods.WaitForElement(test.Driver, OpenQA.Selenium.By.Id("ctl00_ctl00_MainContent_content_dgIndividualResults"));

                    //Get changes status value from UI
                    tempObject_StatusGroup = test.Driver.FindElementById("ctl00_ctl00_MainContent_content_ddlFilterStatusGroup");
                    tempObject_Status      = test.Driver.FindElementById("ctl00_ctl00_MainContent_content_ddlFilterStatus");
                    tempSelect_StatusGroup = new SelectElement(tempObject_StatusGroup);
                    tempSelect_Status      = new SelectElement(tempObject_Status);

                    changed_Status = tempSelect_Status.SelectedOption.Text;
                    TestLog.WriteLine("**changed_Status is " + changed_Status);
                    #endregion

                    //Verify changes status value is diff with origin value when we changed the status group
                    Assert.AreNotEqual(origin_Status, changed_Status);
                }
                catch (Exception e)
                {
                    TestLog.WriteLine(e.Message.ToString());
                }
                #endregion
            }
            finally
            {
                test.SQL.Admin_Status_Delete_SpecCharater(15, tempStatus);
            }
        }
 public void CheckInTeacher_CreateLastAttendance()
 {
     test = base.TestContainer[Gallio.Framework.TestContext.CurrentContext.Test.Name];
     test.CheckIn.CreateLastAttendance(churchId, activityName, "Emma Kemp", rosterNameArray[2]);
 }
 public void CheckInTeacher_UpdateBirthday()
 {
     test = base.TestContainer[Gallio.Framework.TestContext.CurrentContext.Test.Name];
     test.CheckIn.UpdateBirthdayForCheckinTeacher(churchId, "Emma Kemp");
 }
        private string Infellowship_Reigster(TestBaseWebDriver test, string[] individual, System.Collections.Generic.IList <string> selectedOrder,
                                             string payementType = "Visa", bool sendEmail = false, string confirmEmail = "", string ccEmail = "")
        {
            test.Driver.SwitchTo().Window(test.Driver.WindowHandles[1]);

            //select individual
            test.Infellowship.EventRegistration_Select_Individual(individual, selectedOrder, false, true);

            //Click Continue
            test.Infellowship.EventRegistration_ClickContinue();


            //Verify that we are in Step3
            test.GeneralMethods.VerifyTextPresentWebDriver("Finalize Registration");

            if (sendEmail)
            {
                if (test.Driver.FindElementById("send_confirmation_email").GetAttribute("checked").Equals("false"))
                {
                    test.Driver.FindElementById("send_confirmation_email").Click();
                    test.GeneralMethods.WaitForElementVisible(By.Id("confirmation_email"));
                }

                test.Driver.FindElementById("confirmation_email").SendKeys(confirmEmail);
                test.Driver.FindElementById("cc_email").SendKeys(ccEmail);
            }
            else
            {
                if (test.Driver.FindElementById("send_confirmation_email").GetAttribute("checked").Equals("true"))
                {
                    test.Driver.FindElementById("send_confirmation_email").Click();
                }
            }

            switch (payementType.ToLower())
            {
            case "visa":
                test.Infellowship.EventRegistration_CC_Process(15, "FT", "Tester", payementType, "4111111111111111", "12 - December", "2020");
                break;

            case "mastercard":
                test.Infellowship.EventRegistration_CC_Process(15, "FT", "Tester", payementType, "5555555555554444", "12 - December", "2020");
                break;

            case "american express":
                test.Infellowship.EventRegistration_CC_Process(15, "FT", "Tester", payementType, "378282246310005", "12 - December", "2020");
                break;

            case "discover":
            case "switch":
                // Process VISA credit card
                test.Infellowship.EventRegistration_CC_Process(15, "FT", "Tester", payementType, "6011111111111117", "12 - December", "2020");
                break;

            case "echeck":
                test.Infellowship.EventRegistration_Echeck_Process("FT", "Tester", "6302172170", "111000025", "1234567890");
                break;

            case "cash":
                test.Driver.FindElementById(GeneralInFellowship.EventRegistration.Cash_Payment_Method).Click();
                break;

            case "check":
                test.Driver.FindElementById(GeneralInFellowship.EventRegistration.Check_Payment_Method).Click();
                test.GeneralMethods.WaitForElementVisible(By.Id("check_account_number"));
                test.Driver.FindElementById("check_account_number").SendKeys("1234");
                break;
            }

            //Submitting details from Step3..
            test.Infellowship.EventRegistration_ClickSubmitPayment();
            test.GeneralMethods.WaitForElementVisible(By.LinkText("Home"));
            string confirmCode = test.Driver.FindElementByXPath(".//*[@id='main-content']/div[2]/div[1]/h4").Text.ToString().Replace("Confirmation: ", "");

            // Close the popup
            test.Driver.Close();
            test.Driver.SwitchTo().Window(test.Driver.WindowHandles[0]);

            return(confirmCode);
        }
        public void Weblink_EventRegistration_ManageForms_EditPresentation_NoFriendlyName()
        {
            /*
             * FO-1740, FO-1728, FO-1741
             * Changed by F0-3516
             */

            string userName   = "******";
            string password   = "******";
            string churchCode = "DC";
            int    churchId   = 15;
            string formName   = "EditPresentationNoFriendlyName - Test Form";

            string description = "Test-Description";

            TestBaseWebDriver test = base.TestContainer[Gallio.Framework.TestContext.CurrentContext.Test.Name];

            try
            {
                //01. Create From in portal.
                //Login to portal
                test.Portal.LoginWebDriver(userName, password, churchCode);

                test.Portal.WebLink_FormNames_Create(formName, true);
                TestLog.WriteLine("Create a form to DB, formName: {0};", formName);

                #region test in portal.
                //Save Setting
                FormPresentationPage formPresentationPage = new FormPresentationPage(test, formName);
                formPresentationPage.SaveSettings("", description);
                //formPresentationPage.ValidationSaveSettings(formName, description);
                Assert.AreEqual(formName, test.Driver.FindElement(By.Id("ctl00_ctl00_MainContent_content_lblPresentationName")).Text, "Name display failed!");
                Assert.AreEqual(description, test.Driver.FindElement(By.Id("ctl00_ctl00_MainContent_content_lblPresentationDescription")).Text, "Description display failed!");

                //Cache Data;
                string fromUrl = formPresentationPage.LinkUrl;

                //Logout
                test.Portal.LogoutWebDriver();
                #endregion test in portal.

                #region test not login
                test.Driver.Url = fromUrl;
                var lblFriendlyName = test.Driver.FindElement(By.XPath(".//*[@id='main-content']/form/div[@class='form-group']/label[@class='big' and @for='title']"));
                var lblDescription  = test.Driver.FindElement(By.XPath(".//*[@id='main-content']/form/div[@class='form-group']/p[@class='wordbreak']"));


                Assert.AreEqual(formName, lblFriendlyName.Text, "[infellowship-no login]: 'friendly Name' update error!");
                Assert.AreEqual(description, lblDescription.Text, "[infellowship-no login]: 'description' update error!");
                #endregion

                #region test login
                test.Infellowship.LoginWebDriver("*****@*****.**", "FT4life!", "DC");
                test.Driver.Url = fromUrl;

                lblFriendlyName = test.Driver.FindElement(By.XPath(".//*[@id='main-content']//*/h3[@class='form_friendly_name']"));
                lblDescription  = test.Driver.FindElement(By.XPath(".//*[@id='page_header']/p"));

                Assert.AreEqual(formName, lblFriendlyName.Text, "[infellowship-login]: 'friendly Name' update error!");
                Assert.AreEqual(description, lblDescription.Text, "[infellowship-login]: 'description' update error!");
                #endregion
            }
            finally
            {
                TestLog.WriteLine("Clean up the form from DB, name: " + formName);
                test.SQL.Weblink_Form_Delete_Proc(churchId, formName);
            }
        }
Ejemplo n.º 14
0
        public void People_Search_PeopleQuery_Export_Labels()
        {
            // Set initial conditions
            string report = "Export to Labels (Query Builder)";

            base.SQL.ReportLibrary_Queue_DeleteItem(15, 65211, report);

            // Login to portal
            TestBaseWebDriver test = base.TestContainer[Gallio.Framework.TestContext.CurrentContext.Test.Name];

            test.Portal.LoginWebDriver("msneeden", "Pa$$w0rd", "dc");

            // Perform a people query
            test.Portal.People_PeopleQuery(SearchByConstants.Household_Address, FieldConstants.Address, ComparisonConstants.Contains, new string[] { "9616 Armour Dr" });

            // Attempt to export to labels
            int itemRowHause = test.GeneralMethods.GetTableRowNumberWebDriver(TableIds.Portal.People_PeopleQuery, "Laura Hause", "Name", "contains");

            test.Driver.FindElementById(TableIds.Portal.People_PeopleQuery).FindElements(By.TagName("tr"))[itemRowHause].FindElements(By.TagName("td"))[0].FindElement(By.TagName("input")).Click();

            int itemRowSneeden = test.GeneralMethods.GetTableRowNumberWebDriver(TableIds.Portal.People_PeopleQuery, "Matthew Sneeden", "Name", "contains");

            test.Driver.FindElementById(TableIds.Portal.People_PeopleQuery).FindElements(By.TagName("tr"))[itemRowSneeden].FindElements(By.TagName("td"))[0].FindElement(By.TagName("input")).Click();

            test.Driver.FindElementByXPath("//a[@class='grid_gear']").Click();
            test.Driver.FindElementByLinkText("Export…").Click(); // was wait for condition, "selenium.isElementPresent(\"xpath=//div[@id='form_modal_border']\");", "10000");
            test.Driver.FindElementByLinkText("Export to labels »").Click();
            //modify by grace zhang
            new SelectElement(test.Driver.FindElementById("ctl00_ctl00_MainContent_content_ddlLabelStyles")).SelectByIndex(1); //SelectByText("A Test Label Style");
            test.Driver.FindElementById("ctl00_ctl00_MainContent_content_btnExport").Click();

            // Verify the labels are created successfully
            Assert.IsTrue(test.Driver.FindElementByTagName("html").Text.Contains("Download Your Labels"));
            if (test.Driver.FindElementByTagName("html").Text.Contains("Your labels are being processed…"))
            {
                Retry.WithPolling(15000).WithTimeout(75000).Until(() => test.Driver.FindElementByTagName("html").Text.Contains("Labels processing has completed!"));
            }

            Assert.IsTrue(test.Driver.FindElementByTagName("html").Text.Contains("Labels processing has completed!"));
            Assert.IsTrue(test.Driver.FindElementsByLinkText("Download your labels").Count > 0);
            Assert.IsTrue(test.Driver.FindElementByTagName("html").Text.Contains("Once you leave this page you will no longer be able to save this set of labels."));
            Assert.IsTrue(test.Driver.FindElementByTagName("html").Text.Contains("So, be sure to save them to your computer."));

            // Logout of portal
            test.Portal.LogoutWebDriver();


            // Login to Report Library
            //string url = this.F1Environment == F1Environments.QA ? string.Format("http://reportlibrary{0}.dev.corp.local/ReportLibrary/Login/Index.aspx", this.F1Environment) : "https://staging-reportlibrary.fellowshipone.com/ReportLibrary/Login/Index.aspx";
            string url = test.ReportLibrary.URL;

            TestLog.WriteLine(string.Format("Go To Report Library URL: {0}", url));
            test.Driver.Navigate().GoToUrl(url);
            test.Driver.FindElementById("username").SendKeys("msneeden");
            test.Driver.FindElementById("password").SendKeys("Pa$$w0rd");
            test.Driver.FindElementById("churchcode").SendKeys("dc");
            test.Driver.FindElementById("btn_login").Click();

            // View the report queue
            test.Driver.FindElementByLinkText("Queue").Click();

            // Verify the report exists and has completed
            int         itemRowQueue = test.GeneralMethods.GetTableRowNumberWebDriver(TableIds.ReportLibrary.Queue, report, "Name");
            IWebElement table        = test.Driver.FindElementById(TableIds.ReportLibrary.Queue);

            Assert.IsTrue(table.FindElements(By.TagName("tr"))[itemRowQueue].FindElements(By.TagName("td"))[0].FindElements(By.XPath("a/img[contains(@src, '/ReportLibrary/public/images/status_complete.png?') and @alt='Complete']")).Count > 0);//, "//table[@id='ctl00_MainContent_grdReports']" test.Selenium.IsElementPresent(string.Format("{0}/tbody/tr[{1}]/td[1]/a/img[contains(@src, '/ReportLibrary/public/images/status_complete.png?') and @alt='Complete']", "//table[@id='ctl00_MainContent_grdReports']", itemRowQueue + 1)));
            Assert.AreEqual(report, table.FindElements(By.TagName("tr"))[itemRowQueue].FindElements(By.TagName("td"))[1].Text);
            Assert.IsTrue(table.FindElements(By.TagName("tr"))[itemRowQueue].FindElements(By.TagName("td"))[2].FindElement(By.TagName("a")).GetAttribute("text").Equals("Download") /*  test.Selenium.IsElementPresent(string.Format("{0}/tbody/tr[{1}]/td[3]/a[text()='Download']", "//table[@id='ctl00_MainContent_grdReports']", itemRowQueue + 1))*/);
            Assert.IsTrue(table.FindElements(By.TagName("tr"))[itemRowQueue].FindElements(By.TagName("td"))[4].Text.Contains("Today at ") /*  test.Selenium.IsElementPresent(string.Format("{0}/tbody/tr[{1}]/td[position()=5 and contains(text(), 'Today at ')]", "//table[@id='ctl00_MainContent_grdReports']", itemRowQueue + 1))*/);

            // Logout of report library
            test.Driver.FindElementByLinkText("Log Out").Click();
        }
Ejemplo n.º 15
0
        public void People_Search_FindAPerson_ViewIndividual_AddAnAddress_MultipleMatch()
        {
            // Set initial conditions
            string address1Resolved = "415 W National St";

            base.SQL.People_Addresses_Delete(15, base.SQL.IndividualID, address1Resolved);

            // Login to portal
            TestBaseWebDriver test = base.TestContainer[Gallio.Framework.TestContext.CurrentContext.Test.Name];

            test.Portal.LoginWebDriver("msneeden", "Pa$$w0rd", "dc");

            // View an individual
            test.Portal.People_ViewIndividual_WebDriver("Matthew Sneeden");

            // Add an address
            string addressType = "Secondary";

            test.Portal.People_AddAddress("Matthew Sneeden (Head)", addressType, null, "415 National", null, "Vermillion", "South Dakota", "57069", null, null);

            // Verify user is prompted for multiple matches
            test.GeneralMethods.WaitForElement(test.Driver, By.TagName("html"));
            Assert.IsTrue(test.Driver.FindElementByTagName("html").Text.Contains("multiple matches"));
            Assert.IsTrue(test.Driver.FindElementByTagName("html").Text.Contains("According to the United States Postal Service the address you entered is missing important information such as directional or street descriptor. Please choose the correct address from the list below."));

            // Select the direction and proceed
            string xPath = test.Driver.FindElementByXPath("//table[@class='grid']/tbody/tr[3]/td[1]").Text == "415 W National St, Vermillion SD" ? "//table[@class='grid']/tbody/tr[3]/td[3]/form/a" : "//table[@class='grid']/tbody/tr[2]/td[3]/form/a";

            test.Driver.FindElementByXPath(xPath).Click();

            // Verify the address was created
            test.GeneralMethods.WaitForElement(test.Driver, By.TagName("html"));
            Assert.IsTrue(test.Driver.FindElementByTagName("html").Text.Contains(addressType));
            Assert.IsTrue(test.Driver.FindElementByTagName("html").Text.Contains(address1Resolved));
            Assert.IsTrue(test.Driver.FindElementByTagName("html").Text.Contains("Vermillion, SD 57069-1947"));
            Assert.IsTrue(test.Driver.FindElementByTagName("html").Text.Contains("Last Updated: Today"));

            // Logout of portal
            test.Portal.LogoutWebDriver();
            //// Select the address and proceed
            //test.Driver.FindElementByXPath("//div[@id='main_content']/div[1]/div[2]/div[1]/div[2]/form/p/input").Click();

            //test.GeneralMethods.WaitForElement(test.Driver, By.ClassName("addresses"));
            //Boolean isFound = false;
            //int index = 1;

            //try
            //{
            //    while (test.Driver.FindElementByXPath(String.Format("//div[@class='addresses']/ul/li[{0}]/div/div/div[1]", index)) != null)
            //    {
            //        try
            //        {
            //            if (test.Driver.FindElementByXPath(String.Format("//div[@class='addresses']/ul/li[{0}]/div/strong", index)).Text.Equals(addressType))
            //            {
            //                if (test.Driver.FindElementByXPath(String.Format("//div[@class='addresses']/ul/li[{0}]/div/div/div[1]", index)).Text.Equals(address1Resolved))
            //                {
            //                    Assert.IsTrue(test.Driver.FindElementByXPath(String.Format("//div[@class='addresses']/ul/li[{0}]/div/div/div[2]", index)).Text.Equals("Vermillion, SD 57069-1947"), "Address 2 isn't display well");
            //                    Assert.IsTrue(test.Driver.FindElementByXPath(String.Format("//div[@class='addresses']/ul/li[{0}]/div/small", index)).Text.Equals("Last Updated: Today"), "Last Updated time is wrong");
            //                    isFound = true;
            //                    break;
            //                }
            //            }
            //        }
            //        catch (OpenQA.Selenium.NoSuchElementException e) { }

            //        TestLog.WriteLine("Tested address with index: " + index);
            //        index++;
            //    }
            //}
            //catch (OpenQA.Selenium.NoSuchElementException e) { }
            //finally
            //{
            //    // Logout of portal
            //    test.Portal.LogoutWebDriver();

            //    Assert.IsTrue(isFound, "Failed to find new addresses are display well");
            //}
        }
Ejemplo n.º 16
0
        public void Dashboard_AttributeGroup_Settings_SpecialAttributes()
        {
            TestBaseWebDriver test    = base.TestContainer[Gallio.Framework.TestContext.CurrentContext.Test.Name];
            GeneralMethods    utility = test.GeneralMethods;

            int    churchId                             = test.SQL.FetchChurchID(test.Dashboard.ChurchCode);
            string activeAttributeGroup                 = utility.GetUniqueName("aag");
            bool   is_attribute_salvation_checked       = false;
            bool   is_attribute_baptism_checked         = false;
            bool   is_attribute_dedication_checked      = false;
            bool   is_attribute_re_dedication_checked   = false;
            bool   is_attribute_rededication_checked    = false;
            bool   is_attribute_baby_dedication_checked = false;

            try
            {
                test.SQL.Dashboard_ClearData(churchId, test.Dashboard.DashboardUsername);
                test.SQL.Admin_IndividualAttributeGroups_Create(churchId, activeAttributeGroup, true);
                test.SQL.Admin_IndividualAttributes_Create(churchId, activeAttributeGroup, "salvation", true, true, false, false, true);
                test.SQL.Admin_IndividualAttributes_Create(churchId, activeAttributeGroup, "baptism", true, true, false, false, true);
                test.SQL.Admin_IndividualAttributes_Create(churchId, activeAttributeGroup, "dedication", true, true, false, false, true);
                test.SQL.Admin_IndividualAttributes_Create(churchId, activeAttributeGroup, "re-dedication", true, true, false, false, true);
                test.SQL.Admin_IndividualAttributes_Create(churchId, activeAttributeGroup, "rededication", true, true, false, false, true);
                test.SQL.Admin_IndividualAttributes_Create(churchId, activeAttributeGroup, "baby dedication", true, true, false, false, true);

                test.Dashboard.LoginWebDriver();
                new DashboardHomePage(test.Driver, test.GeneralMethods).openSettingsPage();
                DashboardSettingsPage settings = new DashboardSettingsPage(test.Driver, test.GeneralMethods, test.SQL);

                int widgetsTotal = settings.getWidgetsTotalOnPage();

                for (int i = 1; i <= widgetsTotal; i++)
                {
                    if (settings.getWidgetName(i).Contains(activeAttributeGroup))
                    {
                        object[] items = settings.getWidgetSubItemsOnPage(i).ToArray();
                        for (int j = 0; j < items.Length; j++)
                        {
                            if (items[j].ToString().ToLower().Contains("salvation"))
                            {
                                TestLog.WriteLine(string.Format("The active attribute '{0}' is found", items[j]));
                                is_attribute_salvation_checked = settings.isWidgetItemChecked(i, j + 1);
                                Assert.IsTrue(is_attribute_salvation_checked, string.Format("Active attribute '{0}' should be checked by default", items[j]));
                                continue;
                            }

                            if (items[j].ToString().ToLower().Contains("baptism"))
                            {
                                TestLog.WriteLine(string.Format("The active attribute '{0}' is found", items[j]));
                                is_attribute_baptism_checked = settings.isWidgetItemChecked(i, j + 1);
                                Assert.IsTrue(is_attribute_baptism_checked, string.Format("Active attribute '{0}' should be checked by default", items[j]));
                                continue;
                            }

                            if (items[j].ToString().ToLower().Contains("dedication"))
                            {
                                TestLog.WriteLine(string.Format("The active attribute '{0}' is found", items[j]));
                                is_attribute_dedication_checked = settings.isWidgetItemChecked(i, j + 1);
                                Assert.IsTrue(is_attribute_dedication_checked, string.Format("Active attribute '{0}' should be checked by default", items[j]));
                                continue;
                            }

                            if (items[j].ToString().ToLower().Contains("re-dedication"))
                            {
                                TestLog.WriteLine(string.Format("The active attribute '{0}' is found", items[j]));
                                is_attribute_re_dedication_checked = settings.isWidgetItemChecked(i, j + 1);
                                Assert.IsTrue(is_attribute_re_dedication_checked, string.Format("Active attribute '{0}' should be checked by default", items[j]));
                                continue;
                            }

                            if (items[j].ToString().ToLower().Contains("rededication"))
                            {
                                TestLog.WriteLine(string.Format("The active attribute '{0}' is found", items[j]));
                                is_attribute_rededication_checked = settings.isWidgetItemChecked(i, j + 1);
                                Assert.IsTrue(is_attribute_rededication_checked, string.Format("Active attribute '{0}' should be checked by default", items[j]));
                                continue;
                            }

                            if (items[j].ToString().ToLower().Contains("baby dedication"))
                            {
                                TestLog.WriteLine(string.Format("The active attribute '{0}' is found", items[j]));
                                is_attribute_baby_dedication_checked = settings.isWidgetItemChecked(i, j + 1);
                                Assert.IsTrue(is_attribute_baby_dedication_checked, string.Format("Active attribute '{0}' should be checked by default", items[j]));
                            }
                        }
                    }
                }
            }
            finally
            {
                //clear test data
                test.SQL.Admin_IndividualAttributes_Delete(churchId, activeAttributeGroup, "salvation");
                test.SQL.Admin_IndividualAttributes_Delete(churchId, activeAttributeGroup, "baptism");
                test.SQL.Admin_IndividualAttributes_Delete(churchId, activeAttributeGroup, "dedication");
                test.SQL.Admin_IndividualAttributes_Delete(churchId, activeAttributeGroup, "re-dedication");
                test.SQL.Admin_IndividualAttributes_Delete(churchId, activeAttributeGroup, "rededication");
                test.SQL.Admin_IndividualAttributes_Delete(churchId, activeAttributeGroup, "baby dedication");
                test.SQL.Admin_IndividualAttributeGroups_Delete(churchId, activeAttributeGroup);
            }
        }
Ejemplo n.º 17
0
        public void People_Search_FindAPerson_ViewIndividual_AddAnAddress_InteractionRequired()
        {
            // Set initial conditions
            string address1Resolved = "5809 N 81st St";

            base.SQL.People_Addresses_Delete(15, base.SQL.IndividualID, address1Resolved);

            // Login to portal
            TestBaseWebDriver test = base.TestContainer[Gallio.Framework.TestContext.CurrentContext.Test.Name];

            test.Portal.LoginWebDriver("msneeden", "Pa$$w0rd", "dc");

            // View an individual
            test.Portal.People_ViewIndividual_WebDriver("Matthew Sneeden");

            // Add an address
            string addressType = "Secondary";

            test.Portal.People_AddAddress("Matthew Sneeden (Head)", addressType, null, "5809 81st St", null, "Scottsdale", "Arizona", "85250", null, null);

            // Verify user is prompted for interaction
            test.GeneralMethods.WaitForElement(test.Driver, By.TagName("html"));
            Assert.IsTrue(test.Driver.FindElementByTagName("html").Text.Contains("interaction required"));
            Assert.IsTrue(test.Driver.FindElementByTagName("html").Text.Contains("According to the United States Postal Service the address you entered may be incorrect."));
            Assert.IsTrue(test.Driver.FindElementByTagName("html").Text.Contains("Please choose one of the options below."));

            Assert.IsTrue(test.Driver.FindElementByTagName("html").Text.Contains(address1Resolved));
            Assert.IsTrue(test.Driver.FindElementByTagName("html").Text.Contains("Scottsdale, AZ 85250-6207"));

            // Select the address and proceed
            test.Driver.FindElementByXPath("//div[@id='main_content']/div[1]/div[2]/div[1]/div[2]/form/p/input").Click();

            // Verify the address was created
            test.GeneralMethods.WaitForElement(test.Driver, By.TagName("html"));
            Assert.IsTrue(test.Driver.FindElementByTagName("html").Text.Contains(addressType));
            Assert.IsTrue(test.Driver.FindElementByTagName("html").Text.Contains(address1Resolved));
            Assert.IsTrue(test.Driver.FindElementByTagName("html").Text.Contains("Scottsdale, AZ 85250-6207"));
            Assert.IsTrue(test.Driver.FindElementByTagName("html").Text.Contains("Last Updated: Today"));

            // Logout of portal
            test.Portal.LogoutWebDriver();
            //test.GeneralMethods.WaitForElement(test.Driver, By.ClassName("addresses"));
            //Boolean isFound = false;
            //int index = 1;

            //try
            //{
            //    while (test.Driver.FindElementByXPath(String.Format("//div[@class='addresses']/ul/li[{0}]/div/div/div[1]", index)) != null)
            //    {
            //        try
            //        {
            //            if (test.Driver.FindElementByXPath(String.Format("//div[@class='addresses']/ul/li[{0}]/div/strong", index)).Text.Equals(addressType))
            //            {
            //                if (test.Driver.FindElementByXPath(String.Format("//div[@class='addresses']/ul/li[{0}]/div/div/div[1]", index)).Text.Equals(address1Resolved))
            //                {
            //                    Assert.IsTrue(test.Driver.FindElementByXPath(String.Format("//div[@class='addresses']/ul/li[{0}]/div/div/div[2]", index)).Text.Equals("Scottsdale, AZ 85250-6207"), "Address 2 isn't display well");
            //                    Assert.IsTrue(test.Driver.FindElementByXPath(String.Format("//div[@class='addresses']/ul/li[{0}]/div/small", index)).Text.Equals("Last Updated: Today"), "Last Updated time is wrong");
            //                    isFound = true;
            //                    break;
            //                }
            //            }
            //        }
            //        catch (OpenQA.Selenium.NoSuchElementException e) { }

            //        TestLog.WriteLine("Tested address with index: " + index);
            //        index++;
            //    }
            //}
            //catch (OpenQA.Selenium.NoSuchElementException e) { }
            //finally
            //{
            //    // Logout of portal
            //    test.Portal.LogoutWebDriver();

            //    Assert.IsTrue(isFound, "Failed to find new addresses are display well");
            //}
        }
Ejemplo n.º 18
0
        public void Dashboard_AttributeGroup_Settings_NewAttributeGroup_And_NewAttribute()
        {
            TestBaseWebDriver test    = base.TestContainer[Gallio.Framework.TestContext.CurrentContext.Test.Name];
            GeneralMethods    utility = test.GeneralMethods;

            int    churchId               = test.SQL.FetchChurchID(test.Dashboard.ChurchCode);
            string activeAttributeGroup   = utility.GetUniqueName("aag");
            string inactiveAttributeGroup = utility.GetUniqueName("iag");
            string activeAttribute        = utility.GetUniqueName("aa");
            string inactiveAttribute      = utility.GetUniqueName("ia");

            try
            {
                test.SQL.Admin_IndividualAttributeGroups_Create(churchId, activeAttributeGroup, true);
                test.SQL.Admin_IndividualAttributeGroups_Create(churchId, inactiveAttributeGroup, true);
                test.SQL.Admin_IndividualAttributes_Create(churchId, activeAttributeGroup, activeAttribute, true, true, false, false, true);
                test.SQL.Admin_IndividualAttributes_Create(churchId, activeAttributeGroup, inactiveAttribute, true, true, false, false, false);

                test.Dashboard.LoginWebDriver();
                new DashboardHomePage(test.Driver, test.GeneralMethods).openSettingsPage();
                DashboardSettingsPage settings = new DashboardSettingsPage(test.Driver, test.GeneralMethods, test.SQL);

                int       widgetsTotal = settings.getWidgetsTotalOnPage();
                bool      hasCustomerizedActiveAttributeGroup   = false;
                bool      hasCustomerizedInactiveAttributeGroup = false;
                bool      hasCustomerizedActiveAttribute        = false;
                bool      hasCustomerizedInactiveAttribute      = false;
                ArrayList allWidgetsOnPage = settings.getAllWidgetsNamesOnPage(settings.getWidgetsTotalOnPage());

                foreach (string widget in allWidgetsOnPage)
                {
                    if (widget.Contains(activeAttributeGroup))
                    {
                        TestLog.WriteLine(string.Format("The customerized active attribute group '{0}' found", widget));
                        hasCustomerizedActiveAttributeGroup = true;
                    }

                    if (widget.Contains(inactiveAttributeGroup))
                    {
                        TestLog.WriteLine(string.Format("The customerized inactive attribute group '{0}' found", widget));
                        hasCustomerizedInactiveAttributeGroup = true;
                    }
                }

                Assert.IsTrue(hasCustomerizedActiveAttributeGroup, "Active attribute group should can be shown on page");
                Assert.IsFalse(hasCustomerizedInactiveAttributeGroup, "Inactive attribute group should cannot be shown on page");

                for (int i = 1; i <= widgetsTotal; i++)
                {
                    if (settings.getWidgetName(i).Contains(activeAttributeGroup))
                    {
                        ArrayList items = settings.getWidgetSubItemsOnPage(i);
                        foreach (string item in items)
                        {
                            if (item.Contains(activeAttribute))
                            {
                                TestLog.WriteLine(string.Format("The customerized active attribute '{0}' found", item));
                                hasCustomerizedActiveAttribute = true;
                            }

                            if (item.Contains(inactiveAttribute))
                            {
                                TestLog.WriteLine(string.Format("The customerized inactive attribute '{0}' found", item));
                                hasCustomerizedInactiveAttribute = true;
                            }
                        }
                        Assert.IsTrue(hasCustomerizedActiveAttribute, "Active attribute should can be shown on page");
                        Assert.IsFalse(hasCustomerizedInactiveAttribute, "Inactive attribute should cannot be shown on page");
                        break;
                    }
                }
            }
            finally
            {
                //clear test data
                test.SQL.Admin_IndividualAttributes_Delete(churchId, activeAttributeGroup, activeAttribute);
                test.SQL.Admin_IndividualAttributes_Delete(churchId, activeAttributeGroup, inactiveAttribute);
                test.SQL.Admin_IndividualAttributeGroups_Delete(churchId, activeAttributeGroup);
                test.SQL.Admin_IndividualAttributeGroups_Delete(churchId, inactiveAttributeGroup);
            }
        }
Ejemplo n.º 19
0
        public void People_Search_FindAPerson_ViewIndividual_AddAnAddress_Address1ZipCode()
        {
            // Set initial conditions
            string address1Resolved = "7604 Naples Ln";
            string address2         = "Frisco, TX 75035-2965";

            base.SQL.People_Addresses_Delete(15, base.SQL.IndividualID, address1Resolved);

            // Login to portal
            TestBaseWebDriver test = base.TestContainer[Gallio.Framework.TestContext.CurrentContext.Test.Name];

            test.Portal.LoginWebDriver("msneeden", "Pa$$w0rd", "dc");

            // View an individual
            test.Portal.People_ViewIndividual_WebDriver("Matthew Sneeden");

            // Add an address
            string addressType = "Secondary";

            test.Portal.People_AddAddress("Matthew Sneeden (Head)", addressType, null, address1Resolved, address2, null, null, "75035", null, null);

            // Verify user is taken directly back to the individual view
            Assert.AreEqual(PeopleHeadingText.TitleFormat("Individual Detail"), test.Driver.Title);

            // Verify the address was created
            test.GeneralMethods.WaitForElement(test.Driver, By.TagName("html"));
            Assert.IsTrue(test.Driver.FindElementByTagName("html").Text.Contains(addressType));
            Assert.IsTrue(test.Driver.FindElementByTagName("html").Text.Contains(address1Resolved));
            Assert.IsTrue(test.Driver.FindElementByTagName("html").Text.Contains("Frisco, TX 75035-2965"));
            Assert.IsTrue(test.Driver.FindElementByTagName("html").Text.Contains("Last Updated: Today"));

            // Logout of portal
            test.Portal.LogoutWebDriver();
            //test.GeneralMethods.WaitForElement(test.Driver, By.ClassName("addresses"));
            //Boolean isFound = false;
            //int index = 1;

            //try
            //{
            //    while (test.Driver.FindElementByXPath(String.Format("//div[@class='addresses']/ul/li[{0}]/div/div/div[1]", index)) != null)
            //    {
            //        try
            //        {
            //            if (test.Driver.FindElementByXPath(String.Format("//div[@class='addresses']/ul/li[{0}]/div/strong", index)).Text.Equals(addressType))
            //            {
            //                if (test.Driver.FindElementByXPath(String.Format("//div[@class='addresses']/ul/li[{0}]/div/div/div[1]", index)).Text.Equals(address1Resolved))
            //                {
            //                    Assert.IsTrue(test.Driver.FindElementByXPath(String.Format("//div[@class='addresses']/ul/li[{0}]/div/div/div[2]", index)).Text.Equals(address2), "Address 2 isn't display well");
            //                    Assert.IsTrue(test.Driver.FindElementByXPath(String.Format("//div[@class='addresses']/ul/li[{0}]/div/small", index)).Text.Equals("Last Updated: Today"), "Last Updated time is wrong");
            //                    isFound = true;
            //                    break;
            //                }
            //            }
            //        }
            //        catch (OpenQA.Selenium.NoSuchElementException e) { }

            //        TestLog.WriteLine("Tested address with index: " + index);
            //        index++;
            //    }
            //}
            //catch (OpenQA.Selenium.NoSuchElementException e) { }
            //finally
            //{
            //    // Logout of portal
            //    test.Portal.LogoutWebDriver();

            //    Assert.IsTrue(isFound, "Failed to find new addresses are display well");
            //}
        }
Ejemplo n.º 20
0
        public void Dashboard_AttributeGroup_Home_BigNumber_NewIndividual()
        {
            TestBaseWebDriver test    = base.TestContainer[Gallio.Framework.TestContext.CurrentContext.Test.Name];
            GeneralMethods    utility = test.GeneralMethods;

            DateTime now                             = TimeZoneInfo.ConvertTimeFromUtc(DateTime.UtcNow, TimeZoneInfo.FindSystemTimeZoneById("Central Standard Time"));
            int      churchId                        = test.SQL.FetchChurchID(test.Dashboard.ChurchCode);
            int      userId                          = test.SQL.User_FetchID(churchId, test.Dashboard.DashboardEmail, test.Dashboard.DashboardUsername);
            string   activeAttributeGroup            = utility.GetUniqueName("aag");
            string   activeAttributeWithStartDate    = utility.GetUniqueName("aa1");
            string   activeAttributeWithoutStartDate = utility.GetUniqueName("aa2");
            string   individual_1                    = utility.GetUniqueName("ind1");
            string   individual_2                    = utility.GetUniqueName("ind2");
            string   individual_3                    = utility.GetUniqueName("ind3");
            string   individual_4                    = utility.GetUniqueName("ind4");

            test.SQL.Admin_IndividualAttributeGroups_Create(churchId, activeAttributeGroup, true);
            test.SQL.Admin_IndividualAttributes_Create(churchId, activeAttributeGroup, activeAttributeWithStartDate, false, true, false, false, true);
            test.SQL.Admin_IndividualAttributes_Create(churchId, activeAttributeGroup, activeAttributeWithoutStartDate, false, false, false, false, true);
            test.SQL.People_Individual_Create(churchId, "AutoTest", individual_1);
            test.SQL.People_Individual_Create(churchId, "AutoTest", individual_2);
            test.SQL.People_Individual_Create(churchId, "AutoTest", individual_3);
            test.SQL.People_Individual_Create(churchId, "AutoTest", individual_4);
            int individual_1_id = test.SQL.People_Individuals_FetchID(churchId, "AutoTest " + individual_1);
            int individual_2_id = test.SQL.People_Individuals_FetchID(churchId, "AutoTest " + individual_2);
            int individual_3_id = test.SQL.People_Individuals_FetchID(churchId, "AutoTest " + individual_3);
            int individual_4_id = test.SQL.People_Individuals_FetchID(churchId, "AutoTest " + individual_4);

            int attributeGroupId             = test.SQL.Admin_Fetch_AttributeGroupID(churchId, activeAttributeGroup);
            int attributeId_withStartDate    = test.SQL.Admin_Fetch_AttributeID(churchId, attributeGroupId, activeAttributeWithStartDate);
            int attributeId_withoutStartDate = test.SQL.Admin_Fetch_AttributeID(churchId, attributeGroupId, activeAttributeWithoutStartDate);

            test.SQL.Dashboard_Insert_IndividualAttribute(churchId, individual_1_id, attributeId_withStartDate, now, now.AddYears(100));
            test.SQL.Dashboard_Insert_IndividualAttribute(churchId, individual_2_id, attributeId_withStartDate, now.AddDays(-370), now.AddYears(-1));
            test.SQL.Dashboard_Insert_IndividualAttribute(churchId, individual_3_id, attributeId_withoutStartDate, now.AddYears(100), now.AddYears(100));
            test.SQL.Dashboard_Insert_IndividualAttribute(churchId, individual_4_id, attributeId_withStartDate, now.AddDays(-2), now);

            try
            {
                test.Dashboard.LoginWebDriver();
                DashboardHomePage     home     = new DashboardHomePage(test.Driver, test.GeneralMethods);
                DashboardSettingsPage settings = new DashboardSettingsPage(test.Driver, test.GeneralMethods, test.SQL);

                home.openSettingsPage();
                int widgetsTotal        = settings.getWidgetsTotalOnPage();
                int turnedOnWidgetTotal = settings.getTurnedOnWidgetsTotalOnPage(widgetsTotal);

                for (int i = 1; i <= widgetsTotal; i++)
                {
                    if (settings.getWidgetName(i).Contains(activeAttributeGroup))
                    {
                        if (turnedOnWidgetTotal == 6)
                        {
                            settings.turnOffMultiWidgets(widgetsTotal, 1);
                        }
                        settings.turnOnWidget(i);

                        settings.checkWidgetItem(i, 1);
                        break;
                    }
                }

                settings.closeSettingsPage();
                home.selectView("year");

                DateTime[] dateRange    = test.Dashboard.getDateRange(now, "year");
                int        subTotalInDb = test.SQL.Dashboard_AttributeGroup_GetPeriodSum(churchId, userId, attributeGroupId, dateRange[0], dateRange[1]);

                for (int i = 1; i <= turnedOnWidgetTotal; i++)
                {
                    if (home.getWidgetName(i).Contains(activeAttributeGroup))
                    {
                        string bigNumber      = home.getWidgetBigNumber(i);
                        int    subTotalOnPage = int.Parse(bigNumber.Replace(",", ""));


                        //Verify only individual_1 will be counted
                        TestLog.WriteLine(string.Format("Page: {0}|Db: {1}", subTotalOnPage, subTotalInDb));
                        Assert.AreEqual(subTotalOnPage, subTotalInDb, string.Format("The big number of attribute group should equal to {0}", subTotalInDb));
                        break;
                    }
                }
            }
            finally
            {
                //clear test data
                test.SQL.Dashboard_Delete_IndividualAttribute(churchId, individual_1_id, attributeId_withStartDate);
                test.SQL.Dashboard_Delete_IndividualAttribute(churchId, individual_2_id, attributeId_withStartDate);
                test.SQL.Dashboard_Delete_IndividualAttribute(churchId, individual_3_id, attributeId_withoutStartDate);
                test.SQL.Dashboard_Delete_IndividualAttribute(churchId, individual_4_id, attributeId_withStartDate);
                test.SQL.Admin_IndividualAttributes_Delete(churchId, activeAttributeGroup, activeAttributeWithoutStartDate);
                test.SQL.Admin_IndividualAttributes_Delete(churchId, activeAttributeGroup, activeAttributeWithStartDate);
                test.SQL.Admin_IndividualAttributeGroups_Delete(churchId, activeAttributeGroup);
                test.SQL.People_Individual_Delete(churchId, "AutoTest", individual_1);
                test.SQL.People_Individual_Delete(churchId, "AutoTest", individual_2);
                test.SQL.People_Individual_Delete(churchId, "AutoTest", individual_3);
                test.SQL.People_Individual_Delete(churchId, "AutoTest", individual_4);
            }
        }
Ejemplo n.º 21
0
        public void People_Search_FindAPerson_ViewIndividual_CreateContactItem()
        {
            string churchCode = "QAEUNLX0C2";

            // Login to Portal
            TestBaseWebDriver test = base.TestContainer[Gallio.Framework.TestContext.CurrentContext.Test.Name];

            test.Portal.LoginWebDriver("ft.tester", "FT4life!", churchCode);

            // View an individual
            test.Portal.People_ViewIndividual_WebDriver("Madysen Freemen");

            TestLog.WriteLine("Click to add contact item");
            test.Driver.FindElementByXPath(".//div[@id='contact_items']/div/a").Click();
            test.GeneralMethods.WaitForElementDisplayed(By.Id("ddlContactForm"));

            TestLog.WriteLine("Select options to the contact item");
            new SelectElement(test.Driver.FindElementById("ddlContactForm")).SelectByIndex(4);
            test.GeneralMethods.WaitForElementEnabled(By.Id("ddlContactItem"));
            SelectElement contactOption = new SelectElement(test.Driver.FindElementById("ddlContactItem"));

            contactOption.SelectByIndex(2);
            string itemName = contactOption.SelectedOption.Text;

            TestLog.WriteLine("The new contact item is named as: " + itemName);
            int churchId = test.SQL.FetchChurchID(churchCode);

            try
            {
                TestLog.WriteLine("Click to save the contact item");
                test.Driver.FindElementById("btnSaveContactItem").Click();
                test.GeneralMethods.WaitForElementDisplayed(By.LinkText(itemName));

                System.Threading.Thread.Sleep(5000);
                string contactInstanceId = "contact_instance_item_" + test.SQL.Admin_ContactItems_FetchTheLatestContactInstanceId(churchId, itemName);
                test.GeneralMethods.WaitForElementDisplayed(By.Id(contactInstanceId));

                TestLog.WriteLine("Check create and update time of the contact item are the same");
                Assert.IsTrue(test.Driver.FindElementByXPath(String.Format(".//div[@id='{0}']/small[1]", contactInstanceId)).Text.Replace("Created", "").Equals(
                                  test.Driver.FindElementByXPath(String.Format(".//div[@id='{0}']/small[2]", contactInstanceId)).Text.Replace("Updated", "")), "Contact item create time is not the same as default update time");

                TestLog.WriteLine("Click on the contact item name to edit");
                test.Driver.FindElementByXPath(String.Format(".//div[@id='{0}']/div/strong/a", contactInstanceId)).Click();

                TestLog.WriteLine("Wait for a moment to make update time greater than create time");
                System.Threading.Thread.Sleep(60000);

                TestLog.WriteLine("Click on Save to udpate");
                test.Driver.FindElementById("ctl00_ctl00_MainContent_content_Menu_contacts_txtIndividualContactNote").SendKeys("Update this contact item");
                test.Driver.FindElementById("ctl00_ctl00_MainContent_content_Menu_contacts_btnSave").Click();

                TestLog.WriteLine("View above individual agagin");
                test.Portal.People_ViewIndividual_WebDriver("Madysen Freemen");

                TestLog.WriteLine("Check create and update time of the contact item are different");
                Assert.IsFalse(test.Driver.FindElementByXPath(String.Format(".//div[@id='{0}']/small[1]", contactInstanceId)).Text.Replace("Created", "").Equals(
                                   test.Driver.FindElementByXPath(String.Format(".//div[@id='{0}']/small[2]", contactInstanceId)).Text.Replace("Updated", "")), "Contact item create time are the same as default update time");

                // Assert.IsTrue(DateTime.ParseExact(test.Driver.FindElementByXPath(String.Format(".//div[@id='{0}']/small[2]", contactInstanceId)).Text.Replace("Updated", ""), "HH:mm tt", CultureInfo.InvariantCulture) >
                // DateTime.ParseExact(test.Driver.FindElementByXPath(String.Format(".//div[@id='{0}']/small[1]", contactInstanceId)).Text.Replace("Updated", ""), "HH:mm tt", CultureInfo.InvariantCulture), "Updated time is not greater than Created time");
            }
            finally
            {
                test.SQL.Admin_ContactItems_ContactItemInstance_Delete(churchId, Convert.ToInt32(test.SQL.Admin_ContactItems_FetchTheLatestContactInstanceId(churchId, itemName)));

                // Logout of Portal
                test.Portal.LogoutWebDriver();
            }
        }
Ejemplo n.º 22
0
        public void Dashboard_Setting_Saved_After_closed()
        {
            TestBaseWebDriver test        = base.TestContainer[Gallio.Framework.TestContext.CurrentContext.Test.Name];
            GeneralMethods    utility     = test.GeneralMethods;
            Random            rand        = new Random();
            bool checkOruncheckGivingItem = false;

            try
            {
                test.Dashboard.LoginWebDriver();
                new DashboardHomePage(test.Driver, test.GeneralMethods).openSettingsPage();
                DashboardSettingsPage settings = new DashboardSettingsPage(test.Driver, test.GeneralMethods, test.SQL);

                int numberOfSubItem        = settings.getWidgetSubItemsOnPage(1).Count;
                int randomSubItemIndex     = rand.Next(numberOfSubItem);
                int numberOfTurnedOnWidget = settings.getTurnedOnWidgetsTotalOnPage(settings.getWidgetsTotalOnPage());

                bool isGivingWidgetTurnedOn     = settings.isWidgetTurnedOn(1);
                bool isAttendanceWidgetTurnedOn = settings.isWidgetTurnedOn(2);

                #region make modification on settings page
                if (isGivingWidgetTurnedOn)
                {
                    if (numberOfSubItem > 0)
                    {
                        if (settings.isWidgetItemChecked(1, randomSubItemIndex))
                        {
                            settings.uncheckWidgetItem(1, randomSubItemIndex);
                            checkOruncheckGivingItem = false;
                        }
                        else
                        {
                            settings.checkWidgetItem(1, randomSubItemIndex);
                            checkOruncheckGivingItem = true;
                        }
                    }

                    settings.turnOffWidget(1);
                }
                else
                {
                    if (numberOfTurnedOnWidget < 6)
                    {
                        settings.turnOnWidget(1);
                    }
                    else
                    {
                        isGivingWidgetTurnedOn = !isGivingWidgetTurnedOn;
                        numberOfTurnedOnWidget++;
                    }

                    if (numberOfSubItem > 0)
                    {
                        if (settings.isWidgetItemChecked(1, randomSubItemIndex))
                        {
                            settings.uncheckWidgetItem(1, randomSubItemIndex);
                            checkOruncheckGivingItem = false;
                        }
                        else
                        {
                            settings.checkWidgetItem(1, randomSubItemIndex);
                            checkOruncheckGivingItem = true;
                        }
                    }
                }


                if (isAttendanceWidgetTurnedOn)
                {
                    settings.turnOffWidget(2);
                }
                else
                {
                    if (numberOfTurnedOnWidget < 6)
                    {
                        settings.turnOnWidget(2);
                    }
                    else
                    {
                        isAttendanceWidgetTurnedOn = !isAttendanceWidgetTurnedOn;
                    }
                }
                #endregion

                settings.closeSettingsPage();
                new DashboardHomePage(test.Driver, test.GeneralMethods).openSettingsPage();
                //verify all update on giving widget is saved
                Assert.AreEqual(settings.isWidgetTurnedOn(1), !isGivingWidgetTurnedOn);
                Assert.AreEqual(settings.isWidgetItemChecked(1, randomSubItemIndex), checkOruncheckGivingItem);
                //verify all update on attendance widget is saved
                Assert.AreEqual(settings.isWidgetTurnedOn(2), !isAttendanceWidgetTurnedOn);
            }
            finally
            {
                //clear test data
            }
        }
Ejemplo n.º 23
0
        public void Report_P1100_TemporaryGroup()
        {
            // Set initial conditions
            string reportName = "Individuals with Birthday in X Month (Temporary Group)";
            string reportCode = "P1100";

            base.SQL.ReportLibrary_Queue_DeleteItem(15, 65211, reportName);
            base.SQL.Groups_Group_Delete(15, reportName);

            // Login to report library
            TestBaseWebDriver test = base.TestContainer[Gallio.Framework.TestContext.CurrentContext.Test.Name];

            test.ReportLibrary.Login();

            // Search for and select a report
            test.Driver.FindElementByXPath("//input[@name='q']").SendKeys("P1100");
            test.Driver.FindElementByXPath("//input[@value='Search']").Click();
            test.GeneralMethods.WaitForElement(test.Driver, By.LinkText(reportName));
            test.Driver.FindElementByLinkText(reportName).Click();

            // Populate the report data
            test.GeneralMethods.WaitForElement(test.Driver, By.Id("dd_BirthMonth"));
            new SelectElement(test.Driver.FindElementById("dd_BirthMonth")).SelectByText("Sep");
            new SelectElement(test.Driver.FindElementById("dd_BirthMonthEnd")).SelectByText("Sep");

            test.Driver.FindElementByLinkText("Additional Filters").Click();

            test.Driver.FindElementById("rb_UseBirthDay_add").Click();
            test.Driver.FindElementById("tb_BirthDay_add").SendKeys("2");
            test.Driver.FindElementById("tb_BirthDayEnd_add").SendKeys("2");

            test.Driver.FindElementById("tb_StartAge_add").SendKeys("29");
            test.Driver.FindElementById("tb_EndAge_add").SendKeys("31");
            test.Driver.FindElementByXPath("//input[@id='submitQuery']").Click();

            // Verify the report exists and has completed
            int itemRowQueue = 0;

            Retry.WithPolling(3000).WithTimeout(200000).DoBetween(() => { test.Driver.FindElementByLinkText("Refresh for latest results").Click(); itemRowQueue = test.GeneralMethods.GetTableRowNumberWebDriver(TableIds.ReportLibrary.Queue, reportName, "Name"); }).Until(() => test.Driver.FindElementById(TableIds.ReportLibrary.Queue).FindElements(By.XPath(string.Format("//tr[{0}]/td[1]/img[@alt='Complete']", itemRowQueue + 1))).Count > 0);
            Assert.IsTrue(test.Driver.FindElementById(TableIds.ReportLibrary.Queue).FindElement(By.XPath(string.Format("//tr[{0}]/td[1]/img[contains(@src, '/ReportLibrary/public/images/status_complete.png?') and @alt='Complete']", itemRowQueue + 1))).Displayed);
            Assert.AreEqual(reportName, test.Driver.FindElementById(TableIds.ReportLibrary.Queue).FindElements(By.TagName("tr"))[itemRowQueue].FindElements(By.TagName("td"))[1].Text);
            Assert.IsTrue(test.Driver.FindElementById(TableIds.ReportLibrary.Queue).FindElement(By.XPath(string.Format("//tr[{0}]/td[position()=3 and normalize-space(text())='Temporary Group']", itemRowQueue + 1))).Displayed);
            Assert.AreEqual(reportCode, test.Driver.FindElementById(TableIds.ReportLibrary.Queue).FindElements(By.TagName("tr"))[itemRowQueue].FindElements(By.TagName("td"))[3].Text);
            Assert.IsTrue(test.Driver.FindElementById(TableIds.ReportLibrary.Queue).FindElement(By.XPath(string.Format("//tr[{0}]/td[position()=5 and contains(text(), 'Today at ')]", itemRowQueue + 1))).Displayed);

            // Logout of report library
            test.ReportLibrary.Logout();


            // Login to portal
            test.Portal.LoginWebDriver("msneeden", "Pa$$w0rd", "dc");

            // Verify the temporary group was created
            test.Driver.FindElementByLinkText("Groups").Click();
            test.Driver.Manage().Timeouts().ImplicitlyWait(TimeSpan.FromMilliseconds(1000));
            IWebElement menuItem = test.Driver.FindElement(By.XPath(string.Format("//div[@style='visibility: visible;']/dl/dt[contains(text(), '{0}')]/following-sibling::dd/a[contains(text(), '{1}')]", "Groups by Group Type", "View All")));

            menuItem.Click();
            test.Driver.FindElementByLinkText("Temporary").Click();
            int itemRowTempGroupTable = test.GeneralMethods.GetTableRowNumberWebDriver(TableIds.Portal.Groups_ViewAll_GroupList_TemporaryTab, string.Format("{0}\r\nCreated from Report Library via Individuals wit...", reportName), "Temporary Group");

            Assert.AreEqual(string.Format("{0}\r\nCreated from Report Library via Individuals wit...", reportName), test.Driver.FindElementById(TableIds.Portal.Groups_ViewAll_GroupList_TemporaryTab).FindElement(By.XPath(string.Format("//tr[{0}]/td[1]", itemRowTempGroupTable + 1))).Text);
            Assert.IsTrue(test.Driver.FindElementById(TableIds.Portal.Groups_ViewAll_GroupList_TemporaryTab).FindElement(By.XPath(string.Format("//tr[{0}]/td[2]", itemRowTempGroupTable + 1))).Text.Contains(TimeZoneInfo.ConvertTimeFromUtc(DateTime.UtcNow, TimeZoneInfo.FindSystemTimeZoneById("Central Standard Time")).AddDays(3).AddHours(6).ToShortDateString()));   // ToString("M/d/yyyy h:mm:ss tt ")

            // Logout of portal
            test.Portal.LogoutWebDriver();
        }
Ejemplo n.º 24
0
        public void People_VolunteerPipeline_VerifyRequirement_PLT()
        {
            // Login to portal
            TestBaseWebDriver test    = base.TestContainer[Gallio.Framework.TestContext.CurrentContext.Test.Name];
            GeneralMethods    utility = test.GeneralMethods;

            #region parameters
            //string applicationName = "App2015061013385442";
            //string opportunityName = "Opp2015061013385442";
            string applicationName = utility.GetUniqueName("App");
            string opportunityName = utility.GetUniqueName("Opp");
            string requirementName = utility.GetUniqueName("Req");
            string individualName  = "";

            // Prepare the communication data
            List <List <string> > comm = new List <List <string> >();
            comm.Add(new List <string>());
            comm[0].Add("Phone");
            comm[0].Add("Home");
            comm[0].Add("8479520411");
            comm.Add(new List <string>());
            comm[1].Add("Email");
            comm[1].Add("Email");
            comm[1].Add("*****@*****.**");

            List <string> individules = new List <string>();

            PortalBase.AddressData address = new PortalBase.AddressData {
                Country = "Canada", Address_1 = "#35 250 Satok Crescent", City = "Milton", Province = "Ontario", Postal_code = "L9T 3P4"
            };
            #endregion

            try
            {
                //Login to portal
                test.Portal.LoginWebDriver("ft.tester", "FT4life!", "dc");

                #region create a volunteer application form
                test.Portal.WebLink_volunteerApplicationForm_Create(applicationName, opportunityName, "Children - hyphen", "FT Tester", requirementName);
                #endregion

                #region create requirements against specific application
                for (int i = 0; i < 100; i++)
                {
                    string firstName = "Auto";
                    string lastName  = utility.GetUniqueName("T");
                    individualName = string.Format("{0} {1}", firstName, lastName);
                    individules.Add(individualName);
                    //Will update it later to generate fake data in database, instead of by front-end
                    test.Portal.People_AddHousehold(firstName, lastName, HouseholdPositionConstants.Head, "Member", comm, address, DateTime.Now.ToString("M/d/yyyy"));
                    test.Portal.People_Edit_Individual_Info(individualName, null, "Male", "Married", "12/23/1960");
                    test.Portal.People_volunteerPipeline_submitApplication(individualName, applicationName, opportunityName);
                    test.Portal.People_volunteerPipeline_reviewApplication_addNotes(individualName, applicationName, opportunityName);
                    test.Portal.People_volunteerPipeline_reviewApplication(individualName, applicationName, opportunityName);
                    test.Portal.People_volunteerPipeline_ministryReview_addNotes(individualName, "Children - hyphen", applicationName, opportunityName);
                    test.Portal.People_volunteerPipeline_ministryReview(individualName, "Children - hyphen", applicationName, opportunityName);

                    test.Portal.People_volunteerPipeline_backgroundCheck_add(individualName, applicationName, opportunityName, "111111111", "Background Check");
                    test.Portal.People_volunteerPipeline_verifyRequirements_addNotes(individualName, applicationName, opportunityName);
                }
                #endregion

                utility.Navigate_Portal(Navigation.People.Volunteer_Pipeline.Verify_Requirements);
                new SelectElement(test.Driver.FindElement(By.Id("ctl00_ctl00_MainContent_content_WorkVolunteerListCtrl1_ddVolunteerApplicationId"))).SelectByText(applicationName);

                //assert page load time
                Assert.GreaterThan(10000, utility.getPageLoadTime(), "Page load time should not exceed 10 seconds");

                // Logout of portal
                test.Portal.LogoutWebDriver();
            }
            finally
            {
                test.SQL.WebLink_VolunteerApplicationForm_Delete(15, applicationName);
                foreach (string individule in individules)
                {
                    test.SQL.People_Individual_Delete(15, individule.Split(' ')[0], individule.Split(' ')[1]);
                }
            }
        }