예제 #1
0
    class _PlanWizard:
        def __init__(self, journey):
            self.config = journey.config
            self.journey = journey
            self.wizard = AddPlanWizard(self.config)
            self.data = get_common_data(
                self.config)["test_data"]["protection_plan_data"]
            self.life_cover_sum_assured = self.data[
                "protection_plan_details_form"]["LIFE_COVER_SUM_ASSURED"]
            self.life_cover_term = self.data["protection_plan_details_form"][
                "LIFE_COVER_TERM"]
            self.premium_amount = self.data["protection_plan_details_form"][
                "PREMIUM_AMOUNT"]
            self.premium_frequency = self.data["protection_plan_details_form"][
                "PREMIUM_FREQUENCY"]
            self.premium_start_date = date.today().strftime('%d/%m/%Y')
            assert self.wizard.is_title_matches(
            ), "Title does not match the Add Plan Wizard"

        def add_protection_plan_basic_details(self,
                                              plan_type="Term Protection"):
            plan = self.wizard.protection_plan_stage()
            plan.goto_stage()
            assert plan.is_current_stage()
            adviser_dialog = plan.open_adviser_search_dialog()
            data = get_common_data(
                self.config)["test_data"]["protection_plan_data"]
            adviser_dialog.clear_adviser_firstname_field()
            adviser_dialog.fill_in_adviser_firstname_field(
                data["ADVISER_FIRST_NAME"])
            adviser_dialog.click_search()
            adviser_dialog.click_first_result()
            adviser_dialog.close_io_dialog()
            provider = plan.open_provider_search_dialog()
            provider.select(self.data["PLAN_PROVIDER"])
            provider.click_ok_button()
            provider.close_io_dialog()
            plantype = plan.open_producttype_search_dialog()
            plantype.select(plan_type)
            plantype.click_ok_button()
            plantype.close_io_dialog()
            plan.page.wait_until_please_wait_spinner_present()
            plan.select_advicetype(self.data["ADVICE_TYPE"])
            self.config.plan_provider = self.data["PLAN_PROVIDER"]
            self.config.plan_type = plan_type
            return self

        def add_protection_plan_details(self):
            plan = self.wizard.protection_plan_stage()
            plan.fill_in_life_cover_sum_assured(self.life_cover_sum_assured)\
                .fill_in_life_cover_term(self.life_cover_term)\
                .fill_in_premium_amount(self.premium_amount)\
                .fill_in_premium_start_date(self.premium_start_date)\
                .select_premium_frequency(self.premium_frequency)
            return self

        def finish(self):
            self.wizard.click_finish_button()
            self.journey.save_plan_id_and_ref()
            return self.journey
예제 #2
0
 def __init__(self, journey):
     self.config = journey.config
     self.journey = journey
     self.wizard = AddPlanWizard(self.config)
     self.data = get_common_data(
         self.config)["test_data"]["protection_plan_data"]
     self.life_cover_sum_assured = self.data[
         "protection_plan_details_form"]["LIFE_COVER_SUM_ASSURED"]
     self.life_cover_term = self.data["protection_plan_details_form"][
         "LIFE_COVER_TERM"]
     self.premium_amount = self.data["protection_plan_details_form"][
         "PREMIUM_AMOUNT"]
     self.premium_frequency = self.data["protection_plan_details_form"][
         "PREMIUM_FREQUENCY"]
     self.premium_start_date = date.today().strftime('%d/%m/%Y')
     assert self.wizard.is_title_matches(
     ), "Title does not match the Add Plan Wizard"
    class _PlanWizard:
        def __init__(self, journey):
            self.config = journey.config
            self.journey = journey
            self.wizard = AddPlanWizard(self.config)

        def add_retirement_plan_basic_details(self, plan_type):
            data = get_common_data(
                self.config)["test_data"]["retirement_plan_data"]
            plan = self.wizard.retirement_plan_stage()
            plan.goto_stage()
            plan.open_adviser_search_dialog() \
                .clear_adviser_firstname_field() \
                .fill_in_adviser_firstname_field(data["ADVISER_FIRST_NAME"]) \
                .click_search() \
                .click_first_result() \
                .close_io_dialog()
            plan.open_provider_search_dialog() \
                .select(data["PLAN_PROVIDER"]) \
                .click_ok_button() \
                .close_io_dialog()
            plan.open_producttype_search_dialog() \
                .select(plan_type) \
                .click_ok_button() \
                .close_io_dialog()
            self.plan_type = plan_type
            plan.page.wait_until_please_wait_spinner_present()
            plan.select_advicetype(data["ADVICE_TYPE"])
            return self

        def add_retirement_plan_details(self):
            self.wizard.retirement_plan_stage() \
                .fill_in_lump_sum(get_common_data(self.config)["test_data"]["retirement_plan_data"]["LUMP_SUM_AMOUNT"])\
                .fill_in_effective_date(datetime.datetime.today().strftime('%d/%m/%Y'))
            return self

        def finish(self):
            self.wizard.click_finish_button()
            self.journey.save_plan_id_and_ref()
            return self.journey
예제 #4
0
    class _PlanWizard:
        def __init__(self, journey):
            self.config = journey.config
            self.journey = journey
            self.wizard = AddPlanWizard(self.config)

        def verify_if_mortgage_details_section_present(self):
            plan_stage = self.wizard.mortgage_plan_stage()
            assert plan_stage.is_mortgage_details_section_present()
            return self

        def add_mortgage_plan_with_basic_details(self):
            data = get_common_data(
                self.config)["test_data"]["mortgage_plan_data"]
            plan = self.wizard.mortgage_plan_stage()
            plan.goto_stage()
            assert plan.is_current_stage()
            adviser_dialog = plan.open_adviser_search_dialog()
            adviser_dialog.clear_adviser_firstname_field()
            adviser_dialog.fill_in_adviser_firstname_field(
                data["ADVISER_FIRST_NAME"])
            adviser_dialog.click_search()
            adviser_dialog.click_first_result()
            adviser_dialog.close_io_dialog()
            provider = plan.open_provider_search_dialog()
            provider.select(data["PLAN_PROVIDER"])
            provider.click_ok_button()
            provider.close_io_dialog()
            plantype = plan.open_producttype_search_dialog()
            plantype.select(data["PLAN_TYPE"])
            plantype.click_ok_button()
            plantype.close_io_dialog()
            plan.page.wait_until_please_wait_spinner_present()
            plan.select_advicetype(data["ADVICE_TYPE"])
            return self

        def add_mortgage_plan_details(self):
            data = get_common_data(
                self.config)["test_data"]["mortgage_plan_data"]
            second_client = get_temp_data(self.config, "client", 1)
            self.wizard.mortgage_plan_stage().select_second_owner(second_client["name"])\
                .fill_in_price_valuation(data["price_valuation"])\
                .fill_in_deposit_equity(data["deposit_equity"])
            return self

        def finish(self):
            self.wizard.click_finish_button()
            plan_id = BasePlanPage(self.config).get_plan_id()
            add_temp_data(self.config, "plan", {"id": plan_id})
            plan_ref = BasePlanPage(self.config).get_plan_ref()
            update_temp_data(self.config, "plan", 0, "reference", plan_ref)
            return self.journey
예제 #5
0
 def __init__(self, journey):
     self.config = journey.config
     self.journey = journey
     self.wizard = AddPlanWizard(self.config)