Example #1
0
def step_imp(context):
    landing_page = LandingPage(context.browser)
    congratulations_modal = CongratulationsModal(context.browser)

    if context.is_terms_and_conditions_modal_visible:
        assert congratulations_modal.get_self() is not None
    else:
        assert landing_page.get_avatar_element() is not None
Example #2
0
def step_imp(context):
    term_and_conditions = TermsAndConditionsModal(context.browser)
    is_terms_and_conditions_modal_visible = term_and_conditions.get_self(
    ) is not None

    # If terms and conditions modal not found, look for avatar to make sure the user has logged in
    is_avatar_visible = None
    if not is_terms_and_conditions_modal_visible:
        landing_page = LandingPage(context.browser)
        is_avatar_visible = landing_page.get_avatar_element() is not None

    # Update context for other steps
    context.is_terms_and_conditions_modal_visible = is_terms_and_conditions_modal_visible

    assert is_terms_and_conditions_modal_visible or is_avatar_visible