Ejemplo n.º 1
0
def error_message_with_unknown_email_should_be_displayed(context):
    wc = WebCommon()
    expected_msg = "Unknown email address. Check again or try your username."
    error_box_type = locatorsconfig.MY_ACCOUNT_LOCATORS['error_box']['type']
    error_box_text = locatorsconfig.MY_ACCOUNT_LOCATORS['error_box']['locator']
    is_exist = wc.element_contains_text(context, expected_msg, error_box_type,
                                        error_box_text)

    if is_exist:
        print("pass")
    else:
        raise Exception("Incorrect message shown for non existing user.")
Ejemplo n.º 2
0
def error_message_with_email_should_be_displayed(context, email):
    wc = WebCommon()
    expected_msg = "Error: The password you entered for the email address {email} is incorrect. Lost your password?".format(
        email=email)
    error_box_type = locatorsconfig.MY_ACCOUNT_LOCATORS['error_box']['type']
    error_box_text = locatorsconfig.MY_ACCOUNT_LOCATORS['error_box']['locator']

    is_exist = wc.element_contains_text(context, expected_msg, error_box_type,
                                        error_box_text)

    if is_exist:
        print("pass")
    else:
        raise Exception(
            "Incorrect message shown on failed log in.  Email: {}".format(
                email))