Example #1
0
        public void SetUp()
        {
            // Before each test
            browser = BrowserFactory.Launch(BrowserType.InternetExplorer);
            browser.Navigate("https://auto-buy-gz-user1.geico.com/");
            GeicoApp GAM = new GeicoApp(browser);

            GAM.ErrorPage.ContinueLink.Click();

            customer = new CustomerInfoPage(browser);
            vehicle  = new VehicleInfoPage(browser);
        }
Example #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();
        }
Example #3
0
        public void UI_CreateQuote_Happy_Path_IN()
        {
            //Given
            //Prepare test data
            CreateQuoteHappyPathINTestData quoteTestData = new CreateQuoteHappyPathINTestData();

            //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. Enter business information
            EffectiveDatePage effectiveDatePage = businessClassificationPage.EnterBusinessInformation(quoteTestData.BusinessClassification);

            //5. Enter customer information
            VehicleInfoPage vehicleInfoPage = effectiveDatePage.EnterCustomerInformation(quoteTestData.CustomerInformation);

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

            //7. Add first vehicle
            AddAnotherVehiclePage addAnotherVehiclePage = vehicleEntryPage.AddVehicle(quoteTestData.VehicleInfo);

            //8. No more vehicle
            DriverEnterPage driverEnterPage = addAnotherVehiclePage.NoMoreVehicle();

            //9. Add first driver (PO) - Invalid MVR
            AddAnotherDriverPage addAnotherDriverPage = driverEnterPage.AddDriver <AddAnotherDriverPage>(quoteTestData.DriverInfo);

            //10. No more driver
            CoveragesPage coveragesPage = addAnotherDriverPage.NoMoreDriver();

            // Verification
            coveragesPage.ValidateControlDisplayed(CoverageLimitsType.UMDeductible, WebControl.Dropdown)
            .ValidateControlDisplayedCorrectly(CoverageLimitsType.UMLimitType, WebControl.Dropdown, quoteTestData.DefaultUMLimitType);

            //11. Select None for UM deductible then click Calculate
            coveragesPage.SelectCoverageLimit(CoverageLimitsType.UMDeductible, quoteTestData.CoverageLimits1.UMDeductible)
            .SelectCalculateButton();
            // Verification
            coveragesPage.ValidateTotalPremiumRecalculatedAndDisplayed();

            //12. Select UM Deductible $300 then click Calculate
            coveragesPage.SelectCoverageLimit(CoverageLimitsType.UMDeductible, quoteTestData.CoverageLimits2.UMDeductible)
            .SelectCalculateButton();
            // Verification
            coveragesPage.ValidateTotalPremiumRecalculatedAndDisplayed();

            //13. Select UM CSL BI Only
            coveragesPage.SelectCoverageLimit(CoverageLimitsType.UMLimitType, quoteTestData.CoverageLimits1.UMLimitType);
            // Verification
            coveragesPage.ValidateControlNotDisplayed(CoverageLimitsType.UMDeductible, WebControl.Dropdown);

            //14. Select Caculate button
            coveragesPage.SelectCalculateButton();
            // Verification
            coveragesPage.ValidateTotalPremiumRecalculatedAndDisplayed();

            //15. Select UM Split BIPD
            coveragesPage.SelectCoverageLimit(CoverageLimitsType.UMLimitType, quoteTestData.CoverageLimits2.UMLimitType);
            // Verification
            coveragesPage.ValidateControlDisplayed(CoverageLimitsType.UMDeductible, WebControl.Dropdown);

            //16. Select UM Limit, Deductible
            coveragesPage.SelectCoverageLimits(quoteTestData.CoverageLimits2);
            // Verification
            coveragesPage.ValidateCalculateButtonDisplayed();
        }
Example #4
0
        public static SummaryPage CreateQuote(this WelcomePage wellcomePage, Quote quote)
        {
            ParameterValidator.ValidateNotNull(wellcomePage, "WellcomePage");
            ParameterValidator.ValidateNotNull(quote, "Quote");

            //1. Start new submission
            BusinessClassificationPage businessClassificationPage = wellcomePage.StartNewSubmission();
            //2. Enter business infomation
            EffectiveDatePage effectiveDatePage = businessClassificationPage.EnterBusinessInformation(quote.BusinessClassification);

            //3. Enter policy level vehicle info
            VehicleInfoPage vehicleInfoPage = effectiveDatePage.EnterCustomerInformation(quote.CustomerInformation);

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

            //5. Add vehicles
            AddAnotherVehiclePage addAnotherVehiclePage = new AddAnotherVehiclePage();

            for (int i = 0; i < quote.VehicleList.Length; i++)
            {
                vehicleEntryPage.AddVehicle(quote.VehicleList[i]);
                if (i == quote.VehicleList.Length - 1)
                {
                    addAnotherVehiclePage.NoMoreVehicle();
                }
                else
                {
                    addAnotherVehiclePage.YesMoreVehicle();
                }
            }

            //6. Add driver
            DriverEnterPage      driverEnterPage      = new DriverEnterPage();
            AddAnotherDriverPage addAnotherDriverPage = new AddAnotherDriverPage();

            for (int i = 0; i < quote.DriverList.Length; i++)
            {
                if (quote.DriverList[i].DoesNotDrive)
                {
                    driverEnterPage.AddDriver <DriverEnterPage>(quote.DriverList[i]);
                }
                else
                {
                    driverEnterPage.AddDriver(quote.DriverList[i]);
                    if (i == quote.DriverList.Length - 1)
                    {
                        addAnotherDriverPage.NoMoreDriver();
                    }
                    else
                    {
                        addAnotherDriverPage.YesMoreDriver();
                    }
                }
            }

            //7. Select coverage limits
            CoveragesPage coveragesPage = new CoveragesPage();

            if (quote.CoverageLimits != null)
            {
                coveragesPage.SelectCoverageLimits(quote.CoverageLimits).SelectCalculateButton().SelectNextButton();
            }
            else
            {
                coveragesPage.UseDefaultCoverages();
            }

            //8. Select Additional Coverages
            AdditionalCoveragesPage additionalCoveragesPage = new AdditionalCoveragesPage();

            additionalCoveragesPage.SelectAdditionalCoverages <SummaryPage>(quote.AdditionalCoverages);

            //9. Enter Additional Coverages(if needed)
            SummaryPage summaryPage = additionalCoveragesPage.EnterAdditionalCoverages(quote.AdditionalCoverages);

            return(summaryPage);
        }
Example #5
0
        public static VehicleInfoPage EnterCustomerInformation(this EffectiveDatePage effectiveDatePage, CustomerInformation customerInformation)
        {
            ParameterValidator.ValidateNotNull(effectiveDatePage, "EffectiveDatePage");
            ParameterValidator.ValidateNotNull(customerInformation, "Customer Information");

            //1. Enter customer @effectivedate and select next
            DotNumberPage dotNumberPage = effectiveDatePage.SelectEffectiveDate(customerInformation.EffectiveDate).SelectNextButton();

            // verification
            dotNumberPage.ValidateDotNumberPageDisplayed();

            //2. Enter @DOTInfo
            EntityTypePage entityTypePage = dotNumberPage.EnterDotNumber(customerInformation.DotNumber);

            //3. Select @EntityType and select next
            BusinessInformationPage businessInformationPage = entityTypePage.SelectEntityType(customerInformation.EntityType)
                                                              .SelectNextButton();

            // verification
            businessInformationPage.ValidateBusinessInformationPageDisplayed();

            //4. If valid DOT was given, confrim business @name and @address and select next
            // If no Dot or invalid DOT was given, complete @name and @address and select next
            if (customerInformation.FilledOutBusinessInformation != null)
            {
                businessInformationPage.ValidateBusinessNameIsFilledOut(customerInformation.FilledOutBusinessInformation.CustomerName)
                .ValidateDBAIsFilledOut(customerInformation.FilledOutBusinessInformation.DBA)
                .ValidateAddressFieldsAreFilledOut(customerInformation.FilledOutBusinessInformation.Address);
            }

            if (customerInformation.BusinessInformation != null)
            {
                businessInformationPage.InputBusinessInformation(customerInformation.BusinessInformation);
            }

            PrimaryOfficerPage primaryOfficerPage = businessInformationPage.SelectNextButton();

            //verification
            primaryOfficerPage.ValidatePrimaryOfficerPageDisplayed();

            //5. Enter Primary officer information (@POName, @POAddress) and select next
            CustomerInfoPage customerInfoPage = new CustomerInfoPage();

            if (customerInformation.EntityType == "Individual")
            {
                // verification
                primaryOfficerPage.ValidatePrimaryOfficerNameAreFilledOut(customerInformation.POName).ValidatePrimaryOfficerNameDisabled();
                // Enter POAddress
                primaryOfficerPage.InputPrimaryOfficerAddress(customerInformation.POAddress).SelectNextButton();
            }
            else
            {
                //Enter POName and POAddress
                primaryOfficerPage.InputPrimaryOfficer(customerInformation.POName, customerInformation.POAddress).SelectNextButton();
            }

            //verification
            customerInfoPage.ValidateCustomerInfoPageDisplayed();

            //6. Enter @LiabilityLosses and select Next
            VehicleInfoPage vehicleInfoPage = customerInfoPage.EnterCustomerInfo(customerInformation.CustomerAdditionalInformation).SelectNextButton();

            //verification
            vehicleInfoPage.ValidateVehicleInfoPageDisplayed();
            return(vehicleInfoPage);
        }
Example #6
0
        public static T EnterPolicyLevelVehicleInfo <T>(this VehicleInfoPage vehicleInfoPage, PolicyLevelVehicleInformation policyLevelVehicleInformation)
        {
            ParameterValidator.ValidateNotNull(vehicleInfoPage, "VehicleInfoPage");
            ParameterValidator.ValidateNotNull(policyLevelVehicleInformation, "Policy Level Vehicle Information");
            //1. Enter policy level vehicle info
            vehicleInfoPage.InputVehicleInformation(policyLevelVehicleInformation);

            // wait 5s for allow async call to complete
            Browser.Wait(5);

            // Wait an additional 5s if territory can be pulled
            if (!string.IsNullOrWhiteSpace(policyLevelVehicleInformation.GaragingZipCode))
            {
                Browser.Wait(5);
            }

            if (policyLevelVehicleInformation.GaragingAddress != null)
            {
                // Wait for asynchronous process of default coverages complete
                Browser.Wait(10);

                //2. Select next button
                GaragingAddressPage garagingAddressPage = vehicleInfoPage.SelectNextButton <GaragingAddressPage>();
                // verification
                garagingAddressPage.ValidateGaragingAddressPageDisplayed();

                //3. Input Garaging address
                garagingAddressPage.InputGaragingAddress(policyLevelVehicleInformation.GaragingAddress);
            }

            //4. Select Next button
            VehicleEntryPage vehicleEntryPage = new VehicleEntryPage();

            if (!policyLevelVehicleInformation.IsValidVehicleData)
            {
                dynamic unknownPage = vehicleInfoPage.SelectNextButton();
                if (unknownPage is VehicleSuggestionsPage)
                {
                    // Select 'I don't see my vehicle' link if the vehicle Suggestion screen displayed
                    VehicleSuggestionsPage vehicleSuggestionsPage = unknownPage;
                    vehicleSuggestionsPage.SelectIDontSeeMyVehicles();
                }
                //Verification
                vehicleEntryPage.ValidateVehicleEntryPageDisplayed();
            }
            else
            {
                VehicleSuggestionsPage vehicleSuggestionsPage = vehicleInfoPage.SelectNextButton <VehicleSuggestionsPage>();

                //Refresh Vehicle suggestions if vehicle list not returned yet
                //by going to previous page and select Next button again
                if (vehicleEntryPage.IsPageDisplayed())
                {
                    dynamic currentPage;
                    if (policyLevelVehicleInformation.GaragingAddress != null)
                    {
                        currentPage = vehicleEntryPage.SelectPreviousButton <GaragingAddressPage>();
                    }
                    else
                    {
                        currentPage = vehicleEntryPage.SelectPreviousButton <VehicleInfoPage>();
                    }
                    // Wait 5s to allow async call to complete
                    Browser.Wait(5);
                    currentPage.SelectNextButton <VehicleSuggestionsPage>();
                }
                //Verification
                vehicleSuggestionsPage.ValidateVehicleSuggestionsPageDisplayed();
            }
            return((T)Activator.CreateInstance(typeof(T)));
        }