public void ThenISeeClaimsDisplayOnTheListWithValidDataInOrder()
        {
            Dictionary <string, string> parameters = new Dictionary <string, string>();

            parameters.Add("CaseId", Convert.ToString(CaseDetailSteps.GetCaseIdFromCaseNumber(ScenarioContext.Current.Get <string>("Case Number"))));
            parameters.Add("OfficeId", Convert.ToString(CommonDBSteps.GetConfigOfficeId()));

            DataRowCollection expected = ExecuteQueryOnDB(Properties.Resources.GetClaimsDetailsByCaseId, parameters);

            IEnumerator <ClaimData> actualClaims = claimsTab.GetFirstNClaims(expected.Count).GetEnumerator();

            actualClaims.MoveNext();

            foreach (DataRow claimFromDB in expected)
            {
                ClaimData claim = actualClaims.Current;

                claim.ClaimNumber.Trim().Should().Be(claimFromDB.Field <string>("ClaimNumber").Trim(), "[" + claim.Id + "] Claim Number is correct");
                claim.CreditorName.Should().BeEquivalentTo(claimFromDB.Field <string>("CreditorName").TrimEnd(), "[" + claim.Id + "] Claim Creditor Name is correct");

                string status = claimFromDB.Field <string>("Status");
                claim.Status.Should().Be(status.ToUpper(), "[" + claim.Id + "] Claim Status is " + status);
                string statusColor = this.GetStatusColor(status);
                claim.CornerTagColor.Should().Be(statusColor, "[" + claim.Id + "] Claim Corner Tag Color is " + statusColor);
                string cornerTagLetter = this.getCornerTagLetter(status);
                claim.CornerTagLetter.Should().Be(cornerTagLetter, "[" + claim.Id + "] Claim Corner Tag Letter is " + cornerTagLetter);
                claim.StatusColor.Should().Be(statusColor, "[" + claim.Id + "] Claim Status Color is " + statusColor);

                string claimClass = claimFromDB.Field <string>("ClaimClass");
                claim.Class.Should().Be(claimClass, "[" + claim.Id + "] Claim Class is " + claimClass);
                string classColor = this.GetCircleClassColor(claimClass);
                claim.CircleIndicatorColor.Should().Be(classColor, "[" + claim.Id + "] Claim Circle Ind. Color is " + classColor);

                claim.Category.Should().Be(claimFromDB.Field <string>("Category"), "[" + claim.Id + "] Claim Category is correct");
                claim.Code.Should().Be(claimFromDB.Field <string>("Code"), "[" + claim.Id + "] Claim CODE is correct");
                claim.PaySequence.Should().Be("" + claimFromDB.Field <int>("PaySequence"), "[" + claim.Id + "] Claim Pay Sequence is correct");

                string expClaimedStr = this.GetClaimExpectedAmount(claimFromDB.Field <Decimal>("ClaimedAmount"));
                claim.Claimed.Replace(",", "").Should().Be(expClaimedStr, "[" + claim.Id + "] Claim Claimed amount is correct");

                string expAllowedStr = this.GetClaimExpectedAmount(claimFromDB.Field <Decimal>("AllowedAmount"));
                claim.Allowed.Replace(",", "").Should().Be(expAllowedStr, "[" + claim.Id + "] Claim Allowed amount is correct");

                string expPaidStr = this.GetClaimExpectedAmount(claimFromDB.Field <Decimal>("PaidAmount"));
                claim.Paid.Replace(",", "").Should().Be(expPaidStr, "[" + claim.Id + "] Claim Paid amount is correct");

                string expReservedStr = this.GetClaimExpectedAmount(claimFromDB.Field <Decimal>("ReservedAmount"));
                claim.Reserved.Replace(",", "").Should().Be(expReservedStr, "[" + claim.Id + "] Claim Reserved amount is correct");

                string expInterestStr = this.GetClaimExpectedAmount(claimFromDB.Field <Decimal>("Interest"));
                claim.Interest.Replace(",", "").Should().Be(expInterestStr, "[" + claim.Id + "] Claim Interest amount is correct");

                string expBalanceStr = this.GetClaimExpectedAmount(claimFromDB.Field <Decimal>("BalanceAmount"));
                claim.Balance.Replace(",", "").Should().Be(expBalanceStr, "[" + claim.Id + "] Claim Balance amount is correct");

                actualClaims.MoveNext();
            }
        }
Пример #2
0
        public void WhenISearchForACaseWithMultipleAssetsToDelete()
        {
            //get a case from DB to work with
            Dictionary <string, string> parameters = new Dictionary <string, string>();

            parameters.Add("OfficeId", Convert.ToString(CommonDBSteps.GetConfigOfficeId()));
            DataRow coreCaseNumber = ExecuteQueryOnDB(Properties.Resources.GetACoreCaseNumberForThisOffice, parameters)[0];
            string  caseNbr        = coreCaseNumber.Field <string>("CoreCaseNumber");

            //search for the case on Super Admin search tool
            SuperAdminPage superadmin = ((SuperAdminPage)GetSharedPageObjectFromContext("Super Admin"));

            superadmin.UniversalSearch.EnterTextForSearch(caseNbr);
            superadmin.UniversalSearch.ClickOnCaseResultByCaseNumberOnSupreadmin(caseNbr);

            //Save Case number on Scenario
            AddDataToScenarioContextOverridingExistentKey("Case Number", caseNbr);
        }
Пример #3
0
        public void ThenISeeSuperAdminPageWithCorrectLayout()
        {
            string expOffice  = ConfigurationManager.AppSettings.Get("Office");
            string expCaseNbr = ScenarioContext.Current.Get <string>("Case Number");
            Dictionary <string, string> parameters = new Dictionary <string, string>();

            parameters.Add("OfficeId", Convert.ToString(CommonDBSteps.GetConfigOfficeId()));
            parameters.Add("CoreCaseNumber", expCaseNbr);
            DataRow caseInfo    = ExecuteQueryOnDB(Properties.Resources.GetCaseDetailSPByCoreCaseNumber, parameters)[0];
            string  expCaseName = caseInfo.Field <string>("CaseName");

            SuperAdminPage superadmin = ((SuperAdminPage)GetSharedPageObjectFromContext("Super Admin"));

            superadmin.OfficeInfo.Should().Be("OFFICE: " + expOffice.ToUpper(), "Office info is correct");
            superadmin.CaseInfo.Should().Be(expCaseNbr + " " + expCaseName, "Case info is correct");
            superadmin.AssetsButtonText.Should().Be("Asset", "Assets button is present and correct");
            superadmin.DocketsButtonText.Should().Be("Docket", "Dockets button is present and correct");
            superadmin.DocumentsButtonText.Should().Be("Document", "Documents button is present and correct");
        }
Пример #4
0
        public void ThenIVerifyTheSelectedParticipantIsLinkedToTheTransactionOnDB()
        {
            //get participant id either from Claim if claim links present or from Participant table record
            Dictionary <string, string> parameters = new Dictionary <string, string>();
            int participantId = 0;

            try
            {
                //If there were claim links, linked participant is claim's paticipant
                List <string> claimLinkIds = ScenarioContext.Current.Get <List <string> >("Claim Links Ids");
                parameters.Add("ClaimId", claimLinkIds[0]);
                parameters.Add("CaseId", Convert.ToString(CaseDetailSteps.GetCaseIdFromCaseNumber(ScenarioContext.Current.Get <string>("Case Number"))));
                parameters.Add("OfficeId", Convert.ToString(CommonDBSteps.GetConfigOfficeId()));

                DataRowCollection rows1 = ExecuteQueryOnDB(Properties.Resources.GetParticipantIdFromClaim, parameters);
                participantId = Convert.ToInt32(rows1[0].ItemArray[0]);
                parameters.Remove("ClaimId");
                parameters.Remove("CaseId");
                parameters.Remove("OfficeId");
            }
            catch (KeyNotFoundException)
            {
                //Else, there were no claim links, linked participant is new created participant
                string expectedParticipantName = ScenarioContext.Current.Get <string>("Participant Description");
                parameters.Add("ParticipantNameLike", expectedParticipantName);
                DataRowCollection rows2 = ExecuteQueryOnDB(Properties.Resources.GetParticipantIdFromName, parameters);
                participantId = Convert.ToInt32(rows2[0].ItemArray[0]);
                parameters.Remove("ParticipantNameLike");
            }


            //get participant id from Transaction table record
            string serialNbr = ScenarioContext.Current.Get <string>("Transaction Serial Number");

            parameters.Add("TransactionId", "" + bankingTab.GetTransactionIdFromListBySerialNumber(serialNbr));
            DataRowCollection rowsTrx = ExecuteQueryOnDB(Properties.Resources.GetTransactionDetails, parameters);

            rowsTrx.Count.Should().BeGreaterThan(0, "Transaction record must be on DB");
            int participantIdTrx = Convert.ToInt32(rowsTrx[0].ItemArray[3]);

            //Compare and check the linking is OK
            participantIdTrx.Should().Be(participantId, "Participant Id linked to created transaction is correct on DB");
        }
        public void ThenISeeClaimsSummaryTilesAndAllValuesAreCorrect()
        {
            //Get summary data from DB to verify is correctlyl displayed on the UI
            Dictionary <string, string> parameters = new Dictionary <string, string>();

            parameters.Add("CaseId", Convert.ToString(CaseDetailSteps.GetCaseIdFromCaseNumber(ScenarioContext.Current.Get <string>("Case Number"))));
            parameters.Add("OfficeId", Convert.ToString(CommonDBSteps.GetConfigOfficeId()));
            DataRowCollection expectedCardDetail = ExecuteQueryOnDB(Properties.Resources.GetClaimsSummaryByCaseRetrieve, parameters);

            ScenarioContext.Current.Add("Parameters Table", expectedCardDetail);

            claimsTab.IsFirstSummaryCardSelected().Should().BeTrue("All Claims Summary Card is selected by Default");

            List <ClaimSummaryItemData> summaryCards = claimsTab.GetClaimSummaryItems();

            IEnumerator enumExpectedCardDetail = expectedCardDetail.GetEnumerator();

            enumExpectedCardDetail.MoveNext();

            //check each item in given order, positions should match
            for (int i = 0; i < expectedCardDetail.Count; i++)
            {
                //expected values in this position
                DataRow row          = (DataRow)enumExpectedCardDetail.Current;
                string  expCardTitle = row.Field <string>("ClassType");
                string  expBalance   = row.Field <string>("Balance");
                string  expClaimed   = row.Field <string>("Claimed");
                string  expPaid      = row.Field <string>("Paid");
                string  expReserved  = row.Field <string>("Reserved");

                //actual values in this position
                ClaimSummaryItemData item = summaryCards[i];

                //Verifications

                //Title
                item.Title.Should().Be(expCardTitle, "Card Title is correct for Summary Item " + expCardTitle);

                //Balance
                item.BalanceLabel.Should().Be("BALANCE", expCardTitle + " Card: Balance label is correct");
                item.Balance.Should().Be(expBalance, expCardTitle + " Card: Balance value is correct");
                if (expBalance.StartsWith("-"))
                {
                    item.BalanceTextColor.Should().Be("RED");
                }

                //Claimed
                item.ClaimedLabel.Should().Be("CLAIMED", expCardTitle + " Card: Claimed label is correct");
                item.Claimed.Should().Be(expClaimed, expCardTitle + " Card: Claimed value is correct");
                if (expClaimed.StartsWith("-"))
                {
                    item.ClaimedTextColor.Should().Be("RED");
                }

                //Paid
                item.PaidLabel.Should().Be("PAID", expCardTitle + " Card: Paid label is correct");
                item.Paid.Should().Be(expPaid, expCardTitle + " Card: Paid value is correct");
                if (expPaid.StartsWith("-"))
                {
                    item.PaidTextColor.Should().Be("RED");
                }

                //Reserved
                item.ReservedLabel.Should().Be("RESERVED", expCardTitle + " Card: Reserved label is correct");
                item.Reserved.Should().Be(expReserved, expCardTitle + " Card: Reserved value is correct");
                if (expReserved.StartsWith("-"))
                {
                    item.ReservedTextColor.Should().Be("RED");
                }

                //move enumerator from db data
                enumExpectedCardDetail.MoveNext();
            }
        }
Пример #6
0
        public void verifyAdditionalDebtorInformationSectionLayout()
        {
            WebDriverWait wait = new WebDriverWait(driver, TimeSpan.FromSeconds(50));

            Thread.Sleep(2000);

            /////////// Query to DB and validations between UI and DB ///////////
            DataRowCollection        rows       = null;
            Dictionary <string, int> parameters = new Dictionary <string, int>();
            int caseId = ScenarioContext.Current.Get <int>("caseId");

            parameters.Clear();
            parameters.Add("caseId", caseId);
            parameters.Add("OfficeId", CommonDBSteps.GetConfigOfficeId());

            rows = ExecuteQueryOnDBWithInt(Properties.Resources.getCaseDetailSP, parameters);

            pleaseWaitSignDissapear();
            /////////// DEBTOR SECTION ////////////
            IWebElement debtorLabel                = createVisibleWebElementByXpath("//label[@id='debtorLabel']");
            IWebElement debtorNameSection          = createVisibleWebElementByXpath("//div[@id='debtorNameSection']");
            IWebElement debtorSSNLabel             = createVisibleWebElementByXpath("//label[@id='debtorSSNLabel']");
            IWebElement debtorSSNSection           = createVisibleWebElementByXpath("//div[@id='debtorSSNSection']");
            IWebElement debtorPhoneLabel           = createVisibleWebElementByXpath("//label[@id='debtorPhoneLabel']");
            IWebElement debtorPhoneSection         = createVisibleWebElementByXpath("//div[@id='debtorPhoneSection']");
            IWebElement debtorEmailLabel           = createVisibleWebElementByXpath("//label[@id='debtorEmailLabel']");
            IWebElement debtorEmailSection         = createVisibleWebElementByXpath("//div[@id='debtorEmailSection']");
            IWebElement debtorAddressLabel         = createVisibleWebElementByXpath("//label[@id='debtorAddressLabel']");
            IWebElement debtorAddressStreetSection = createVisibleWebElementByXpath("//div[@id='debtorAddressSection']/div[1]");
            IWebElement debtorAddressStateSection  = createVisibleWebElementByXpath("//div[@id='debtorAddressSection']/div[2]");
            IWebElement closeSectionButton         = createVisibleWebElementByXpath("//div[@class[contains(.,'debtorAdditionalInformationClose')]]");
            IWebElement closeSectionButtonIcon     = createVisibleWebElementByXpath("//div[@class[contains(.,'debtorAdditionalInformationClose')]]/i");

            if (rows[0].ItemArray[15].ToString() != "")
            {
                /////////// JOINT DEBTOR SECTION ////////////
                IWebElement jointDebtorLabel                = createVisibleWebElementByXpath("//label[@id='jointDebtorLabel']");
                IWebElement jointDebtorNameSection          = createVisibleWebElementByXpath("//div[@id='jointDebtorNameSection']");
                IWebElement jointDebtorSSNLabel             = createVisibleWebElementByXpath("//label[@id='jointDebtorSSNLabel']");
                IWebElement jointDebtorSSNSection           = createVisibleWebElementByXpath("//div[@id='jointDebtorSSNSection']");
                IWebElement jointDebtorPhoneLabel           = createVisibleWebElementByXpath("//label[@id='jointDebtorPhoneLabel']");
                IWebElement jointDebtorPhoneSection         = createVisibleWebElementByXpath("//div[@id='jointDebtorPhoneSection']");
                IWebElement jointDebtorEmailLabel           = createVisibleWebElementByXpath("//label[@id='jointDebtorEmailLabel']");
                IWebElement jointDebtorEmailSection         = createVisibleWebElementByXpath("//div[@id='jointDebtorEmailSection']");
                IWebElement jointDebtorAddressLabel         = createVisibleWebElementByXpath("//label[@id='jointDebtorAddressLabel']");
                IWebElement jointDebtorAddressStreetSection = createVisibleWebElementByXpath("//div[@id='jointDebtorAddressSection']/div[1]");
                IWebElement jointDebtorAddressStateSection  = createVisibleWebElementByXpath("//div[@id='jointDebtorAddressSection']/div[2]");
                Assert.True(jointDebtorLabel.Text == "JOINT DEBTOR");
                Assert.True(jointDebtorSSNLabel.Text == "SSN");
                Assert.True(jointDebtorPhoneLabel.Text == "PHONE #");
                Assert.True(jointDebtorEmailLabel.Text == "EMAIL");
                Assert.True(jointDebtorAddressLabel.Text == "ADDRESS");
                assertElementIsDisplayedIfDBValueNotNullInUpperCase(rows, 0, 15, "", jointDebtorNameSection);
                if (rows[0].ItemArray[16].ToString() == "")
                {
                    Assert.True(jointDebtorSSNSection.Text.Contains("-  -"));
                }
                else
                {
                    string fullSSN     = rows[0].ItemArray[16].ToString();
                    string partialSSN1 = removeCharsFromString(fullSSN, 0, 7, "");
                    string partialSSN2 = "XXX-XX-" + partialSSN1;
                    string partialSSN3 = "XXX-XX-";
                    string noSSN       = "XXX-XX-XXXX";
                    Assert.True(jointDebtorSSNSection.Text.Contains(fullSSN) || jointDebtorSSNSection.Text.Contains(partialSSN2) || jointDebtorSSNSection.Text.Contains(noSSN) || jointDebtorSSNSection.Text.Contains(partialSSN3));
                }
                assertElementIsDisplayedIfDBValueNotNullInUpperCase(rows, 0, 29, "", jointDebtorPhoneSection);
                assertElementIsDisplayedIfDBValueNotNullRegularCase(rows, 0, 28, "", jointDebtorEmailSection);
                assertElementIsDisplayedIfDBValueNotNullInUpperCase(rows, 0, 26, "", jointDebtorAddressStreetSection);
                assertElementIsDisplayedIfDBValueNotNullInUpperCase(rows, 0, 25, "", jointDebtorAddressStateSection);
                assertElementIsDisplayedIfDBValueNotNullInUpperCase(rows, 0, 27, "", jointDebtorAddressStateSection);
            }
            else
            {
                waitElementIsInvisibleByXPath("//label[@id='jointDebtorLabel']", "JOINT DEBTOR");
                waitElementIsInvisibleByXPath("//div[@id='jointDebtorNameSection']", "");
                waitElementIsInvisibleByXPath("//label[@id='jointDebtorSSNLabel']", "SSN");
                waitElementIsInvisibleByXPath("//div[@id='jointDebtorSSNSection']", "");
                waitElementIsInvisibleByXPath("//label[@id='jointDebtorPhoneLabel']", "PHONE #");
                waitElementIsInvisibleByXPath("//div[@id='jointDebtorPhoneSection']", "");
                waitElementIsInvisibleByXPath("//label[@id='jointDebtorEmailLabel']", "EMAIL");
                waitElementIsInvisibleByXPath("//div[@id='jointDebtorEmailSection']", "");
                waitElementIsInvisibleByXPath("//label[@id='jointDebtorAddressLabel']", "ADDRESS");
                waitElementIsInvisibleByXPath("//div[@id='jointDebtorAddressSection']", "");
            }
            Assert.True(closeSectionButton.Text == "CLOSE");
            Assert.True(closeSectionButtonIcon.GetAttribute("class").ToString().Contains("up"));
            Assert.True(debtorLabel.Text == "DEBTOR");
            Assert.True(debtorSSNLabel.Text == "SSN");
            Assert.True(debtorPhoneLabel.Text == "PHONE #");
            Assert.True(debtorEmailLabel.Text == "EMAIL");
            Assert.True(debtorAddressLabel.Text == "ADDRESS");
            assertElementIsDisplayedIfDBValueNotNullRegularCase(rows, 0, 2, "", debtorNameSection);
            if (rows[0].ItemArray[12].ToString() == "")
            {
                Assert.True(debtorSSNSection.Text.Contains("-  -"));
            }
            else
            {
                string fullSSN     = rows[0].ItemArray[12].ToString();
                string partialSSN1 = removeCharsFromString(fullSSN, 0, 7, fullSSN);
                string partialSSN2 = "XXX-XX-" + partialSSN1;
                string partialSSN3 = "XXX-XX-";
                string noSSN       = "XXX-XX-XXXX";
                Assert.True(debtorSSNSection.Text.Contains(fullSSN) || debtorSSNSection.Text.Contains(partialSSN2) || debtorSSNSection.Text.Contains(noSSN) || debtorSSNSection.Text.Contains(partialSSN3));
            }
            assertElementIsDisplayedIfDBValueNotNullInUpperCase(rows, 0, 23, "", debtorPhoneSection);
            assertElementIsDisplayedIfDBValueNotNullRegularCase(rows, 0, 22, "", debtorEmailSection);
            assertElementIsDisplayedIfDBValueNotNullInUpperCase(rows, 0, 20, "", debtorAddressStreetSection);
            assertElementIsDisplayedIfDBValueNotNullInUpperCase(rows, 0, 21, "", debtorAddressStateSection);
            assertElementIsDisplayedIfDBValueNotNullInUpperCase(rows, 0, 18, "", debtorAddressStateSection);
            assertElementIsDisplayedIfDBValueNotNullInUpperCase(rows, 0, 19, "", debtorAddressStateSection);
        }