<commit_before># coding: utf-8
from behave import given, when, then
from hamcrest.core import assert_that, equal_to
from hamcrest.library.text.stringcontains import contains_string

from pages.home import Home
from pages.base import Base
from pages.utils import Utils

# XPATH LOCATORS

# RELATIVE URL'S
HOME = 'index.html'
LC = 'loan-comparison'
LO = 'loan-options'
CONV = 'loan-options/conventional-loans'
RC = 'check-rates'
FHA = 'loan-options/FHA-loans'
SPECIAL = 'loan-options/special-loan-programs'


@given(u'I navigate to the "{page_name}" page')
def step(context, page_name):
    if (page_name == 'Owning a Home'):
        context.base.go(HOME)
    elif (page_name == 'Loan Comparison'):
        context.base.go(LC)
    elif (page_name == 'Loan Options'):
        context.base.go(LO)
    elif (page_name == 'Rate Checker'):
        context.base.go(RC)
        # Wait for the chart to load
        context.base.sleep(2)
        assert_that(context.rate_checker.is_chart_loaded(), equal_to("Chart is loaded"))
    elif (page_name == 'Conventional Loan'):
        context.base.go(CONV)
    elif (page_name == 'FHA Loan'):
        context.base.go(FHA)
    elif (page_name == 'Special Loan Programs'):<commit_msg>added handle_error tag to navigation step<commit_after># coding: utf-8
from behave import given, when, then
from hamcrest.core import assert_that, equal_to
from hamcrest.library.text.stringcontains import contains_string
from decorators import *

from pages.home import Home
from pages.base import Base
from pages.utils import Utils

# XPATH LOCATORS

# RELATIVE URL'S
HOME = 'index.html'
LC = 'loan-comparison'
LO = 'loan-options'
CONV = 'loan-options/conventional-loans'
RC = 'check-rates'
FHA = 'loan-options/FHA-loans'
SPECIAL = 'loan-options/special-loan-programs'


@given(u'I navigate to the "{page_name}" page')
@handle_error
def step(context, page_name):
    if (page_name == 'Owning a Home'):
        context.base.go(HOME)
    elif (page_name == 'Loan Comparison'):
        context.base.go(LC)
    elif (page_name == 'Loan Options'):
        context.base.go(LO)
    elif (page_name == 'Rate Checker'):
        context.base.go(RC)
        # Wait for the chart to load
        context.base.sleep(2)
        assert_that(context.rate_checker.is_chart_loaded(), equal_to("Chart is loaded"))
    elif (page_name == 'Conventional Loan'):
        context.base.go(CONV)
    elif (page_name == 'FHA Loan'):
        context.base.go(FHA)
    elif (page_name == 'Special Loan Programs'):
{'fraction_non_alphanumeric': 0.1255497800879648, 'fraction_numerical': 0.001599360255897641, 'mean_word_length': 3.659217877094972, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3431841', 'n_tokens_mistral': 857, 'n_tokens_neox': 818, 'n_words': 216}