Пример #1
0
        public static AdditionalCoveragesPage AddAdditionalCoverageFromCoverageScreenWithNoPriorAdditionalCoverage(this LandingPage landingPage, string[] coverageSections, string[] additionalCoveragesList)
        {
            ParameterValidator.ValidateNotNull(landingPage, "Landing Page");

            //User is navigated to Coverages screen by clicking on Coverages from left nav
            CoveragesPage coveragesPage = landingPage.SelectMenuLink <CoveragesPage>(LeftNavigationHeader.Coverage);

            // Verification
            coveragesPage.ValidateCoveragesPageDisplayed()
            .ValidateCoverageSectionsDisplayed(coverageSections)
            .ValidateAdditionalCoveragesSectionDisplayed()
            .ValidateAdditionalCoveragesEditButtonDisplayed();

            // Select Additional Coverages edit button on the Coverages screen
            AdditionalCoveragesOverviewPage additionalCoveragesOverviewPage = coveragesPage.SelectEditAdditionalCoveragesIcon();

            // verification
            additionalCoveragesOverviewPage.ValidateAdditionalCoveragesOverviewPageDisplayed()
            .ValidateAddAdditionalCoveragesButtonDisplayed()
            .ValidateCoverageSummaryButtonDisplayed();
            // Click add Additional Coverage button
            AdditionalCoveragesPage additionalCoveragesPage = additionalCoveragesOverviewPage.SelectAddAdditionalCoveragesButton();

            //Verification
            additionalCoveragesPage.ValidateAdditionalCoveragesPageDisplayed()
            .ValidateAdditionalCoveragesListed(additionalCoveragesList);
            return(additionalCoveragesPage);
        }
Пример #2
0
        public void UI_EditQuote_Edit_Coverages_Add_Additional_Coverages_Edit_Additional_Coverages(int number, EditQuoteEditCoveragesInformation testData)
        {
            ParameterValidator.ValidateNotNull(testData, "Test Item");

            //1. Navigate to Home page.
            LoginPage loginPage = OpenBreezeApplication();

            //2. Login to Welcome Page
            WelcomePage welcomePage = loginPage.Login();

            //3. Start New Submision
            BusinessClassificationPage businessClassificationPage = welcomePage.StartNewSubmission();

            //4. Get quoteID to be used in subsequent steps
            string quoteId = businessClassificationPage.GetQuoteId();

            //5. Enter business information
            EffectiveDatePage effectiveDatePage = businessClassificationPage.EnterBusinessInformation(testData.BusinessClassification);

            //6. Enter customer information
            VehicleInfoPage vehicleInfoPage = effectiveDatePage.EnterCustomerInformation(testData.CustomerInformation);

            //7. Enter policy level vehicle info
            VehicleEntryPage vehicleEntryPage = vehicleInfoPage.EnterPolicyLevelVehicleInfo <VehicleEntryPage>(testData.PolicyLevelVehicleInformation);

            //8. Add first vehicle
            AddAnotherVehiclePage addAnotherVehiclePage = vehicleEntryPage.AddVehicle(testData.VehicleInfo1);

            //9. No more vehicles
            DriverEnterPage driverEnterPage = addAnotherVehiclePage.NoMoreVehicle();

            //10. Add first driver (PO) - invalid MVR
            AddAnotherDriverPage addAnotherDriverPage = driverEnterPage.AddDriver(testData.DriverInfo1);

            //11. No more drivers
            CoveragesPage coveragesPage = addAnotherDriverPage.NoMoreDriver();

            //12. Use default coverages
            AdditionalCoveragesPage additionalCoveragesPage = coveragesPage.UseDefaultCoverages();

            //13. Select Additional Coverages
            SummaryPage summaryPage = additionalCoveragesPage.SelectAdditionalCoverages <SummaryPage>(testData.DefaultAdditionalCoverages);

            //14. Select Close
            summaryPage.SelectCloseButton();
            // Verification
            welcomePage.ValidateWelcomePageDisplayed();

            //15. Open quote using the quoteID captured in step 4
            welcomePage.ResumeQuote <SummaryPage>(EnvironmentSetting.WebUrl, quoteId);
            // Verification
            summaryPage.ValidateSummaryPageDisplayed();

            //16. Select coverages in the left navigation
            summaryPage.SelectMenuLink <CoveragesPage>(LeftNavigationHeader.Coverage);
            // Verification
            coveragesPage.ValidateCoveragesPageDisplayed()
            .ValidateAdditionalCoveragesSectionDisplayed()
            .ValidateAdditionalCoveragesEditButtonDisplayed();

            //17. Change coverages
            coveragesPage.SelectCoverageLimits(testData.CoverageLimits);
            // Verification
            coveragesPage.ValidatePremiumsNoLongerShown();

            //18. Select Calculate button
            coveragesPage.SelectCalculateButton();
            // Verification
            coveragesPage.ValidateTotalPremiumRecalculatedAndDisplayed();

            //19. Add Additional coverage from Coverage screen with no prior additional coverage
            coveragesPage.AddAdditionalCoverageFromCoverageScreenWithNoPriorAdditionalCoverage(testData.DefaultCoverageSections, testData.DefaultAdditionalCoveragesList);

            //20. Select Additional Interests and Cargo, Select Next
            AdditionalInterestCountsPage additionalInterestCountsPage = additionalCoveragesPage.SelectAdditionalCoverages <AdditionalInterestCountsPage>(testData.AdditionalCoverages, true);

            //21. Enter @AddInterests, Select Next
            CargoLimitDeductiblePage cargoLimitDeductiblePage = additionalInterestCountsPage.EnterAdditionalInterestCounts <CargoLimitDeductiblePage>(testData.AdditionalCoverages, true);

            //22. Make @CargoInfo selections
            AdditionalCoveragesOverviewPage additionalCoveragesOverviewPage = cargoLimitDeductiblePage.EnterCargoInformation <AdditionalCoveragesOverviewPage>(testData.AdditionalCoverages, true);

            // Verification
            additionalCoveragesOverviewPage.ValidateAdditionalCoverageDisplayed(AdditionalCoveragesType.AdditionalInterests)
            .ValidateAdditionalCoverageDisplayed(AdditionalCoveragesType.Cargo)
            .ValidateAdditionalInterestsCoverageDisplayedCorrectly(testData.AdditionalCoverages.AdditionalInterests)
            .ValidateCargoCoverageDisplayedCorrectly(testData.AdditionalCoverages.Cargo)
            .ValidateEditButtonDisplayed(AdditionalCoveragesType.AdditionalInterests)
            .ValidateDeleteButtonDisplayed(AdditionalCoveragesType.AdditionalInterests)
            .ValidateEditButtonDisplayed(AdditionalCoveragesType.Cargo)
            .ValidateDeleteButtonDisplayed(AdditionalCoveragesType.Cargo)
            .ValidateAdditionalCoveragePremiumDisplayed(AdditionalCoveragesType.AdditionalInterests)
            .ValidateAdditionalCoveragePremiumDisplayed(AdditionalCoveragesType.Cargo);

            //23. Select Coverages from the left navigation
            additionalCoveragesOverviewPage.SelectMenuLink <CoveragesPage>(LeftNavigationHeader.Coverage);
            // Verification
            coveragesPage.ValidateCoveragesPageDisplayed()
            .ValidatePreviousCoveragesListed(testData.CoverageLimits)
            .ValidatePremiumInLeftNavigationMatchesCoveragesScreen();

            //24. Select Edit button of Additional Coverages section
            coveragesPage.SelectEditAdditionalCoveragesIcon();
            // Verification
            additionalCoveragesOverviewPage.ValidateAdditionalCoveragesOverviewPageDisplayed()
            .ValidateAdditionalCoverageDisplayed(AdditionalCoveragesType.AdditionalInterests)
            .ValidateAdditionalCoverageDisplayed(AdditionalCoveragesType.Cargo);

            //25. Click Delete button for Cargo
            additionalCoveragesOverviewPage.SelectDeleteIcon(AdditionalCoveragesType.Cargo);
            // Verification
            additionalCoveragesOverviewPage.ValidateDialogContentDisplayedCorrectly(testData.DialogContent);

            //26. Select yes
            additionalCoveragesOverviewPage.ConfirmDeleteAdditionalCoverage(AdditionalCoveragesType.Cargo);
            // Verification
            additionalCoveragesOverviewPage.ValidateAdditionalCoverageDisplayed(AdditionalCoveragesType.AdditionalInterests)
            .ValidateAdditionalCoverageNotDisplayed(AdditionalCoveragesType.Cargo)
            .ValidateAddAdditionalCoveragesButtonDisplayed()
            .ValidateCoverageSummaryButtonDisplayed();

            //27. Select Add Additional Coverages button
            additionalCoveragesOverviewPage.SelectAddAdditionalCoveragesButton();
            // Verification
            additionalCoveragesPage.ValidateAdditionalCoveragesPageDisplayed()
            .ValidateAdditionalCoveragesListed(testData.ExpectedAdditionalCoverages)
            .ValidateAdditionalCoveragesNotListed(testData.UnexpectedAdditionalCoverages);

            //28.1 Select Trailer Interchange and click Next
            TrailerInterchangePage trailerInterchangePage = additionalCoveragesPage.SelectAdditionalCoverages <TrailerInterchangePage>(testData.AdditionalCoveragesChange);

            //28.2 Finish Trailer Interchange coverage info
            trailerInterchangePage.EnterTrailerInterchange <AdditionalCoveragesOverviewPage>(testData.AdditionalCoveragesChange, true);

            //29. Inspect page contents
            additionalCoveragesOverviewPage.ValidatePremiumInLeftNavigationMatchesAdditionalCoveragesOverviewScreen();
        }