Example #1
0
def new_contact(driver: DriverAPI, config: dict, contact: Contact) -> bool:
    """Creates a contact.
       config=config['urls']"""

    # Visit new contact page
    p_page = ContactNewPage(_driver=driver, _config=config, _contact=contact)
    assert p_page.visit() is True

    # Fill the fields
    p_action = ContactWriteAction(_page=p_page)
    p_action.fill_lastname() \
            .fill_firstname() \
            .fill_phone() \
            .fill_zip() \
            .fill_city() \
            .fill_address_more() \
            .fill_address() \
            .fill_email()
    del p_action

    # Create
    p_action = ContactCreateAction(_page=p_page)
    p_action.click()

    # Check
    return p_action.has_succeeded()
Example #2
0
def send_data_without_phone_number(page_new_contact, the_faker) -> None:
    """I send the data without the phone number."""
    page_new_contact.contact = ContactFakerFactory(
        _faker=the_faker).initialize(config={})
    p_action = ContactWriteAction(_page=page_new_contact)
    p_action.fill_lastname().fill_firstname()
    del p_action
    p_action = ContactCreateAction(_page=page_new_contact)
    p_action.click()
Example #3
0
def contact_create(page_contact_new, contact_new) -> None:
    """I create the contact."""
    page_contact_new.contact = contact_new
    p_action = ContactWriteAction(_page=page_contact_new)
    p_action.fill_lastname() \
        .fill_firstname() \
        .fill_phone() \
        .fill_zip() \
        .fill_city() \
        .fill_address_more() \
        .fill_address() \
        .fill_email()
    del p_action
    p_action = ContactCreateAction(_page=page_contact_new)
    p_action.click()
Example #4
0
def send_data_without_phone_number(page_contact, the_faker) -> None:
    """I send the data without the phone number."""
    p_contact = ContactFakerFactory(_faker=the_faker).create(config={})
    p_contact.tel = ''
    page_contact.contact = p_contact

    # Fill the fields
    p_action = ContactWriteAction(_page=page_contact)
    p_action.fill_lastname() \
        .fill_firstname() \
        .fill_phone()
    del p_action

    # Update
    p_action = ContactUpdateAction(_page=page_contact)
    p_action.update()