Beispiel #1
0
def click(target_name, **kwargs):
    target = target_name.lower()

    if target == 'title input':
        location = locations.Inputs.title
        if kwargs:
            # Clear field if text kwarg is used
            test_base.driver.find_element_by_xpath(location).clear()
        helpers.click_or_type(location, **kwargs)
    elif target == 'merged file input':
        location = locations.Inputs.merged_file
        helpers.click_helper(location)
    elif target == 'individual pdfs input':
        location = locations.Inputs.individual_pdfs
        helpers.click_helper(location)
    elif target == 'merged pdfs input':
        location = locations.Inputs.merged_pdfs
        helpers.click_helper(location)
    elif target == 'footer input':
        location = locations.Inputs.footer
        helpers.click_helper(location)
    elif target == 'reset options link':
        location = locations.Links.reset_options
        helpers.click_helper(location)
    elif target == 'create print job button':
        location = locations.Buttons.create_print_job
        helpers.click_helper(location)
    else:
        print(warn.INVALID_CLICK_TARGET, target, 'bulk print page')
Beispiel #2
0
def delete_modal_click(target_name):
    target = target_name.lower()

    if target == 'ok button':
        location = locations.DeleteModal.Buttons.ok
        helpers.click_or_type(location)
    elif target == 'cancel button':
        location = locations.DeleteModal.Buttons.cancel
        helpers.click_helper(location)
    elif target == 'close button':
        location = locations.DeleteModal.Buttons.close
        helpers.click_helper(location)
    else:
        print(warn.INVALID_CLICK_TARGET)
Beispiel #3
0
def add_company_grouping_modal_click(target_name, **kwargs):
    target = target_name.lower()

    if target == 'name input':
        location = locations.CompanyHierarchyTab.Inputs.add_company_grouping_modal_name
        helpers.click_or_type(location, **kwargs)
    elif target == 'add button':
        location = locations.CompanyHierarchyTab.Buttons.add_company_grouping_modal_add
        helpers.click_helper(location)
    elif target == 'cancel button':
        location = locations.CompanyHierarchyTab.Buttons.add_company_grouping_modal_cancel
        helpers.click_helper(location)
    elif target == 'close button':
        location = locations.CompanyHierarchyTab.Buttons.add_company_grouping_modal_close
        helpers.click_helper(location)
    else:
        print('Invalid target requested.')
Beispiel #4
0
def edit_data_entry_set_modal_click(target_name, **kwargs):
    target = target_name.lower()

    if target == 'name input':
        location = locations.EditDataEntrySetModal.Inputs.name
        helpers.click_or_type(location, **kwargs)
    elif target == 'update button':
        location = locations.EditDataEntrySetModal.Buttons.update
        helpers.click_helper(location)
    elif target == 'cancel button':
        location = locations.EditDataEntrySetModal.Buttons.cancel
        helpers.click_helper(location)
    elif target == 'close button':
        location = locations.EditDataEntrySetModal.Buttons.close
        helpers.click_helper(location)
    else:
        print(warn.INVALID_CLICK_TARGET)
Beispiel #5
0
def certificate_attributes_click(target_name, **kwargs):
    target = target_name.lower()

    if target == 'certificate has input':
        location = locations.CertificateAttributes.Inputs.certificate_has
        helpers.textarea_field_click_or_type(location, **kwargs)
    elif target == 'certificate does not have input':
        location = locations.CertificateAttributes.Inputs.certificate_does_not_have
        helpers.click_or_type(location, **kwargs)
    elif target == 'certificate attribute added date begin input':
        location = locations.CertificateAttributes.Inputs.certificate_attribute_added_date_begin
        helpers.click_or_type(location, **kwargs)
    elif target == 'certificate attribute added date end input':
        location = locations.CertificateAttributes.Inputs.certificate_attribute_added_date_end
        helpers.click_or_type(location, **kwargs)
    elif target == 'certificate attribute added date ago input':
        location = locations.CertificateAttributes.Inputs.certificate_attribute_added_date_ago
        helpers.click_or_type(location, **kwargs)
    elif target == 'certificate attribute added date to input':
        location = locations.CertificateAttributes.Inputs.certificate_attribute_added_date_to
        helpers.click_or_type(location, **kwargs)
    elif target == 'certificate has select':
        location = locations.CertificateAttributes.Selects.certificate_has
        helpers.click_or_select(location, **kwargs)
    elif target == 'certificate does not have select':
        location = locations.CertificateAttributes.Selects.certificate_does_not_have
        helpers.click_or_select(location, **kwargs)
    elif target == 'attribute added date select':
        location = locations.CertificateAttributes.Selects.attribute_added_date
        helpers.click_or_select(location, **kwargs)
    elif target == 'certificate has add all button':
        helpers.click_helper(
            locations.CertificateAttributes.Buttons.certificate_has_add_all)
    elif target == 'certificate has remove all button':
        helpers.click_helper(
            locations.CertificateAttributes.Buttons.certificate_has_remove_all)
    elif target == 'certificate does not have add all button':
        helpers.click_helper(locations.CertificateAttributes.Buttons.
                             certificate_does_not_have_add_all)
    elif target == 'certificate does not have remove all button':
        helpers.click_helper(locations.CertificateAttributes.Buttons.
                             certificate_does_not_have_remove_all)
    else:
        print(warn.INVALID_CLICK_TARGET, target)
Beispiel #6
0
def manage_company_fax_emails(target_name, **kwargs):
    target = target_name.lower()

    if target == 'fax email input':
        location = locations.CompanyFaxEmailsTab.Inputs.manage_company_fax_emails_modal_fax_email
        helpers.click_or_type(location, **kwargs)
    elif target == 'priority select':
        location = locations.CompanyFaxEmailsTab.Selects.manage_company_fax_emails_modal_priority
        helpers.click_or_select(location, **kwargs)
    elif target == 'bucket select':
        location = locations.CompanyFaxEmailsTab.Selects.manage_company_fax_emails_modal_bucket
        helpers.click_or_select(location, **kwargs)
    elif target == 'save button':
        location = locations.CompanyFaxEmailsTab.Buttons.manage_company_fax_emails_modal_save
        helpers.click_helper(location)
    elif target == 'close button':
        location = locations.CompanyFaxEmailsTab.Buttons.manage_company_fax_emails_modal_close
        helpers.click_helper(location)
    else:
        print(warn.INVALID_CLICK_TARGET)
Beispiel #7
0
def provision_avatax_account_modal_click(target_name, **kwargs):
    target = target_name.lower()

    if target == 'avatax account id input':
        location = locations.Inputs.provision_avatax_account_modal_avatax_account_id
        helpers.click_or_type(location, **kwargs)
    elif target == 'import ecms data checkbox input':
        location = locations.Inputs.provision_avatax_account_modal_import_ecms_data_checkbox
        helpers.click_helper(location)
    elif target == 'provision avatax account button':
        location = locations.Buttons.provision_avatax_account_modal_provision_avatax_account
        helpers.click_helper(location)
    elif target == 'cancel button':
        location = locations.Buttons.provision_avatax_account_modal_cancel
        helpers.click_helper(location)
    elif target == 'x button' or target == 'close button':
        location = locations.Buttons.provision_avatax_account_modal_close
        helpers.click_helper(location)
    else:
        print('Invalid click target requested')
Beispiel #8
0
def retail_location_click(target_name, **kwargs):
    target = target_name.lower()

    if target == 'location name input':
        location = locations.RetailLocation.Inputs.name
        helpers.click_or_type(location, **kwargs)
    elif target == 'location codes input':
        location = locations.RetailLocation.Inputs.location_codes
        helpers.textarea_field_click_or_type(location, **kwargs)
    elif target == 'state input':
        location = locations.RetailLocation.Inputs.state
        helpers.input_field_click_or_select(location, **kwargs)
    elif target == 'limit search select':
        location = locations.RetailLocation.Selects.limit_search
        helpers.click_or_select(location, **kwargs)
    elif target == 'state add all button':
        location = locations.RetailLocation.Buttons.state_add_all
        helpers.click_helper(location)
    elif target == 'state remove all button':
        location = locations.RetailLocation.Buttons.state_remove_all
        helpers.click_helper(location)
    else:
        print(warn.INVALID_CLICK_TARGET, target)
Beispiel #9
0
def validator_criteria_click(target_name, **kwargs):
    target = target_name.lower()

    if target == 'validator names input':
        location = locations.ValidatorCriteria.Inputs.validator_names
        helpers.textarea_field_click_or_type(location, **kwargs)
    elif target == 'validation date date begin input':
        location = locations.ValidatorCriteria.Inputs.certificate_validation_date_begin
        helpers.click_or_type(location, **kwargs)
    elif target == 'validation date date end input':
        location = locations.ValidatorCriteria.Inputs.certificate_validation_date_end
        helpers.click_or_type(location, **kwargs)
    elif target == 'validation date date ago input':
        location = locations.ValidatorCriteria.Inputs.certificate_validation_days_ago
        helpers.click_or_type(location, **kwargs)
    elif target == 'validation date date to input':
        location = locations.ValidatorCriteria.Inputs.certificate_validation_days_to
        helpers.click_or_type(location, **kwargs)
    elif target == 'validation date select':
        location = locations.ValidatorCriteria.Selects.validation_date
        helpers.click_or_select(location, **kwargs)
    else:
        print(warn.INVALID_CLICK_TARGET, target)
Beispiel #10
0
def upload_document_modal_click(target_name, **kwargs):
    target = target_name.lower()

    if target == 'choose file input':
        location = locations.UploadDocumentModal.Inputs.choose_file
        helpers.click_or_type(location, **kwargs)
    elif target == 'claim document input':
        location = locations.UploadDocumentModal.Inputs.claim_document
        helpers.click_or_type(location, **kwargs)
    elif target == 'auto split page count input':
        location = locations.UploadDocumentModal.Inputs.auto_split_page_count
        helpers.click_or_type(location, **kwargs)
    elif target == 'priority select':
        location = locations.UploadDocumentModal.Selects.priority
        helpers.click_or_select(location, **kwargs)
    elif target == 'auto split select':
        location = locations.UploadDocumentModal.Selects.auto_split
        helpers.click_or_select(location, **kwargs)
    elif target == 'bucket select':
        location = locations.UploadDocumentModal.Selects.bucket
        helpers.click_or_select(location, **kwargs)
    elif target == 'document type select':
        location = locations.UploadDocumentModal.Selects.document_type
        helpers.click_or_select(location, **kwargs)
    elif target == 'exposure zone select':
        location = locations.UploadDocumentModal.Selects.exposure_zone
        helpers.click_or_select(location, **kwargs)
    elif target == 'exempt reason select':
        location = locations.UploadDocumentModal.Selects.exempt_reason
        helpers.click_or_select(location, **kwargs)
    elif target == 'close button':
        location = locations.UploadDocumentModal.Buttons.close
        helpers.click_helper(location)
    elif target == 'upload stack button':
        location = locations.UploadDocumentModal.Buttons.upload_stack_button
        helpers.click_helper(location)
        time.sleep(3)
    else:
        print(warn.INVALID_CLICK_TARGET)
Beispiel #11
0
def edit_retail_purchaser_options_modal_click(target_name, **kwargs):
    target = target_name.lower()

    if target == 'address line 1 checkbox input':
        location = locations.RetailPurchaserSettingsTab.Inputs.edit_retail_purchaser_settings_modal_address_line_1
        helpers.click_or_type(location, **kwargs)
    elif target == 'address line 2 checkbox input':
        location = locations.RetailPurchaserSettingsTab.Inputs.edit_retail_purchaser_settings_modal_address_line_2
        helpers.click_helper(location)
    elif target == 'city checkbox input':
        location = locations.RetailPurchaserSettingsTab.Inputs.edit_retail_purchaser_settings_modal_city
        helpers.click_helper(location)
    elif target == 'contact name checkbox input':
        location = locations.RetailPurchaserSettingsTab.Inputs.edit_retail_purchaser_settings_modal_contact_name
        helpers.click_helper(location)
    elif target == 'country checkbox input':
        location = locations.RetailPurchaserSettingsTab.Inputs.edit_retail_purchaser_settings_modal_country
        helpers.click_helper(location)
    elif target == 'customer number checkbox input':
        location = locations.RetailPurchaserSettingsTab.Inputs.edit_retail_purchaser_settings_modal_customer_number
        helpers.click_helper(location)
    elif target == 'email checkbox input':
        location = locations.RetailPurchaserSettingsTab.Inputs.edit_retail_purchaser_settings_modal_email
        helpers.click_helper(location)
    elif target == 'name checkbox input':
        location = locations.RetailPurchaserSettingsTab.Inputs.edit_retail_purchaser_settings_modal_name
        helpers.click_helper(location)
    elif target == 'phone checkbox input':
        location = locations.RetailPurchaserSettingsTab.Inputs.edit_retail_purchaser_settings_modal_phone
        helpers.click_helper(location)
    elif target == 'state checkbox input':
        location = locations.RetailPurchaserSettingsTab.Inputs.edit_retail_purchaser_settings_modal_state
        helpers.click_helper(location)
    elif target == 'zip checkbox input':
        location = locations.RetailPurchaserSettingsTab.Inputs.edit_retail_purchaser_settings_modal_zip
        helpers.click_helper(location)
    if target == 'address line 1 select':
        location = locations.RetailPurchaserSettingsTab.Selects.edit_retail_purchaser_settings_modal_address_line_1
        helpers.click_or_select(location)
    elif target == 'address line 2 select':
        location = locations.RetailPurchaserSettingsTab.Selects.edit_retail_purchaser_settings_modal_address_line_2
        helpers.click_or_select(location)
    elif target == 'city select':
        location = locations.RetailPurchaserSettingsTab.Selects.edit_retail_purchaser_settings_modal_city
        helpers.click_or_select(location)
    elif target == 'contact name select':
        location = locations.RetailPurchaserSettingsTab.Selects.edit_retail_purchaser_settings_modal_contact_name
        helpers.click_or_select(location)
    elif target == 'country select':
        location = locations.RetailPurchaserSettingsTab.Selects.edit_retail_purchaser_settings_modal_country
        helpers.click_or_select(location)
    elif target == 'customer number select':
        location = locations.RetailPurchaserSettingsTab.Selects.edit_retail_purchaser_settings_modal_customer_number
        helpers.click_or_select(location)
    elif target == 'email select':
        location = locations.RetailPurchaserSettingsTab.Selects.edit_retail_purchaser_settings_modal_email
        helpers.click_or_select(location)
    elif target == 'name select':
        location = locations.RetailPurchaserSettingsTab.Selects.edit_retail_purchaser_settings_modal_name
        helpers.click_or_select(location)
    elif target == 'phone select':
        location = locations.RetailPurchaserSettingsTab.Selects.edit_retail_purchaser_settings_modal_phone
        helpers.click_or_select(location)
    elif target == 'state select':
        location = locations.RetailPurchaserSettingsTab.Selects.edit_retail_purchaser_settings_modal_state
        helpers.click_or_select(location)
    elif target == 'zip select':
        location = locations.RetailPurchaserSettingsTab.Selects.edit_retail_purchaser_settings_modal_zip
        helpers.click_or_select(location)
    elif target == 'update purchaser settings button':
        location = locations\
            .RetailPurchaserSettingsTab.Buttons.edit_retail_purchaser_settings_modal_update_purchaser_settings
        helpers.click_helper(location)
    elif target == 'cancel button':
        location = locations.RetailPurchaserSettingsTab.Buttons.edit_retail_purchaser_settings_modal_cancel
        helpers.click_helper(location)
    elif target == 'close button':
        location = locations.RetailPurchaserSettingsTab.Buttons.edit_retail_purchaser_settings_modal_close
        helpers.click_helper(location)
    else:
        print(warn.INVALID_CLICK_TARGET)
Beispiel #12
0
def customer_criteria_click(target_name, **kwargs):
    target = target_name.lower()

    if target == 'customer numbers input':
        location = locations.CustomerCriteria.Inputs.customer_numbers
        helpers.textarea_field_click_or_type(location, **kwargs)
    elif target == 'alternate id input':
        location = locations.CustomerCriteria.Inputs.alternate_id
        helpers.click_or_type(location, **kwargs)
    elif target == 'customer name input':
        location = locations.CustomerCriteria.Inputs.customer_name
        helpers.click_or_type(location, **kwargs)
    elif target == 'state input':
        location = locations.CustomerCriteria.Inputs.state
        helpers.state_input_field_click_or_select(location, **kwargs)
    elif target == 'fein input':
        location = locations.CustomerCriteria.Inputs.fein
        helpers.click_or_type(location, **kwargs)
    elif target == 'tax number input':
        location = locations.CustomerCriteria.Inputs.tax_number
        helpers.click_or_type(location, **kwargs)
    elif target == 'address line 1 input':
        location = locations.CustomerCriteria.Inputs.address_line_1
        helpers.click_or_type(location, **kwargs)
    elif target == 'address line 2 input':
        location = locations.CustomerCriteria.Inputs.address_line_2
        helpers.click_or_type(location, **kwargs)
    elif target == 'zip input' or target == 'zip code input':
        location = locations.CustomerCriteria.Inputs.zip
        helpers.click_or_type(location, **kwargs)
    elif target == 'phone number input':
        location = locations.CustomerCriteria.Inputs.phone_number
        helpers.click_or_type(location, **kwargs)
    elif target == 'fax number input':
        location = locations.CustomerCriteria.Inputs.fax_number
        helpers.click_or_type(location, **kwargs)
    elif target == 'contact name input':
        location = locations.CustomerCriteria.Inputs.contact_name
        helpers.click_or_type(location, **kwargs)
    elif target == 'contact email input':
        location = locations.CustomerCriteria.Inputs.contact_email
        helpers.click_or_type(location, **kwargs)
    elif target == 'created date begin input':
        location = locations.CustomerCriteria.Inputs.customer_created_date_begin
        helpers.click_or_type(location, **kwargs)
    elif target == 'created date end input':
        location = locations.CustomerCriteria.Inputs.customer_created_date_end
        helpers.click_or_type(location, **kwargs)
    elif target == 'created date ago input':
        location = locations.CustomerCriteria.Inputs.customer_created_days_ago
        helpers.click_or_type(location, **kwargs)
    elif target == 'created date to input':
        location = locations.CustomerCriteria.Inputs.customer_created_days_to
        helpers.click_or_type(location, **kwargs)
    elif target == 'modified date begin input':
        location = locations.CustomerCriteria.Inputs.customer_modified_date_begin
        helpers.click_or_type(location, **kwargs)
    elif target == 'modified date end input':
        location = locations.CustomerCriteria.Inputs.customer_modified_date_end
        helpers.click_or_type(location, **kwargs)
    elif target == 'modified date ago input':
        location = locations.CustomerCriteria.Inputs.customer_modified_days_ago
        helpers.click_or_type(location, **kwargs)
    elif target == 'modified date to input':
        location = locations.CustomerCriteria.Inputs.customer_modified_days_to
        helpers.click_or_type(location, **kwargs)
    elif target == 'last transaction date begin input':
        location = locations.CustomerCriteria.Inputs.last_transaction_date_begin
        helpers.click_or_type(location, **kwargs)
    elif target == 'last transaction date end input':
        location = locations.CustomerCriteria.Inputs.last_transaction_date_end
        helpers.click_or_type(location, **kwargs)
    elif target == 'last transaction date ago input':
        location = locations.CustomerCriteria.Inputs.last_transaction_days_ago
        helpers.click_or_type(location, **kwargs)
    elif target == 'last transaction date to input':
        location = locations.CustomerCriteria.Inputs.last_transaction_days_to
        helpers.click_or_type(location, **kwargs)
    elif target == 'create date select':
        location = locations.CustomerCriteria.Selects.customer_create_date_format
        helpers.click_or_select(location, **kwargs)
    elif target == 'modified date select':
        location = locations.CustomerCriteria.Selects.customer_modified_date_format
        helpers.click_or_select(location, **kwargs)
    elif target == 'last transaction date select':
        location = locations.CustomerCriteria.Selects.last_transaction_date_format
        helpers.click_or_select(location, **kwargs)
    elif target == 'state add all button':
        helpers.click_helper(locations.CustomerCriteria.Buttons.state_add_all)
    elif target == 'state remove all button':
        helpers.click_helper(
            locations.CustomerCriteria.Buttons.state_remove_all)
    else:
        print(warn.INVALID_CLICK_TARGET, target)
Beispiel #13
0
def validate_document_window_click(target_name, **kwargs):
    target = target_name.lower()

    if target == 'customers input':
        location = locations.ValidateDocumentWindow.Inputs.customers
        helpers.validation_customers_click_or_select(location, **kwargs)
    elif target == 'created date input':
        location = locations.ValidateDocumentWindow.Inputs.created_date
        helpers.click_or_type_date(location, **kwargs)
    elif target == 'effective date input':
        location = locations.ValidateDocumentWindow.Inputs.effective_Date
        helpers.click_or_type_date(location, **kwargs)
    elif target == 'single use checkbox input':
        location = locations.ValidateDocumentWindow.Inputs.single_use_checkbox
        helpers.click_or_type(location, **kwargs)
    elif target == 'exposure zones input':
        location = locations.ValidateDocumentWindow.Inputs.exposure_zones
        helpers.input_field_click_or_select(location, **kwargs)
    elif target == 'invalid reasons input':
        location = locations.ValidateDocumentWindow.Inputs.invalid_reasons
        helpers.click_or_type(location, **kwargs)
    elif target == 'customer attributes input':
        location = locations.ValidateDocumentWindow.Inputs.customer_attributes
        helpers.click_helper(location)
    elif target == 'documents attributes input':
        location = locations.ValidateDocumentWindow.Inputs.document_attributes
        helpers.click_or_type(location, **kwargs)
    elif target[0:24] == 'exposure zone tax id row' and target[-5:] == 'input':
        if target[26] == ' ':
            number = target[25]  # Supports single digits
            helpers.click_helper(
                locations.ValidateDocumentWindow.Inputs.
                exposure_zone_tax_id_row(number))
        elif target[27] == ' ':
            number = target[25:26]  # Supports double digits
            helpers.click_helper(
                locations.ValidateDocumentWindow.Inputs.
                exposure_zone_tax_id_row(number))
        else:
            print(warn.SOME_PROBLEM)
    elif target[0:29] == 'exposure zone expire date row' and target[
            -5:] == 'input':
        if target[31] == ' ':
            number = target[30]  # Supports single digits
            helpers.click_helper(
                locations.ValidateDocumentWindow.Inputs.
                exposure_zone_expire_date_row(number))
        elif target[32] == ' ':
            number = target[30:31]  # Supports double digits
            helpers.click_helper(
                locations.ValidateDocumentWindow.Inputs.
                exposure_zone_expire_date_row(number))
        else:
            print(warn.SOME_PROBLEM)
    elif target[0:24] == 'exposure zone exempt percentage row' and target[
            -5:] == 'input':
        if target[37] == ' ':
            number = target[36]  # Supports single digits
            helpers.click_helper(
                locations.ValidateDocumentWindow.Inputs.
                exposure_zone_exempt_percentage_row(number))
        elif target[38] == ' ':
            number = target[36:37]  # Supports double digits
            helpers.click_helper(
                locations.ValidateDocumentWindow.Inputs.
                exposure_zone_exempt_percentage_row(number))
        else:
            print(warn.SOME_PROBLEM)
    elif target == 'escalate explain input':
        location = locations.ValidateDocumentWindow.Inputs.escalate_explain
        helpers.click_or_type_date(location, **kwargs)
    elif target == 'document type select':
        location = locations.ValidateDocumentWindow.Selects.document_type
        helpers.click_or_select(location, **kwargs)
    elif target == 'exempt reason select':
        location = locations.ValidateDocumentWindow.Selects.exempt_reason
        helpers.click_or_select(location, **kwargs)
    elif target == 'location select':
        location = locations.ValidateDocumentWindow.Selects.location
        helpers.click_or_select(location, **kwargs)
    elif target == 'state select':
        location = locations.ValidateDocumentWindow.Selects.filter_state
        helpers.click_or_select(location, **kwargs)
    elif target == 'attribute group select':
        location = locations.ValidateDocumentWindow.Selects.filter_attribute_group
        helpers.click_or_select(location, **kwargs)
    elif target == 'attribute select':
        location = locations.ValidateDocumentWindow.Selects.filter_attribute
        helpers.click_or_select(location, **kwargs)
    elif target == 'escalate reason select':
        location = locations.ValidateDocumentWindow.Selects.escalate_reason
        helpers.click_or_select(location, **kwargs)
    elif target == 'delete button':
        location = locations.ValidateDocumentWindow.Buttons.delete
        helpers.click_helper(location)
    elif target == 'defaults button':
        location = locations.ValidateDocumentWindow.Buttons.defaults
        helpers.click_helper(location)
    elif target == 'release button':
        location = locations.ValidateDocumentWindow.Buttons.release
        helpers.click_helper(location)
    elif target == 'download button':
        location = locations.ValidateDocumentWindow.Buttons.download
        helpers.click_helper(location)
    elif target == 'escalate button':
        location = locations.ValidateDocumentWindow.Buttons.escalate
        helpers.click_helper(location)
    elif target == 'validate button':
        location = locations.ValidateDocumentWindow.Buttons.validate
        helpers.click_helper(location)
    elif target == 'advanced search button':
        location = locations.ValidateDocumentWindow.Buttons.advanced_search
        helpers.click_helper(location)
    elif target == 'add customer button':
        location = locations.ValidateDocumentWindow.Buttons.add_customer
        helpers.click_helper(location)
    elif target == 'bulk add button':
        location = locations.ValidateDocumentWindow.Buttons.bulk_add
        helpers.click_helper(location)
    elif target == 'effective date button':
        location = locations.ValidateDocumentWindow.Buttons.date_picker_effective_date
        helpers.click_helper(location)
    elif target == 'clear button':
        location = locations.ValidateDocumentWindow.Buttons.clear
        helpers.click_helper(location)
    elif target == 'expire date button':
        location = locations.ValidateDocumentWindow.Buttons.date_picker_expire_date
        helpers.click_helper(location)
    elif target == 'never expire button':
        location = locations.ValidateDocumentWindow.Buttons.never_expire
        helpers.click_helper(location)
    elif target == 'validate ids button':
        location = locations.ValidateDocumentWindow.Buttons.validate_ids
        helpers.click_helper(location)
    elif target == 'success ok button':
        location = locations.ValidateDocumentWindow.Buttons.success_ok
        helpers.click_helper(location)
        time.sleep(2)
        helpers.close_extra_windows()
    elif target == 'escalate x button':
        location = locations.ValidateDocumentWindow.Buttons.escalate_x
        helpers.click_helper(location)
    elif target == 'escalate escalate button':
        location = locations.ValidateDocumentWindow.Buttons.escalate_escalate
        helpers.click_helper(location)
    else:
        print(warn.INVALID_CLICK_TARGET)
Beispiel #14
0
def click(target_name, **kwargs):
    target = target_name.lower()

    if target == 'customer input':
        location = locations.Inputs.customer
        helpers.click_or_type(location, **kwargs)
    elif target == 'exposure zone input':
        location = locations.Inputs.exposure_zone
        helpers.click_or_type(location, **kwargs)
    elif target == 'document category input':
        location = locations.Inputs.document_category
        helpers.click_or_type(location, **kwargs)
    elif target == 'document id input' or target == 'certificate id input' or target == 'filename input':
        location = locations.Inputs.document_id
        helpers.click_or_type(location, **kwargs)
    elif target == 'created date input':
        location = locations.Inputs.created
        helpers.click_or_type_date(location, **kwargs)
    elif target == 'document type input':
        location = locations.Inputs.document_type
        helpers.click_or_type(location, **kwargs)
    elif target == 'check all documents input':
        location = locations.Inputs.check_all_documents
        helpers.click_helper(location)
    elif target[0:11] == 'results row' and target[-14:] == 'checkbox input':
        if target[13] == ' ':
            number = target[12]  # Supports single digits
            helpers.click_helper(locations.Inputs.results_row_checkbox(number))
        elif target[14] == ' ':
            number = target[12:13]  # Supports double digits
            helpers.click_helper(locations.Inputs.results_row_checkbox(number))
        else:
            print(warn.SOME_PROBLEM)
    elif target == 'stack filter select':
        location = locations.Selects.stack_filter
        helpers.click_or_select(location, **kwargs)
    elif target == 'stage select':
        location = locations.Selects.stage
        helpers.click_or_select(location, **kwargs)
    elif target == 'priority select':
        location = locations.Selects.priority
        helpers.click_or_select(location, **kwargs)
    elif target == 'source select':
        location = locations.Selects.source
        helpers.click_or_select(location, **kwargs)
    elif target == 'bucket select':
        location = locations.Selects.bucket
        helpers.click_or_select(location, **kwargs)
    elif target == 'location select':
        location = locations.Selects.location
        helpers.click_or_select(location, **kwargs)
    elif target == 'page selector top select':
        location = locations.Selects.top_page_selector
        helpers.click_or_select(location, **kwargs)
    elif target == 'page selector bottom select':
        location = locations.Selects.bottom_page_selector
        helpers.click_or_select(location, **kwargs)
    elif target == 'search type toggle button':
        location = locations.Buttons.search_type_toggle
        helpers.click_helper(location)
    elif target == 'upload document button':
        location = locations.Buttons.upload_document
        helpers.click_helper(location)
    elif target == 'search button':
        location = locations.Buttons.search
        helpers.click_helper(location)
        time.sleep(3)
    elif target == 'clear button':
        location = locations.Buttons.clear
        helpers.click_helper(location)
    elif target == 'action button':
        location = locations.Buttons.action
        helpers.click_helper(location)
    elif target == 'first top button':
        location = locations.Buttons.top_first
        helpers.click_helper(location)
    elif target == 'prev top button':
        location = locations.Buttons.top_prev
        helpers.click_helper(location)
    elif target == 'next top button':
        location = locations.Buttons.top_next
        helpers.click_helper(location)
    elif target == 'last top button':
        location = locations.Buttons.top_last
        helpers.click_helper(location)
    elif target == 'first bottom button':
        location = locations.Buttons.bottom_first
        helpers.click_helper(location)
    elif target == 'prev bottom button':
        location = locations.Buttons.bottom_prev
        helpers.click_helper(location)
    elif target == 'next bottom button':
        location = locations.Buttons.bottom_next
        helpers.click_helper(location)
    elif target == 'last bottom button':
        location = locations.Buttons.bottom_last
        helpers.click_helper(location)
    elif target[0:11] == 'results row' and target[-4:] == 'link':
        if target[13] == ' ':
            number = target[12]  # Supports single digits
            helpers.click_helper(locations.Links.results_row(number))
            time.sleep(2)
            helpers.switch_to_new_window()
            time.sleep(2)
        elif target[14] == ' ':
            number = target[12:13]  # Supports double digits
            helpers.click_helper(locations.Links.results_row(number))
            time.sleep(2)
            helpers.switch_to_new_window()
            time.sleep(2)
        else:
            print(warn.SOME_PROBLEM)
    elif target == 'document header link':
        location = locations.Links.document_header
        helpers.click_helper(location)
    elif target == 'customer number header link':
        location = locations.Links.customer_number_header
        helpers.click_helper(location)
    elif target == 'stage header link':
        location = locations.Links.stage_header
        helpers.click_helper(location)
    elif target == 'account header link':
        location = locations.Links.account_header
        helpers.click_helper(location)
    elif target == 'exposure zone header link':
        location = locations.Links.exposure_zone_header
        helpers.click_helper(location)
    elif target == 'source header link':
        location = locations.Links.source_header
        helpers.click_helper(location)
    elif target == 'priority header link':
        location = locations.Links.priority_header
        helpers.click_helper(location)
    elif target == 'pages header link':
        location = locations.Links.pages_header
        helpers.click_helper(location)
    elif target == 'age header link':
        location = locations.Links.age_header
        helpers.click_helper(location)
    else:
        print(warn.INVALID_CLICK_TARGET)
Beispiel #15
0
def add_account_modal_click(target_name, **kwargs):
    target = target_name.lower()

    if target == 'account name input':
        location = locations.Inputs.add_account_modal_account_name
        helpers.click_or_type(location, **kwargs)
    elif target == 'address line 1 input':
        location = locations.Inputs.add_account_modal_address_line_1
        helpers.click_or_type(location, **kwargs)
    elif target == 'address line 2 input':
        location = locations.Inputs.add_account_modal_address_line_2
        helpers.click_or_type(location, **kwargs)
    elif target == 'city input':
        location = locations.Inputs.add_account_modal_city
        helpers.click_or_type(location, **kwargs)
    elif target == 'state/province input':
        location = locations.Selects.add_account_modal_state_province
        helpers.click_or_select(location, **kwargs)
    elif target == 'country input':
        location = locations.Selects.add_account_modal_country
        helpers.click_or_select(location, **kwargs)
    elif target == 'zip input':
        location = locations.Inputs.add_account_modal_zip
        helpers.click_or_type(location, **kwargs)
    elif target == 'phone input':
        location = locations.Inputs.add_account_modal_phone
        helpers.click_or_type(location, **kwargs)
    elif target == 'zuora id input':
        location = locations.Inputs.add_account_modal_zuora_id
        helpers.click_or_type(location, **kwargs)
    elif target == 'salesforce id input':
        location = locations.Inputs.add_account_modal_salesforce_id
        helpers.click_or_type(location, **kwargs)
    elif target == 'database name input':
        location = locations.Inputs.add_account_modal_database_name
        helpers.click_or_type(location, **kwargs)
    elif target == 'database server select':
        location = locations.Selects.add_account_modal_database_server
        helpers.click_or_select(location, **kwargs)
    elif target == 'tier select select':
        location = locations.Selects.add_account_modal_tier
        helpers.click_or_select(location, **kwargs)
    elif target == 'upload logo button':
        location = locations.Buttons.add_account_modal_upload_logo
        helpers.click_helper(location)
    elif target == 'demo account checkbox input':
        location = locations.Inputs.add_account_modal_demo_account_checkbox
        helpers.click_helper(location)
    elif target == 'sandbox checkbox input':
        location = locations.Inputs.add_account_modal_sandbox_checkbox
        helpers.click_helper(location)
    elif target == 'x button' or target == 'close button':
        location = locations.Buttons.add_account_modal_close
        helpers.click_helper(location)
    elif target == 'add account button':
        location = locations.Buttons.add_account_modal_add_account
        helpers.click_helper(location)
    elif target == 'cancel button':
        location = locations.Buttons.add_account_modal_cancel
        helpers.click_helper(location)
    elif target == 'reset button':
        location = locations.Buttons.add_account_modal_reset
        helpers.click_helper(location)
    else:
        print('Invalid click target requested')
Beispiel #16
0
def click(target_name, **kwargs):
    target = target_name.lower()

    if target == 'add account button':
        helpers.click_helper(locations.Buttons.add_account)
    elif target == 'provision avatax account button':
        helpers.click_helper(locations.Buttons.provision_avatax_account)
    elif target == 'filter button':
        helpers.click_helper(locations.Buttons.filter)
    elif target == 'account list link':
        helpers.click_helper(locations.Links.account_list)
    elif target == 'account statistics link':
        helpers.click_helper(locations.Links.account_statistics)
    elif target == 'account / database name input':
        location = locations.Inputs.account_database_name
        helpers.click_or_type(location, **kwargs)
    elif target == 'zuora / avatax account id input':
        location = locations.Inputs.zuora_avatax_id
        helpers.click_or_type(location, **kwargs)
    elif target == 'filter tier input':
        location = locations.Inputs.filter_tier
        helpers.input_field_click_or_select(location, **kwargs)
    elif target == 'filter server input':
        location = locations.Inputs.filter_server
        helpers.input_field_click_or_select(location, **kwargs)
    elif target == 'filter status input':
        location = locations.Inputs.filter_status
        helpers.input_field_click_or_select(location, **kwargs)
    elif target == 'first top button':
        location = locations.Buttons.first_top
        helpers.click_helper(location)
    elif target == 'prev top button':
        location = locations.Buttons.prev_top
        helpers.click_helper(location)
    elif target == 'next top button':
        location = locations.Buttons.next_top
        helpers.click_helper(location)
    elif target == 'last top button':
        location = locations.Buttons.last_top
        helpers.click_helper(location)
    elif target == 'first bottom button':
        location = locations.Buttons.first_bottom
        helpers.click_helper(location)
    elif target == 'prev bottom button':
        location = locations.Buttons.prev_bottom
        helpers.click_helper(location)
    elif target == 'next bottom button':
        location = locations.Buttons.next_bottom
        helpers.click_helper(location)
    elif target == 'last bottom button':
        location = locations.Buttons.last_bottom
        helpers.click_helper(location)
    elif target == 'page select top button':
        location = locations.Buttons.page_select_top
        helpers.click_helper(location)
    elif target == 'page select bottom button':
        location = locations.Buttons.page_select_bottom
        helpers.click_helper(location)
    elif target == 'id header link':
        location = locations.Links.id_header
        helpers.click_helper(location)
    elif target == 'name header link':
        location = locations.Links.name_header
        helpers.click_helper(location)
    elif target == 'tier header link':
        location = locations.Links.tier_header
        helpers.click_helper(location)
    elif target == 'zuora id header link':
        location = locations.Links.zuora_id_header
        helpers.click_helper(location)
    elif target == 'database server header link':
        location = locations.Links.database_server_header
        helpers.click_helper(location)
    elif target == 'database name header link':
        location = locations.Links.database_name_header
        helpers.click_helper(location)
    else:
        print('Invalid click target requested')
Beispiel #17
0
def exemption_search_modal_click(target_name, **kwargs):
    target = target_name.lower()

    if target == 'customer name input':
        location = locations.ExemptionSearchModal.Inputs.customer_name
        helpers.click_or_type(location, **kwargs)
    elif target == 'phone number input':
        location = locations.ExemptionSearchModal.Inputs.phone_number
        helpers.click_or_type(location, **kwargs)
    elif target == 'email input':
        location = locations.ExemptionSearchModal.Inputs.email
        helpers.click_or_type(location, **kwargs)
    elif target == 'city input':
        location = locations.ExemptionSearchModal.Inputs.city
        helpers.click_or_type(location, **kwargs)
    elif target == 'zip code input':
        location = locations.ExemptionSearchModal.Inputs.zip_code
        helpers.click_or_type(location, **kwargs)
    elif target == 'customer number input':
        location = locations.ExemptionSearchModal.Inputs.customer_number
        helpers.click_or_type(location, **kwargs)
    elif target == 'document id input':
        location = locations.ExemptionSearchModal.Inputs.document_id
        helpers.click_or_type(location, **kwargs)
    elif target == 'customer state select':
        location = locations.ExemptionSearchModal.Selects.customer_state
        helpers.click_or_select(location, **kwargs)
    elif target == 'document zone select':
        location = locations.ExemptionSearchModal.Selects.document_zone
        helpers.click_or_select(location, **kwargs)
    elif target == 'close button':
        location = locations.ExemptionSearchModal.Buttons.close
        helpers.click_helper(location)
    elif target == 'search button':
        location = locations.ExemptionSearchModal.Buttons.search
        helpers.click_helper(location)
    elif target == 'clear screen button':
        location = locations.ExemptionSearchModal.Buttons.clear_screen
        helpers.click_helper(location)
    else:
        print(warn.INVALID_CLICK_TARGET)
Beispiel #18
0
def set_up_campaign_click(target_name, **kwargs):
    target = target_name.lower()

    if target == 'campaign title input':
        location = locations.SetUpCampaign.Inputs.campaign_title
        helpers.click_or_type(location, **kwargs)
    elif target == 'include customers input':
        return helpers.click_helper(
            locations.SetUpCampaign.Inputs.include_customers)
    elif target == 'omit customers input':
        return helpers.click_helper(
            locations.SetUpCampaign.Inputs.omit_customers)
    elif target == 'missing exemption input':
        return helpers.click_helper(
            locations.SetUpCampaign.Inputs.missing_exemption)
    elif target == 'invalid exemption input':
        return helpers.click_helper(
            locations.SetUpCampaign.Inputs.invalid_exemption)
    elif target == 'expired certificate input':
        return helpers.click_helper(
            locations.SetUpCampaign.Inputs.expired_certificate)
    elif target == 'include soon to expire input':
        return helpers.click_helper(
            locations.SetUpCampaign.Inputs.include_soon_to_expire)
    elif target == 'include soon to expire days input':
        return helpers.click_helper(
            locations.SetUpCampaign.Inputs.include_soon_to_expire_days)
    elif target == 'taxable exposures input':
        return helpers.click_helper(
            locations.SetUpCampaign.Inputs.taxable_exposures)
    elif target == 'override input':
        return helpers.click_helper(locations.SetUpCampaign.Inputs.override)
    elif target == 'billing customers input':
        return helpers.click_helper(
            locations.SetUpCampaign.Inputs.billing_customers)
    elif target == 'shipping customers input':
        return helpers.click_helper(
            locations.SetUpCampaign.Inputs.shipping_customers)
    elif target == 'exclude same as input':
        return helpers.click_helper(
            locations.SetUpCampaign.Inputs.exclude_same_as)
    elif target == 'expand bill to ship input':
        return helpers.click_helper(
            locations.SetUpCampaign.Inputs.expand_bill_to_ship)
    elif target == 'exempt reasons input':
        location = locations.SetUpCampaign.Inputs.exempt_reasons
        helpers.input_field_click_or_select(location, **kwargs)
    elif target == 'select all link':
        return helpers.click_helper(locations.SetUpCampaign.Links.select_all)
    elif target == 'deselect all link':
        return helpers.click_helper(locations.SetUpCampaign.Links.deselect_all)
    elif target == 'document type select':
        location = locations.SetUpCampaign.Selects.document_type
        helpers.click_or_select(location, **kwargs)
    elif target == 'prepare campaign button':
        # Attempting to return this element causes an error
        # driver.find_element_by_xpath(locations.SetUpCampaign.Buttons.prepare_campaign).click()
        location = locations.SetUpCampaign.Buttons.prepare_campaign
        helpers.click_helper(location)
        time.sleep(2)
    else:
        print(warn.INVALID_CLICK_TARGET)
Beispiel #19
0
def customer_exempt_exposure_reasons(target_name, **kwargs):
    target = target_name.lower()

    if target == 'customer reason in exposure zones input':
        location = locations.CustomerExemptExposureReasons.Inputs.customer_reason_in_exposure_zones
        helpers.input_field_click_or_select(location, **kwargs)
    elif target == 'customer has documented reasons input':
        location = locations.CustomerExemptExposureReasons.Inputs.customer_has_documented_reasons
        helpers.input_field_click_or_select(location, **kwargs)
    elif target == 'customer does not have documented reasons input':
        location = locations.CustomerExemptExposureReasons.Inputs.customer_does_not_have_documented_reasons
        helpers.input_field_click_or_select(location, **kwargs)
    elif target == 'customer has expected reasons input':
        location = locations.CustomerExemptExposureReasons.Inputs.customer_has_expected_reasons
        helpers.input_field_click_or_select(location, **kwargs)
    elif target == 'customer does not have expected reasons input':
        location = locations.CustomerExemptExposureReasons.Inputs.customer_does_not_have_expected_reasons
        helpers.input_field_click_or_select(location, **kwargs)
    elif target == 'reason modified date begin input':
        location = locations.CustomerExemptExposureReasons.Inputs.customer_tax_code_date_begin
        helpers.click_or_type(location, **kwargs)
    elif target == 'reason modified date end input':
        location = locations.CustomerExemptExposureReasons.Inputs.customer_tax_code_date_end
        helpers.click_or_type(location, **kwargs)
    elif target == 'reason modified date ago input':
        location = locations.CustomerExemptExposureReasons.Inputs.customer_tax_code_days_ago
        helpers.click_or_type(location, **kwargs)
    elif target == 'reason modified date to input':
        location = locations.CustomerExemptExposureReasons.Inputs.customer_tax_code_days_to
        helpers.click_or_type(location, **kwargs)
    elif target == 'customer reason in exposure zones select':
        location = locations.CustomerExemptExposureReasons.Selects.customer_reason_in_exposure_zones
        helpers.click_or_select(location, **kwargs)
    elif target == 'customer has documented reasons select':
        location = locations.CustomerExemptExposureReasons.Selects.customer_has_documented_reasons
        helpers.click_or_select(location, **kwargs)
    elif target == 'customer does not have documented reasons select':
        location = locations.CustomerExemptExposureReasons.Selects.customer_does_not_have_documented_reasons
        helpers.click_or_select(location, **kwargs)
    elif target == 'customer has expected reasons select':
        location = locations.CustomerExemptExposureReasons.Selects.customer_has_expected_reasons
        helpers.click_or_select(location, **kwargs)
    elif target == 'customer does not have expected reasons select':
        location = locations.CustomerExemptExposureReasons.Selects.customer_does_not_have_expected_reasons
        helpers.click_or_select(location, **kwargs)
    elif target == 'reason modified date select':
        location = locations.CustomerExemptExposureReasons.Selects.reason_modified_date
        helpers.click_or_select(location, **kwargs)
    elif target == 'customer reason in exposure zones add all button':
        helpers.click_helper(locations.CustomerExemptExposureReasons.Buttons.
                             customer_reason_in_exposure_zones_add_all)
    elif target == 'customer reason in exposure zones remove all button':
        helpers.click_helper(locations.CustomerExemptExposureReasons.Buttons.
                             customer_reason_in_exposure_zones_remove_all)
    elif target == 'customer has documented reasons add all button':
        helpers.click_helper(locations.CustomerExemptExposureReasons.Buttons.
                             customer_has_documented_reasons_add_all)
    elif target == 'customer has documented reasons remove all button':
        helpers.click_helper(locations.CustomerExemptExposureReasons.Buttons.
                             customer_has_documented_reasons_remove_all)
    elif target == 'customer does not have documented reasons add all button':
        helpers.click_helper(locations.CustomerExemptExposureReasons.Buttons.
                             customer_does_not_have_documented_reasons_add_all)
    elif target == 'customer does not have documented reasons remove all button':
        helpers.click_helper(
            locations.CustomerExemptExposureReasons.Buttons.
            customer_does_not_have_documented_reasons_remove_all)
    elif target == 'customer has expected reasons add all button':
        helpers.click_helper(locations.CustomerExemptExposureReasons.Buttons.
                             customer_has_expected_reasons_add_all)
    elif target == 'customer has expected reasons remove all button':
        helpers.click_helper(locations.CustomerExemptExposureReasons.Buttons.
                             customer_has_expected_reasons_remove_all)
    elif target == 'customer does not have expected reasons add all button':
        helpers.click_helper(locations.CustomerExemptExposureReasons.Buttons.
                             customer_does_not_have_expected_reasons_add_all)
    elif target == 'customer does not have expected reasons remove all button':
        helpers.click_helper(
            locations.CustomerExemptExposureReasons.Buttons.
            customer_does_not_have_expected_reasons_remove_all)
    else:
        print(warn.INVALID_CLICK_TARGET, target)
Beispiel #20
0
def click(target_name, **kwargs):
    target = target_name.lower()

    if target == 'generate request button' or target == 'generate request top button':
        helpers.click_helper(locations.Buttons.generate_request_top)
        time.sleep(2)
    elif target == 'generate request bottom button':
        helpers.click_helper(locations.Buttons.generate_request_bottom)
        time.sleep(2)
    elif target == 'add exposure zone button' or target == 'add shipto state/zone button' \
            or target == 'add shipto zone button':
        helpers.click_helper(locations.Buttons.add_exposure_zone)
    elif target == 'customer search input':
        location = locations.Inputs.search_customer_name_number
        helpers.single_request_recipient_click_or_select(location, **kwargs)
    elif target == 'customer number / name input':
        location = locations.Inputs.customer
        helpers.single_request_recipient_click_or_select(location, **kwargs)
    elif target == 'return date input':
        location = locations.Inputs.return_date
        helpers.click_or_type_date(location, **kwargs)
    elif target == 'email address input' or target == 'email input':
        location = locations.Inputs.email_address
        helpers.click_or_type(location, **kwargs)
    elif target == 'fax number input':
        location = locations.Inputs.fax_number
        helpers.click_or_type(location, **kwargs)
    elif target == 'exposure zone select all link':
        helpers.click_helper(locations.Links.exposure_zones_select_all)
    elif target == 'exposure zone select none link':
        helpers.click_helper(locations.Links.exposure_zones_select_none)
    elif target == 'exposure zone select default link':
        helpers.click_helper(locations.Links.exposure_zones_select_default)
    elif target == 'exempt reason select all link':
        helpers.click_helper(locations.Links.exempt_reasons_select_all)
    elif target == 'exempt reason deselect all link' or target == 'exempt reason de-select all link':
        helpers.click_helper(locations.Links.exempt_reasons_deselect_all)
    elif target == 'exemption certificate templates select all link' or target == 'templates select all link':
        helpers.click_helper(locations.Links.templates_select_all)
    elif target == 'exemption certificate templates deselect all link' \
            or target == 'exemption certificate templates de-select all link' \
            or target == 'templates deselect all link' \
            or target == 'templates de-select all link':
        helpers.click_helper(locations.Links.templates_deselect_all)
    elif target == 'company select':  # Disabled field...
        location = locations.Selects.company
        helpers.click_helper(location)
    elif target == 'delivery method select':
        location = locations.Selects.delivery_method
        helpers.click_or_select(location, **kwargs)
    elif target == 'cover letter select':
        location = locations.Selects.cover_letter
        helpers.click_or_select(location, **kwargs)
    elif target == 'exempt reason input' or target == 'document category input':
        location = locations.Inputs.exempt_reason
        helpers.input_field_click_or_select(location, **kwargs)
    elif target == 'document type select':
        location = locations.Selects.document_type
        helpers.click_or_select(location, **kwargs)
    else:
        print('Invalid target requested.')
Beispiel #21
0
def add_company_modal_click(target_name, **kwargs):
    target = target_name.lower()

    if target == 'display name input':
        location = locations.CompanyHierarchyTab.Inputs.add_company_modal_display_name
        helpers.click_or_type(location, **kwargs)
    elif target == 'legal name input':
        location = locations.CompanyHierarchyTab.Inputs.add_company_modal_legal_name
        helpers.click_or_type(location, **kwargs)
    elif target == 'use address input':
        location = locations.CompanyHierarchyTab.Inputs.add_company_modal_use_address_checkbox
        helpers.click_or_type(location, **kwargs)
    elif target == 'address line 1 input':
        location = locations.CompanyHierarchyTab.Inputs.add_company_modal_address_line_1
        helpers.click_or_type(location, **kwargs)
    elif target == 'address line 2 input':
        location = locations.CompanyHierarchyTab.Inputs.add_company_modal_address_line_2
        helpers.click_or_type(location, **kwargs)
    elif target == 'city input':
        location = locations.CompanyHierarchyTab.Inputs.add_company_modal_city
        helpers.click_or_type(location, **kwargs)
    elif target == 'country select':
        location = locations.CompanyHierarchyTab.Selects.add_company_modal_country
        helpers.click_or_select(location, **kwargs)
    elif target == 'state/province select':
        location = locations.CompanyHierarchyTab.Selects.add_company_modal_state
        helpers.click_or_select(location, **kwargs)
    elif target == 'zip input':
        location = locations.CompanyHierarchyTab.Inputs.add_company_modal_zip
        helpers.click_or_type(location, **kwargs)
    elif target == 'phone input':
        location = locations.CompanyHierarchyTab.Inputs.add_company_modal_phone
        helpers.click_or_type(location, **kwargs)
    elif target == 'fein input':
        location = locations.CompanyHierarchyTab.Inputs.add_company_modal_fein
        helpers.click_or_type(location, **kwargs)
    elif target == 'add button':
        location = locations.CompanyHierarchyTab.Buttons.add_company_modal_add
        helpers.click_helper(location)
    elif target == 'cancel button':
        location = locations.CompanyHierarchyTab.Buttons.add_company_modal_cancel
        helpers.click_helper(location)
    elif target == 'close button':
        location = locations.CompanyHierarchyTab.Buttons.add_company_modal_close
        helpers.click_helper(location)
    else:
        print('Invalid target requested.')
Beispiel #22
0
def certificate_criteria_click(target_name, **kwargs):
    target = target_name.lower()

    if target == 'certificate ids input':
        location = locations.CertificateCriteria.Inputs.certificate_ids
        helpers.textarea_field_click_or_type(location, **kwargs)
    elif target == 'status input':
        location = locations.CertificateCriteria.Inputs.status
        helpers.input_field_click_or_select(location, **kwargs)
    elif target == 'exposure zone input':
        location = locations.CertificateCriteria.Inputs.exposure_zone
        helpers.input_field_click_or_select(location, **kwargs)
    elif target == 'exempt percent input':
        location = locations.CertificateCriteria.Inputs.exempt_percent
        helpers.click_or_type(location, **kwargs)
    elif target == 'po number input':
        location = locations.CertificateCriteria.Inputs.po_number
        helpers.click_or_type(location, **kwargs)
    elif target == 'tax number input':
        location = locations.CertificateCriteria.Inputs.tax_number
        helpers.click_or_type(location, **kwargs)
    elif target == 'certificate created date begin input':
        location = locations.CertificateCriteria.Inputs.certificate_created_date_begin
        helpers.click_or_type(location, **kwargs)
    elif target == 'certificate created date end input':
        location = locations.CertificateCriteria.Inputs.certificate_created_date_end
        helpers.click_or_type(location, **kwargs)
    elif target == 'certificate created date ago input':
        location = locations.CertificateCriteria.Inputs.certificate_created_days_ago
        helpers.click_or_type(location, **kwargs)
    elif target == 'certificate created date to input':
        location = locations.CertificateCriteria.Inputs.certificate_created_days_to
        helpers.click_or_type(location, **kwargs)
    elif target == 'certificate modified date begin input':
        location = locations.CertificateCriteria.Inputs.certificate_modified_date_begin
        helpers.click_or_type(location, **kwargs)
    elif target == 'certificate modified date end input':
        location = locations.CertificateCriteria.Inputs.certificate_modified_date_end
        helpers.click_or_type(location, **kwargs)
    elif target == 'certificate modified date ago input':
        location = locations.CertificateCriteria.Inputs.certificate_modified_days_ago
        helpers.click_or_type(location, **kwargs)
    elif target == 'certificate modified date to input':
        location = locations.CertificateCriteria.Inputs.certificate_modified_days_to
        helpers.click_or_type(location, **kwargs)
    elif target == 'certificate signed date begin input':
        location = locations.CertificateCriteria.Inputs.certificate_signed_date_begin
        helpers.click_or_type(location, **kwargs)
    elif target == 'certificate signed date end input':
        location = locations.CertificateCriteria.Inputs.certificate_signed_date_end
        helpers.click_or_type(location, **kwargs)
    elif target == 'certificate signed date ago input':
        location = locations.CertificateCriteria.Inputs.certificate_signed_days_ago
        helpers.click_or_type(location, **kwargs)
    elif target == 'certificate signed date to input':
        location = locations.CertificateCriteria.Inputs.certificate_signed_days_to
        helpers.click_or_type(location, **kwargs)
    elif target == 'certificate expiration date begin input':
        location = locations.CertificateCriteria.Inputs.certificate_expiration_date_begin
        helpers.click_or_type(location, **kwargs)
    elif target == 'certificate expiration date end input':
        location = locations.CertificateCriteria.Inputs.certificate_expiration_date_end
        helpers.click_or_type(location, **kwargs)
    elif target == 'certificate expiration date ago input':
        location = locations.CertificateCriteria.Inputs.certificate_expiration_days_ago
        helpers.click_or_type(location, **kwargs)
    elif target == 'certificate expiration date to input':
        location = locations.CertificateCriteria.Inputs.certificate_expiration_days_to
        helpers.click_or_type(location, **kwargs)
    elif target == 'has customer select':
        location = locations.CertificateCriteria.Selects.has_customer
        helpers.click_or_select(location, **kwargs)
    elif target == 'certificate is valid select':
        location = locations.CertificateCriteria.Selects.valid
        helpers.click_or_select(location, **kwargs)
    elif target == 'expired select':
        location = locations.CertificateCriteria.Selects.expired
        helpers.click_or_select(location, **kwargs)
    elif target == 'link type select':
        location = locations.CertificateCriteria.Selects.link_type
        helpers.click_or_select(location, **kwargs)
    elif target == 'is single select':
        location = locations.CertificateCriteria.Selects.is_single
        helpers.click_or_select(location, **kwargs)
    elif target == 'create date select':
        location = locations.CertificateCriteria.Selects.certificate_create_date_format
        helpers.click_or_select(location, **kwargs)
    elif target == 'modified date select':
        location = locations.CertificateCriteria.Selects.certificate_modified_date_format
        helpers.click_or_select(location, **kwargs)
    elif target == 'effective date select':
        location = locations.CertificateCriteria.Selects.certificate_signed_date_format
        helpers.click_or_select(location, **kwargs)
    elif target == 'expiration date select':
        location = locations.CertificateCriteria.Selects.certificate_expiration_date_day_range
        helpers.click_or_select(location, **kwargs)
    elif target == 'effective date days ago days from now select':
        location = locations.CertificateCriteria.Selects.certificate_signed_date_day_range
        helpers.click_or_select(location, **kwargs)
    elif target == 'expiration date days ago days from now select':
        location = locations.CertificateCriteria.Selects.certificate_expiration_date_day_range
        helpers.click_or_select(location, **kwargs)
    elif target == 'status add all button':
        helpers.click_helper(
            locations.CertificateCriteria.Buttons.status_add_all)
    elif target == 'status remove all button':
        helpers.click_helper(
            locations.CertificateCriteria.Buttons.status_remove_all)
    elif target == 'exposure zone add all button':
        helpers.click_helper(
            locations.CertificateCriteria.Buttons.exposure_zone_add_all)
    elif target == 'exposure zone remove all button':
        helpers.click_helper(
            locations.CertificateCriteria.Buttons.exposure_zone_remove_all)
    else:
        print(warn.INVALID_CLICK_TARGET, target)
Beispiel #23
0
def click(target_name, **kwargs):
    target = target_name.lower()

    if target == 'customer number input':
        location = locations.Inputs.customer_number
        helpers.click_or_type(location, **kwargs)
    elif target == 'name input':
        location = locations.Inputs.name
        helpers.click_or_type(location, **kwargs)
    elif target == 'contact name input':
        location = locations.Inputs.contact_name
        helpers.click_or_type(location, **kwargs)
    elif target == 'alternate id input':
        location = locations.Inputs.alternate_id
        helpers.click_or_type(location, **kwargs)
    elif target == 'phone number input':
        location = locations.Inputs.phone_number
        helpers.click_or_type(location, **kwargs)
    elif target == 'fax number input':
        location = locations.Inputs.fax_number
        helpers.click_or_type(location, **kwargs)
    elif target == 'email address input':
        location = locations.Inputs.email_address
        helpers.click_or_type(location, **kwargs)
    elif target == 'fein input':
        location = locations.Inputs.fein
        helpers.click_or_type(location, **kwargs)
    elif target == 'attention name input':
        location = locations.Inputs.attention_name
        helpers.click_or_type(location, **kwargs)
    elif target == 'address line 1 input':
        location = locations.Inputs.address_line_1
        helpers.click_or_type(location, **kwargs)
    elif target == 'address line 2 input':
        location = locations.Inputs.address_line_2
        helpers.click_or_type(location, **kwargs)
    elif target == 'city input':
        location = locations.Inputs.city
        helpers.click_or_type(location, **kwargs)
    elif target == 'zip input':
        location = locations.Inputs.zip
        helpers.click_or_type(location, **kwargs)
    elif target == 'state select':
        location = locations.Selects.state
        helpers.click_or_select(location, **kwargs)
    elif target == 'country select':
        location = locations.Selects.country
        helpers.click_or_select(location, **kwargs)
    elif target == 'generate button':
        location = locations.Buttons.generate
        helpers.click_helper(location)
    elif target == 'add new customer button':
        location = locations.Buttons.add_new_customer
        helpers.click_helper(location)
        time.sleep(3)  # Wait for processing
    elif target == 'reset button':
        location = locations.Buttons.reset
        helpers.click_helper(location)
    else:
        print(warn.INVALID_CLICK_TARGET)
Beispiel #24
0
def edit_company_information_modal_click(target_name, **kwargs):
    target = target_name.lower()

    if target == 'name input':
        location = locations.CompanyInformationTab.Inputs.edit_company_information_modal_name
        helpers.click_or_type(location, **kwargs)
    elif target == 'legal name input':
        location = locations.CompanyInformationTab.Inputs.edit_company_information_modal_legal_name
        helpers.click_or_type(location, **kwargs)
    elif target == 'address line 1 input':
        location = locations.CompanyInformationTab.Inputs.edit_company_information_modal_address_line_1
        helpers.click_or_type(location, **kwargs)
    elif target == 'address line 2 input':
        location = locations.CompanyInformationTab.Inputs.edit_company_information_modal_address_line_2
        helpers.click_or_type(location, **kwargs)
    elif target == 'city input':
        location = locations.CompanyInformationTab.Inputs.edit_company_information_modal_city
        helpers.click_or_type(location, **kwargs)
    elif target == 'country select':
        location = locations.CompanyInformationTab.Selects.edit_company_information_modal_country
        helpers.click_or_select(location, **kwargs)
    elif target == 'state select':
        location = locations.CompanyInformationTab.Selects.edit_company_information_modal_state
        helpers.click_or_select(location, **kwargs)
    elif target == 'zip input':
        location = locations.CompanyInformationTab.Inputs.edit_company_information_modal_zip
        helpers.click_or_type(location, **kwargs)
    elif target == 'fein input':
        location = locations.CompanyInformationTab.Inputs.edit_company_information_modal_fein
        helpers.click_or_type(location, **kwargs)
    elif target == 'phone input':
        location = locations.CompanyInformationTab.Inputs.edit_company_information_modal_phone
        helpers.click_or_type(location, **kwargs)
    elif target == 'fax input':
        location = locations.CompanyInformationTab.Inputs.edit_company_information_modal_fax
        helpers.click_or_type(location, **kwargs)
    elif target == 'corporate email input':
        location = locations.CompanyInformationTab.Inputs.edit_company_information_modal_corporate_email
        helpers.click_or_type(location, **kwargs)
    elif target == 'notification emails input':
        location = locations.CompanyInformationTab.Inputs.edit_company_information_modal_notification_emails
        helpers.click_or_type(location, **kwargs)
    elif target == 'account lead select':
        location = locations.CompanyInformationTab.Selects.edit_company_information_modal_account_lead
        helpers.click_or_select(location, **kwargs)
    elif target == 'equipment description input':
        location = locations.CompanyInformationTab.Inputs.edit_company_information_modal_equipment_description
        helpers.click_or_type(location, **kwargs)
    elif target == 'default bucket select':
        location = locations.CompanyInformationTab.Selects.edit_company_information_modal_default_bucket
        helpers.click_or_select(location, **kwargs)
    elif target == 'generated customer number prefix input':
        location = locations\
            .CompanyInformationTab.Inputs.edit_company_information_modal_generated_customer_number_prefix
        helpers.click_or_type(location, **kwargs)
    elif target == 'typeahead minimum search length select':
        location = locations\
            .CompanyInformationTab.Selects.edit_company_information_modal_typeahead_minimum_search_length
        helpers.click_or_select(location, **kwargs)
    elif target == 'affidavit expiration select':
        location = locations.CompanyInformationTab.Selects.edit_company_information_modal_affidavit_expiration
        helpers.click_or_select(location, **kwargs)
    elif target == 'update company information button':
        location = locations.CompanyInformationTab.Buttons.edit_company_information_modal_update_company_information
        helpers.click_helper(location)
    elif target == 'cancel button':
        location = locations.CompanyInformationTab.Buttons.edit_company_information_modal_cancel
        helpers.click_helper(location)
    elif target == 'close button':
        location = locations.CompanyInformationTab.Buttons.edit_company_information_modal_close
        helpers.click_helper(location)
    else:
        print(warn.INVALID_CLICK_TARGET)
Beispiel #25
0
def edit_campaign_click(target_name, **kwargs):
    """

    :rtype: object
    """
    target = target_name.lower()

    if target == 'send date input':
        location = locations.EditCampaign.Inputs.send_date
        helpers.click_or_type_date(location, **kwargs)
    elif target == 'requested return date input':
        location = locations.EditCampaign.Inputs.requested_return_date
        # Clear field if date is auto-generated; Maybe this should be in a helper?
        driver.find_element_by_xpath(location).clear()
        helpers.click_or_type_date(location, **kwargs)
    elif target == 'generate date input':
        location = locations.EditCampaign.Inputs.generate_date
        helpers.click_or_type_date(location, **kwargs)
    elif target == 'include most recent invalid input':
        location = locations.EditCampaign.Inputs.include_most_recent
        helpers.click_or_type(location, **kwargs)
    elif target == 'cover letter only input':
        location = locations.EditCampaign.Inputs.cover_letter_only
        helpers.click_or_type(location, **kwargs)
    elif target == 'include certexpress access input':
        location = locations.EditCampaign.Inputs.include_certexpress_access
        helpers.click_or_type(location, **kwargs)
    elif target == 'automatically send round input':
        location = locations.EditCampaign.Inputs.automatically_send_round
        helpers.click_or_type(location, **kwargs)
    elif target == 'notes input':
        location = locations.EditCampaign.Inputs.notes
        helpers.click_or_type(location, **kwargs)
    elif target == 'method select':
        location = locations.EditCampaign.Selects.method
        helpers.click_or_select(location, **kwargs)
    elif target == 'email template cover letter select':
        location = locations.EditCampaign.Selects.email_template_cover_letter
        helpers.click_or_select(location, **kwargs)
    elif target == 'overview link':
        helpers.click_helper(locations.EditCampaign.Links.overview)
    elif target == 'add round link':
        helpers.click_helper(locations.EditCampaign.Links.add_round)
    elif target == 'scheduling and delivery link':
        helpers.click_helper(
            locations.EditCampaign.Links.scheduling_and_delivery)
    elif target == 'select customers link':
        helpers.click_helper(locations.EditCampaign.Links.select_customers)
    elif target == 'preview link':
        helpers.click_helper(locations.EditCampaign.Links.preview)
    elif target == 'print link':
        helpers.click_helper(locations.EditCampaign.Links.print)
    elif target == 'send emails link':
        helpers.click_helper(locations.EditCampaign.Links.send_emails)
    elif target == 'clone round link':
        helpers.click_helper(locations.EditCampaign.Links.clone_round)
    elif target == 'delete round link':
        helpers.click_helper(locations.EditCampaign.Links.delete_round)
    elif target == 'customer number header link':
        helpers.click_helper(
            locations.EditCampaign.Links.customer_number_header)
    elif target == 'name header link':
        helpers.click_helper(locations.EditCampaign.Links.name_header)
    elif target[0:5] == 'round' and target[-4:] == 'link':
        if target[7] == ' ':
            number = target[6]  # Supports single digits
            helpers.click_helper(locations.EditCampaign.Links.round(number))
        elif target[8] == ' ':
            number = target[6:8]  # Supports double digits
            helpers.click_helper(locations.EditCampaign.Links.round(number))
        else:
            print(warn.SOME_PROBLEM)
    elif target == 'delete campaign button':
        helpers.click_helper(locations.EditCampaign.Buttons.delete_campaign)
    elif target == 'save campaign changes button':
        helpers.click_helper(
            locations.EditCampaign.Buttons.save_campaign_changes)
        time.sleep(2)
    elif target == 'send compliance document requests button':
        driver.find_element_by_xpath(
            locations.EditCampaign.Buttons.send_compliance_document_requests
        ).click()
        time.sleep(2)
        Alert(driver).accept()
    elif target == 'export overview data button':
        helpers.click_helper(
            locations.EditCampaign.Buttons.export_overview_data)
    elif target == 'first button':
        helpers.click_helper(locations.EditCampaign.Buttons.first)
    elif target == 'prev button':
        helpers.click_helper(locations.EditCampaign.Buttons.prev)
    elif target == 'page selector select':
        location = locations.EditCampaign.Selects.page_selector
        helpers.click_or_select(location, **kwargs)
    elif target == 'next button':
        helpers.click_helper(locations.EditCampaign.Buttons.next)
    elif target == 'last button':
        helpers.click_helper(locations.EditCampaign.Buttons.last)
    elif target == 'pdf - 1 merged file input':
        helpers.click_helper(locations.EditCampaign.Inputs.merged_file)
    elif target == 'zip - individual pdfs input':
        helpers.click_helper(locations.EditCampaign.Inputs.zip_individual)
    elif target == 'zip - merged pdf by page count input':
        helpers.click_helper(locations.EditCampaign.Inputs.zip_merged)
    elif target == 'create printable file button':
        helpers.click_helper(
            locations.EditCampaign.Buttons.create_printable_file)
    else:
        print(warn.INVALID_CLICK_TARGET)
Beispiel #26
0
def create_new_customer_and_certificate_click(target_name, **kwargs):
    target = target_name.lower()

    if target == 'name of business input':
        location = locations.CreateNewCustomerAndDocumentModal.Inputs.name_of_business
        helpers.click_or_type(location, **kwargs)
    elif target == 'contact email input':
        location = locations.CreateNewCustomerAndDocumentModal.Inputs.contact_email
        helpers.click_or_type(location, **kwargs)
    elif target == 'business phone input':
        location = locations.CreateNewCustomerAndDocumentModal.Inputs.business_phone
        helpers.click_or_type(location, **kwargs)
    elif target == 'address line 1 input':
        location = locations.CreateNewCustomerAndDocumentModal.Inputs.address_line_1
        helpers.click_or_type(location, **kwargs)
    elif target == 'address line 2 input':
        location = locations.CreateNewCustomerAndDocumentModal.Inputs.address_line_2
        helpers.click_or_type(location, **kwargs)
    elif target == 'business city input':
        location = locations.CreateNewCustomerAndDocumentModal.Inputs.business_city
        helpers.click_or_type(location, **kwargs)
    elif target == 'business zip code input':
        location = locations.CreateNewCustomerAndDocumentModal.Inputs.business_zip_code
        helpers.click_or_type(location, **kwargs)
    elif target == 'contact name input':
        location = locations.CreateNewCustomerAndDocumentModal.Inputs.contact_name
        helpers.click_or_type(location, **kwargs)
    elif target == 'business country select':
        location = locations.CreateNewCustomerAndDocumentModal.Selects.business_country
        helpers.click_or_select(location, **kwargs)
    elif target == 'business state select':
        location = locations.CreateNewCustomerAndDocumentModal.Selects.business_state
        helpers.click_or_select(location, **kwargs)
    elif target == 'close button':
        location = locations.CreateNewCustomerAndDocumentModal.Buttons.close
        helpers.click_helper(location)
    elif target == 'next button':
        location = locations.CreateNewCustomerAndDocumentModal.Buttons.next
        helpers.click_helper(location)
    elif target == 'cancel button':
        location = locations.CreateNewCustomerAndDocumentModal.Buttons.cancel
        helpers.click_helper(location)
    else:
        print(warn.INVALID_CLICK_TARGET)