private void ThenISeeClaimCategoryHeaderAndCategoryDisplays(int count)
        {
            DistributionForm newDistribution = ScenarioContext.Current.Get <DistributionForm>("New Distribution Form");

            newDistribution.ClaimCategoryHeader.Should().Be("CLAIM CATEGORY", "Claim Category header is correct");
            newDistribution.ClaimCategoriesCount.Should().Be(count, count + " categories display under Claim Category section");
        }
        private void WhenIEnterValuesOnStepOne(string amount, string name)
        {
            DistributionForm newDistribution = ScenarioContext.Current.Get <DistributionForm>("New Distribution Form");

            newDistribution.ProposedAmountToDistribute = amount;
            newDistribution.DistributionName           = name;
        }
        private void ThenISeeRemainigBalanceDisplaysCorrectlyAsPositiveValue()
        {
            DistributionForm newDistribution = ScenarioContext.Current.Get <DistributionForm>("New Distribution Form");

            newDistribution.RemainingBalance.Should().MatchRegex("\\$([0-9]*)(,[0-9]*)*(\\.[0-9][0-9])?", "Positive values display correctly");
            newDistribution.RemainingBalanceColor.Should().Be("BLACK", "Positive Remaining Balance displays in red color");
        }
        private void ThenISeeRemainigBalanceDisplaysCorrectlyAsNegativeValue()
        {
            DistributionForm newDistribution = ScenarioContext.Current.Get <DistributionForm>("New Distribution Form");

            newDistribution.RemainingBalance.Should().MatchRegex("\\(\\$([0-9]*)(,[0-9]*)*(\\.[0-9][0-9])?\\)", "Negative values display within parenthesis");
            newDistribution.RemainingBalanceColor.Should().Be("RED", "Negative Remaining Balance displays in red color");
        }
Ejemplo n.º 5
0
        public void WhenIEnterPercentageForNewDistributionAndPressEnterKey(string value, string field)
        {
            DistributionForm newDistribution = ScenarioContext.Current.Get <DistributionForm>("New Distribution Form");

            this.SetFieldWithValue(newDistribution, field, value);
            newDistribution.PressEnterKey();
        }
        private void WhenIClickOnNewDistibutionButtonOnSummaryCard()
        {
            DistributionForm newDistribution = distributionTab.ClickNewDistribution();

            //save distribution form on scenario context
            ScenarioContext.Current.Add("New Distribution Form", newDistribution);
        }
Ejemplo n.º 7
0
        public void ThenISeeAValidationErrorOn(string field, string expectedError)
        {
            DistributionForm newDistribution = ScenarioContext.Current.Get <DistributionForm>("New Distribution Form");

            switch (field)
            {
            case "Name":
                newDistribution.DistributionNameValidationMessage.Should().Be(expectedError);
                break;

            case "ProposedAmount":
                newDistribution.ProposedAmountValidationMessage.Should().Be(expectedError);
                break;

            case "Percentage":
                newDistribution.PercentageValidationMessage.Should().Be(expectedError);
                break;

            case "CalculatedAmount":
                newDistribution.CalculatedAmountValidationMessage.Should().Be(expectedError);
                break;

            default:
                ScenarioContext.Current.Pending();
                break;
            }
        }
        private void ThenISeeNewDistributionFormDisplaysFieldsLabelsAndPlaceholdersCorrectlyForStepOne()
        {
            DistributionForm newDistribution = ScenarioContext.Current.Get <DistributionForm>("New Distribution Form");

            newDistribution.FormTitle.Should().Be("New Distribution", "On Step 1, form Title is 'New Distribution'");

            //type
            newDistribution.TypeLabel.Should().Be("DISTRIBUTION TYPE", "Distribution type label is correct");
            newDistribution.BreakdownTypeIsSelected.Should().BeTrue("New Distribution default selected type is 'Breakdown'");
            newDistribution.SelectedTypeDescription.Should().Be("Breakdown - allows users to put creditors into payment groups and allows flexibility of how you pay out each group", "New Distribution default selected type description is correct");

            //bank balance
            newDistribution.BankBalanceLabel.Should().Be("BANK BALANCE", "Bank Balance label is correct");

            //amount on reserve
            newDistribution.AmountOnReserveLabel.Should().Be("AMOUNT ON RESERVE", "Bank Balance label is correct");

            //amount available
            newDistribution.AmountAvailableForDistributionLabel.Should().Be("AMOUNT AVAILABLE FOR DISTRIBUTION", "Amount Available For Distribution label is correct");

            //amount to distribute
            newDistribution.ProposedAmountToDistributeLabel.Should().Be("AMOUNT TO DISTRIBUTE", "Amount to distribute label is correct");
            newDistribution.ProposedAmountToDistributePlaceholder.Should().Be("$ 0.00", "Amount to distribute placeholder is correct");

            //amount available
            newDistribution.RemainingBalanceLabel.Should().Be("REMAINING BALANCE", "Remaining Balance label is correct");

            //remaining balance label and value
            newDistribution.DistributionNameLabel.Should().Be("DISTRIBUTION NAME", "Distribution Name label is correct");
            newDistribution.ProposedDistributionPlaceholder.Should().Be("Enter name...", "Distribution Name placeholder is correct");
        }
        private void ThenISeeSaveButtonDisplays()
        {
            DistributionForm newDistribution = ScenarioContext.Current.Get <DistributionForm>("New Distribution Form");

            newDistribution.IsPresentSaveButton.Should().BeTrue("Save button displays");
            newDistribution.SaveButtonText.Should().Be("SAVE", "Save button text is correct");
        }
        private void ThenISeeAllClaimCategoriesDisplayCorrectly(Table table)
        {
            TableRows expectedClasses = table.Rows;

            DistributionForm newDistribution = ScenarioContext.Current.Get <DistributionForm>("New Distribution Form");
            IEnumerator <DistributionClaimCategoryData> actualCategories = newDistribution.GetFirstNCategories(expectedClasses.Count).GetEnumerator();

            actualCategories.MoveNext();

            foreach (TableRow expCategoryData in expectedClasses)
            {
                string expClassName = expCategoryData["Claim Category"];
                string expCount     = expCategoryData["Count"];
                bool   expSelected  = Convert.ToBoolean(expCategoryData["Selected"]);
                string expBalance   = expCategoryData["Balance"];
                string expReserved  = expCategoryData["Reserved"];

                DistributionClaimCategoryData categoryData = actualCategories.Current;
                categoryData.Selected.Should().Be(expSelected, "Claim Class '" + expClassName + "' selected is correct");
                categoryData.Name.Should().Be(expClassName + " (" + expCount + ")", "Claim Class '" + expClassName + "' name is correct");
                categoryData.BalanceLabel.Should().Be("BALANCE", "Claim Class '" + expClassName + "' balance label is correct");
                categoryData.BalanceValue.Should().Be(expBalance, "Claim Class '" + expClassName + "' balance value is correct");
                categoryData.Reserved.Should().Be(expReserved + " Reserved");

                actualCategories.MoveNext();
            }
        }
        private void WhenIEnterOnStepTwo(string percentage, string amount)
        {
            DistributionForm newDistribution = ScenarioContext.Current.Get <DistributionForm>("New Distribution Form");

            newDistribution.PercentageToDistribute       = percentage;
            newDistribution.CalculatedAmountToDistribute = amount;
        }
        private void ThenISeeClaimCategoryHeaderAndSomeCategoryDisplays()
        {
            DistributionForm newDistribution = ScenarioContext.Current.Get <DistributionForm>("New Distribution Form");

            newDistribution.ClaimCategoryHeader.Should().Be("CLAIM CATEGORY", "Claim Category header is correct");
            newDistribution.ClaimCategoriesCount.Should().BeGreaterThan(0, "Some category displays under Claim Category section");
        }
        private void ThenISeeNewDistributionFormDisplaysNextAndCancelButton()
        {
            DistributionForm newDistribution = ScenarioContext.Current.Get <DistributionForm>("New Distribution Form");

            newDistribution.NextButtonIsPresent.Should().BeTrue("Next button is present on New Distribution form");
            newDistribution.CancelButtonIsPresent.Should().BeTrue("Cancel button is present on New Distribution form");
        }
        private void ThenISeeClaimsClassHeaderAndSomeClassDisplays()
        {
            DistributionForm newDistribution = ScenarioContext.Current.Get <DistributionForm>("New Distribution Form");

            newDistribution.ClaimClassHeader.Should().Be("CLAIM CLASS", "Claim Class header is correct");
            newDistribution.ClaimClassesCount.Should().BeGreaterThan(0, "Some class displays under Claim Class section");
        }
Ejemplo n.º 15
0
        private void SetFieldWithValue(DistributionForm newDistribution, string field, string value)
        {
            switch (field)
            {
            case "Name":
                newDistribution.DistributionName = value;
                break;

            case "ProposedAmount":
                newDistribution.ProposedAmountToDistribute = value;
                break;

            case "Percentage":
                newDistribution.PercentageToDistribute = value;
                break;

            case "CalculatedAmount":
                newDistribution.CalculatedAmountToDistribute = value;
                break;

            default:
                ScenarioContext.Current.Pending();
                break;
            }
        }
        private void WhenISelectMethodPayEachClaimEqually(string method)
        {
            //get distribution Form from ScenarioContext
            DistributionForm newDistribution = ScenarioContext.Current.Get <DistributionForm>("New Distribution Form");

            newDistribution.SelectPaymentMethod(method);
        }
        private void ThenISeeMethodProRataIsUnselectedAndPayEachClaimEquallyIsSelected()
        {
            // get distribution Form from ScenarioContext
            DistributionForm newDistribution = ScenarioContext.Current.Get <DistributionForm>("New Distribution Form");

            newDistribution.IsSelectedMethod("Pay Each Claim Equally").Should().BeTrue("Pay Each Claim Equally method is selected");
            newDistribution.IsSelectedMethod("Pro Rata").Should().BeFalse("Pro Rata method is unselected");
        }
Ejemplo n.º 18
0
        public void ThenEnteringValidValuesForAmountAndDistributionNameMakesTheValidationMessagesDissapear()
        {
            DistributionForm newDistribution = ScenarioContext.Current.Get <DistributionForm>("New Distribution Form");

            newDistribution.ProposedAmountToDistribute = "100";
            newDistribution.HasProposedAmountMessageDissapeared().Should().BeTrue("Validation message for Proposed Amount dissappears after entering a valid value");
            newDistribution.DistributionName = "Automated Test of Validations " + this.GetRandomNumber();;
            newDistribution.DistributionNameMessageDissapeared().Should().BeTrue("Validation message for Distribution Name dissappears after entering a valid value");
        }
        private void ThenISeeNewDistributionFormDisplaysCorrectlyForStepTwoOnGroupingWith(string percentage, string amount)
        {
            DistributionForm newDistribution = ScenarioContext.Current.Get <DistributionForm>("New Distribution Form");

            newDistribution.PercentageToDistributeLabel.Should().Be("PERCENTAGE TO DISTRIBUTE", "Percentage to distribute label is correct");
            newDistribution.PercentageToDistributeValueOnFocus.Should().Be(percentage, "Percentage to distribute shows '%' on focus");
            newDistribution.CalculatedAmountToDistributeLabel.Should().Be("AMOUNT TO DISTRIBUTE", "Amount to distribute label is correct");
            newDistribution.CalculatedAmountToDistribute.Replace(" ", "").Should().Be(amount, "Amount to distribute shows $0.00 on focus");
        }
Ejemplo n.º 20
0
        public void ThenEnteringValidValuesForPercentageAndAmountMakesTheValidationMessagesDissapear()
        {
            DistributionForm newDistribution = ScenarioContext.Current.Get <DistributionForm>("New Distribution Form");

            newDistribution.PercentageToDistribute = "100";
            newDistribution.HasPercentageMessageDissapeared().Should().BeTrue("Validation message for Percentage dissappears after entering a valid value");
            newDistribution.CalculatedAmountToDistribute = "";
            newDistribution.HasCalculatedAmountMessageDissapeared().Should().BeTrue("Validation message for Calculated Amount dissappears after entering a valid value");
        }
        private void ThenICanSelectProRataAgainAfterSelectingPayEachClaimEqually()
        {
            //get distribution Form from ScenarioContext
            DistributionForm newDistribution = ScenarioContext.Current.Get <DistributionForm>("New Distribution Form");

            newDistribution.SelectPaymentMethod("Pro Rata");
            newDistribution.IsSelectedMethod("Pro Rata").Should().BeTrue("Pro Rata method is selected");
            newDistribution.IsSelectedMethod("Pay Each Claim Equally").Should().BeFalse("Pay Each Claim Equally method is unselected");
        }
        private void ThenISeeNewDistributionFormLocksDownStepSectionAndTitleIsDistributionsName()
        {
            DistributionForm newDistribution = ScenarioContext.Current.Get <DistributionForm>("New Distribution Form");
            string           name            = ScenarioContext.Current.Get <string>("New Distribution Name");
            string           amountToDistr   = ScenarioContext.Current.Get <string>("New Distribution Amount");

            newDistribution.FormTitle.Should().Be(name, "Once moved on to Step 2, form Title becomes new distribution's name");
            newDistribution.ProposedAmountToDistributeIsEditable.Should().BeFalse("Proposed Amount to Distribute is not editable after clicking on Next");
            newDistribution.ProposedAmountToDistributeNonEditableValue.Replace(" ", "").Should().Be(amountToDistr, "Proposed Amount to distribute is set");
        }
        private void ThenISeeNewDistributionFormDisplaysCalculatedBalancesWithCorrectFormatForStep()
        {
            DistributionForm newDistribution = ScenarioContext.Current.Get <DistributionForm>("New Distribution Form");
            string           moneyRegExp     = "\\(?\\$([0-9]*)(,[0-9]*)*(\\.[0-9][0-9])?\\)?";

            newDistribution.BankBalance.Should().MatchRegex(moneyRegExp, "Bank Balance format is correct");
            newDistribution.AmountOnReserve.Should().MatchRegex(moneyRegExp, "Amount on Reserve dormat is correct");
            newDistribution.AmountAvailableForDistribution.Should().MatchRegex(moneyRegExp, "Amount Available for Distribution format is correct");
            newDistribution.RemainingBalance.Should().MatchRegex(moneyRegExp, "Remaining Balance format is correct");
        }
        private void ThenISeeNewDistributionFormDisplaysFieldsLabelsAndPlaceholdersCorrectlyForStepTwo()
        {
            DistributionForm newDistribution = ScenarioContext.Current.Get <DistributionForm>("New Distribution Form");

            newDistribution.PercentageToDistributeLabel.Should().Be("PERCENTAGE TO DISTRIBUTE", "Percentage to distribute label is correct");
            newDistribution.PercentageToDistributePlaceholder.Should().Be("Enter percentage...", "Percentage to distribute placeholder is correct");
            newDistribution.PercentageToDistributeValueOnFocus.Should().Be("%", "Percentage to distribute shows '%' on focus");
            newDistribution.CalculatedAmountToDistributeLabel.Should().Be("AMOUNT TO DISTRIBUTE", "Amount to distribute label is correct");
            newDistribution.CalculatedAmountToDistributePlaceholder.Should().Be("Enter amount...", "Amount to distribute placeholder is correct");
            newDistribution.CalculatedAmountToDistribute.Replace(" ", "").Should().Be("$0.00", "Amount to distribute shows $0.00 on focus");
        }
        private void ThenISeeDistributionMethodsAreDisplayedCorrectly()
        {
            //get distribution Form from ScenarioContext
            DistributionForm newDistribution = ScenarioContext.Current.Get <DistributionForm>("New Distribution Form");

            newDistribution.MethodTitle.Should().Be("(DISTRIBUTION METHOD)", "Distribution method title is correct");
            List <string> methods = newDistribution.MethodOptions;

            methods[0].Should().Be("Pro Rata", "Pro Rata method is present and first");
            methods[1].Should().Be("Pay Each Claim Equally (Convenience Claim)", "Pay Equally method is present and second");
        }
        private void WhenIEnterAnAmountToDistributeLowerThanTheAvailableAmount()
        {
            DistributionForm newDistribution = ScenarioContext.Current.Get <DistributionForm>("New Distribution Form");
            string           available       = newDistribution.AmountAvailableForDistribution;
            double           availableAmount = this.GetDoubleFromMoneyString(available);
            double           proposedAmount  = availableAmount - 10;

            newDistribution.ProposedAmountToDistribute = "" + proposedAmount * 100;

            ScenarioContext.Current.Add("New Distribution Available Amount", availableAmount);
            ScenarioContext.Current.Add("New Distribution Proposed Amount", proposedAmount);
        }
Ejemplo n.º 27
0
        public void ThenISeeCalculatedAmountFieldValueCorresondsToPercentageAndIsRounded()
        {
            DistributionForm newDistribution = ScenarioContext.Current.Get <DistributionForm>("New Distribution Form");

            //Leave focus of any field to trigger masks and validations
            newDistribution.PressTabKey();

            double proposedAmount   = this.GetDoubleFromMoneyString(newDistribution.ProposedAmountToDistributeNonEditableValue);
            double percentage       = this.GetDoubleFromPercentageString(newDistribution.PercentageToDistribute);
            double calculatedAmount = this.GetDoubleFromMoneyString
                                          (newDistribution.CalculatedAmountToDistribute);

            calculatedAmount.Should().Be(proposedAmount * percentage / 100.00, "Calculated amount is Amount to Distribute * Percentage / 100");
        }
        private void WhenIEnterValuesOnMandatoryFieldsForNewDistribution()
        {
            //get distribution Form from ScenarioContext
            DistributionForm newDistribution = ScenarioContext.Current.Get <DistributionForm>("New Distribution Form");

            //set some valid data
            newDistribution.ProposedAmountToDistribute = "$100.00";
            string distName = "Test Automation of New Distributions " + this.GetRandomNumber();

            newDistribution.DistributionName = distName;

            //Save data for scenario verifications
            ScenarioContext.Current.Add("New Distribution Name", distName);
            ScenarioContext.Current.Add("New Distribution Amount", "$100.00");
        }
        private void ThenISeeGroupingBoxWithCorrectDataDisplays(Table table)
        {
            TableRows expectedGroups = table.Rows;

            DistributionForm newDistribution = ScenarioContext.Current.Get <DistributionForm>("New Distribution Form");
            IEnumerator <DistributionGroupData> actualGroups = newDistribution.GetDistributionGroups().GetEnumerator();

            actualGroups.MoveNext();

            foreach (TableRow expGroupData in expectedGroups)
            {
                string expNumber               = expGroupData["Group Number"];
                string expPercentage           = expGroupData["Percentage"];
                string expAmount               = expGroupData["Amount Sum"];
                string expMethod               = expGroupData["Method"];
                string expReserved             = expGroupData["Reserved"];
                string expClaimsIncludedNumber = expGroupData["Claims Included #"];
                string expClaimsIncludedList   = expGroupData["Claims Included List"];

                DistributionGroupData group = actualGroups.Current;
                group.DistributingLabel.Should().Be("DISTRIBUTING");
                group.Number.Should().Be(expNumber, "Distribution group has correct number");
                group.Percentage.Should().Be(expPercentage, "Distribution group has correct percentage");
                group.Amount.Should().Be(expAmount, "Distribution group has correct amount");
                switch (expMethod)
                {
                case "Pro Rata":
                    group.Method.Should().Be("Pro Rata", "Distribution group has correct payment method");
                    break;

                case "Pay Each Claim Equally":
                    group.Method.Should().Be("Pay Each Claim Equally (Convenience Claim)", "Distribution group has correct payment method");
                    break;

                default:
                    ScenarioContext.Current.Pending();
                    break;
                }
                group.ReservedValue.Should().Be(expReserved, "Distribution group has correct reserved #");
                group.ReservedLabel.Should().Be("Reserved Claims", "Distribution group has correct reserved label");
                group.ClaimsIncludedLabel.Should().Be("CLAIMS INCLUDED");
                group.ClaimsIncludedNumber.Should().Be(expClaimsIncludedNumber, "Distribution group has correct included claims #");
                group.ClaimsIncludedList.Should().Be(expClaimsIncludedList, "Distribution group has correct included claims #");
                group.ClaimsIncludedNote.Should().Be("Includes Objection Pending/Reserved Claims");

                actualGroups.MoveNext();
            }
        }
Ejemplo n.º 30
0
        public void ThenISeeValidationsOnAmountIfNotAndOnNameIfNot(string validAmount, string validName)
        {
            DistributionForm newDistribution = ScenarioContext.Current.Get <DistributionForm>("New Distribution Form");
            bool             isValidName     = Convert.ToBoolean(validName);
            bool             isValidAmount   = Convert.ToBoolean(validAmount);

            if (!isValidName)
            {
                this.ThenISeeAValidationErrorOn("Name", "DISTRIBUTION NAME is required");
            }

            if (!isValidAmount)
            {
                this.ThenISeeAValidationErrorOn("ProposedAmount", "The AMOUNT TO DISTRIBUTE needs to be greater than 0");
            }
        }