示例#1
0
def fill_in_condition(driver):

    condition = data.rfq_pn_condition_id
    conditionval = data.rfq_pn_condition

    conditionval = "//li[contains(., 'NE')]"
    # additional.wait_element(driver, condition, 'id')
    driver.find_element(By.ID, condition).click()

    additional.wait_element(driver, conditionval, 'xpath')
    length = len(driver.find_elements(By.XPATH, conditionval))
    driver.find_elements(By.XPATH, conditionval)[length - 1].click()
    assert additional.get_property_value(driver, condition, "id") == "NE", "Wrong Min.Vendor Order Value!"
示例#2
0
def select_exchange_type(driver):
    value = data.rfq_pn_salestype_id
    text = data.rfq_exchange
    time.sleep(1)

    # additional.wait_element(driver, value, 'id')
    driver.find_element(By.ID, value).click()

    additional.wait_element(driver, text, 'xpath')
    length = len(driver.find_elements(By.XPATH, text))
    driver.find_elements(By.XPATH, text)[length - 1].click()

    # additional.change_sales_type(driver, value, text)
    # additional.wait_element(driver, data.ex_fee_cost_id, 'id')
    assert additional.get_property_value(driver, value, "id") == "Exchange", "Wrong Sales Type Value!"
示例#3
0
def fill_in_exchange_service_price(driver):
    value = data.ex_service_price_id
    text = '15'
    additional.fill_text_field(driver, value, text)
    driver.find_element(By.ID, value).send_keys(Keys.ENTER)
    assert additional.get_property_value(driver, value, "id") == text + ".0000", "Wrong Service Price Value!"
    # assert additional.get_property_value(driver, data.ex_mgm_id, "id") == "45.00", "MGM Value recalculated incorrectly!!"
    assert float(additional.get_property_value(driver, data.ex_mgm_id, "id")) == round(float(additional.get_property_value(driver, data.ex_total_price_id, "id")) - float(
        additional.get_property_value(driver, data.ex_cost_total_id, "id")), 4), "MGM Value recalculated incorrectly!!"
    # assert additional.get_property_value(driver, data.ex_mgm_percent_id, "id") == "50.00", "MGM Price Value recalculated incorrectly!!"
    assert float(additional.get_property_value(driver, data.ex_mgm_percent_id, "id")) == round(
        (float(additional.get_property_value(driver, data.ex_total_price_id, "id")) - float(
            additional.get_property_value(driver, data.ex_cost_total_id, "id"))) / float(
            additional.get_property_value(driver, data.ex_cost_total_id, "id")) * 100,
        2), "MGM Percent Value recalculated incorrectly!!"
示例#4
0
def fill_in_avg_repair_cost(driver):
    value = data.repair_avg_repair_cost_id
    text = '25'
    additional.fill_text_field(driver, value, text)
    driver.find_element(By.ID, value).send_keys(Keys.ENTER)
    assert additional.get_property_value(driver, value, "id") == text, "Wrong Avg Repair Cost Value!"
    assert float(additional.get_property_value(driver, data.repair_avg_repair_price_id, "id")) == \
           round(float(additional.get_property_value(driver, value, "id")) / float(
               additional.get_property_value(driver, data.rfq_pn_rate_id, "id")), 4), \
        "Avg Repair price value recalculated incorrectly!!"
    # assert additional.get_property_value(driver, data.repair_mgm_id, "id") == "-1.85", "MGM Value recalculated incorrectly!!"
    assert float(additional.get_property_value(driver, data.repair_mgm_id, "id")) == round(
        float(additional.get_property_value(driver, data.repair_b_check_price_id, "id")) - float(
            additional.get_property_value(driver, data.repair_b_check_cost_id, "id")),2), \
        "MGM Value recalculated incorrectly!!"
示例#5
0
def fill_in_contact_field(driver):

    element_id = data.rfq_search_contact_id
    time.sleep(3)

    additional.wait_element(driver, element_id, 'id')
    driver.find_element(By.ID, element_id).click()

    elem = driver.find_element(By.ID, data.rfq_search_value_id)
    text = "Autotest"
    additional.wait_element(driver, data.rfq_search_value_id, 'id')
    driver.find_element(By.ID, data.rfq_search_value_id).click()
    elem.send_keys(Keys.CONTROL + "a")
    elem.send_keys(Keys.DELETE)
    elem.send_keys(text)
    elem.send_keys(Keys.ENTER)

    time.sleep(3)
    additional.wait_element(driver, data.rfq_contact_first_field, 'xpath')
    driver.find_element(By.XPATH, data.rfq_contact_first_field).click()
    assert additional.get_property_value(driver, data.rfq_contact_id, "id") == 'Autotest User', "Wrong Contact Value!"
示例#6
0
def fill_in_exchange_ber_price(driver):
    value = data.ex_ber_price_id
    text = '3'
    additional.fill_text_field(driver, value, text)
    assert additional.get_property_value(driver, value, "id") == text, "Wrong Ber Price Value!"
示例#7
0
def fill_in_exchange_delivery_time(driver):
    value = data.ex_delivery_time_id
    text = '7'
    additional.fill_text_field(driver, value, text)
    assert additional.get_property_value(driver, value, "id") == text, "Wrong Delivery Time Value!"
示例#8
0
def fill_in_exchange_cust_rtrn_days(driver):
    value = data.ex_cust_rtrn_price_id
    text = '8'
    additional.fill_text_field(driver, value, text)
    assert additional.get_property_value(driver, value, "id") == text, "Wrong Cust RTRN Price Value!"
示例#9
0
def fill_in_min_vendor_order(driver):
    value = data.stock_out_min_vendor_order_id
    text = "1"
    additional.fill_text_field(driver, value, text)
    assert additional.get_property_value(driver, value, "id") == text, "Wrong Min.Vendor Order Value!"
示例#10
0
def fill_in_repair_delivery_time(driver):
    value = data.repair_delivery_time_id
    text = '14'
    additional.fill_text_field(driver, value, text)
    assert additional.get_property_value(driver, value, "id") == text, "Wrong Repair Delivery Time Value!"
示例#11
0
def fill_in_lead_time(driver):
    value = data.stock_out_lead_time_id
    text = "7"
    additional.fill_text_field(driver, value, text)
    assert additional.get_property_value(driver, value, "id") == text,  "Wrong Stock Out Lead Time Value!"
示例#12
0
def fill_in_repair_bcheck_price(driver):
    value = data.repair_b_check_price_id
    text = '12'
    additional.fill_text_field(driver, value, text)
    assert additional.get_property_value(driver, value, "id") == text, "Wrong Repair B-Check Price Value!"
示例#13
0
def fill_in_stock_outright_delivery_time(driver):
    value = data.stock_out_delivery_time_id
    text = '14'
    additional.fill_text_field(driver, value, text)
    assert additional.get_property_value(driver, value, "id") == text, "Wrong Delivery Time Value!"
示例#14
0
def fill_pn_qty(driver):
    value = data.partnumber_qty_id
    text = "10"
    additional.fill_pn_fields(driver, value, text)
    assert additional.get_property_value(driver, value, "id") == text, "Wrong PN Qty Value!"
示例#15
0
def fill_in_repair_lead_time(driver):
    value = data.repair_lead_time_id
    text = '7'
    additional.fill_text_field(driver, value, text)
    assert additional.get_property_value(driver, value, "id") == text, "Wrong Repair Lead Time Value!"
    assert additional.get_property_value(driver, data.repair_delivery_time_id, "id") == text, "Repair Delivery Time value recalculated incorrectly!"
示例#16
0
def fill_in_pli_rate(driver):
    field = data.rfq_pn_rate_id
    text = "0.25"
    additional.fill_text_field(driver, field, text)
    assert additional.get_property_value(driver, field, "id") == text, "Wrong Rate Value!"
示例#17
0
def fill_in_pli_location(driver):
    field = data.rfq_pn_location_id
    text = "Test Location"
    additional.fill_text_field(driver, field, text)
    assert additional.get_property_value(driver, field, "id") == text, "Wrong Location Value!"
示例#18
0
def fill_in_pli_aval_qty(driver):
    field = data.rfq_qty_avail_id
    text = "10"
    additional.fill_text_field(driver, field, text)
    assert additional.get_property_value(driver, field, "id") == text, "Wrong Qty Aval Value!"
示例#19
0
def fill_in_repair_lead_b_check(driver):
    value = data.repair_lead_b_check_id
    text = '14'
    additional.fill_text_field(driver, value, text)
    assert additional.get_property_value(driver, value, "id") == text, "Wrong Repair Lead B Check Value!"
    assert additional.get_property_value(driver, data.repair_delivery_b_check_id, "id") == text, "Delivery b-check value recalculated incorrectly!"
示例#20
0
def fill_in_avg_repair_price(driver):
    value = data.repair_avg_repair_price_id
    text = '7'
    additional.fill_text_field(driver, value, text)
    driver.find_element(By.ID, value).send_keys(Keys.ENTER)
    assert additional.get_property_value(driver, value, "id") == text + ".0000", "Wrong Avg Repair Price Value!"
    # assert additional.get_property_value(driver, data.repair_b_check_price_id, "id") == "7.0028", "Repair B-Check Price Value recalculated incorrectly!"
    assert float(additional.get_property_value(driver, data.repair_b_check_price_id, "id")) == round(
        float(additional.get_property_value(driver, data.repair_b_check_cost_id, "id")) / float(
            additional.get_property_value(driver, data.rfq_pn_rate_id, "id")), 4), \
        "Repair B-Check Price Value recalculated incorrectly!"


    # assert additional.get_property_value(driver, data.repair_max_price_id, "id") == "8.4034", "Repair Max Price Value recalculated incorrectly!"
    assert float(additional.get_property_value(driver, data.repair_max_price_id, "id")) == round(
        float(additional.get_property_value(driver, data.repair_max_cost_id, "id")) / float(
        additional.get_property_value(driver, data.rfq_pn_rate_id, "id")), 4), "Repair Max Price Value recalculated incorrectly!"

    # assert additional.get_property_value(driver, data.repair_mgm_id, "id") == "-18.00", "Repair MGM Value recalculated incorrectly!"

    assert float(additional.get_property_value(driver, data.repair_mgm_id, "id")) == float(
        additional.get_property_value(driver, data.repair_avg_repair_price_id, "id")) - float(
        additional.get_property_value(driver, data.repair_avg_repair_cost_id, "id")), "Repair MGM Value recalculated incorrectly!"

    # assert additional.get_property_value(driver, data.repair_mgm_percent_id, "id") == "-72.00", "Repair MGM Percent Value recalculated incorrectly!"

    assert float(additional.get_property_value(driver, data.repair_mgm_percent_id, "id")) == round(
        (float(additional.get_property_value(driver, data.repair_avg_repair_price_id, "id")) - float(
            additional.get_property_value(driver, data.repair_avg_repair_cost_id, "id")))/ float(
        additional.get_property_value(driver, data.repair_avg_repair_cost_id, "id")) * 100, 2), "Repair MGM Percent Value recalculated incorrectly!"
示例#21
0
def fill_in_exchange_vendor_rtrn_days(driver):
    value = data.ex_vendor_rtrn_days_id
    text = '3'
    additional.fill_text_field(driver, value, text)
    assert additional.get_property_value(driver, value, "id") == text, "Wrong Vendor RTRN Days Value!"
示例#22
0
def fill_in_stock_outright_lead_time(driver):
    value = data.stock_out_lead_time_id
    text = '7'
    additional.fill_text_field(driver, value, text)
    assert additional.get_property_value(driver, value, "id") == text, "Wrong Lead TIme Value!"
示例#23
0
def fill_in_repair_qty(driver):
    value = data.repair_qty_id
    text = '10'
    additional.fill_text_field(driver, value, text)
    assert additional.get_property_value(driver, value, "id") == text, "Wrong Repair Qty Value!"
示例#24
0
def fill_in_exchange_service_cost(driver):
    value = data.ex_service_cost_id
    text = '5'
    additional.fill_text_field(driver, value, text)
    assert additional.get_property_value(driver, value, "id") == text, "Wrong Service Cost Value!"
示例#25
0
def fill_in_repair_delivery_b_check(driver):
    value = data.repair_delivery_b_check_id
    text = '12'
    additional.fill_text_field(driver, value, text)
    assert additional.get_property_value(driver, value, "id") == text, "Wrong Repair Delivery B-Check Value!"
示例#26
0
def fill_in_exchange_lead_time(driver):
    value = data.ex_lead_time_id
    text = "7"
    additional.fill_text_field(driver, value, text)
    assert additional.get_property_value(driver, value, "id") == text, "Wrong Lead Time Value!"
    assert additional.get_property_value(driver, data.ex_delivery_time_id, "id") == text, "Delivery Time Value recalculated incorrectly!"
示例#27
0
def fill_in_max_repair_price(driver):
    value = data.repair_max_price_id
    text = '25'
    additional.fill_text_field(driver, value, text)
    driver.find_element(By.ID, value).send_keys(Keys.ENTER)
    assert additional.get_property_value(driver, value, "id") == text + ".0000", "Wrong Repair Max Price Value!"
示例#28
0
def fill_in_exchange_cost_total(driver):
    value = data.ex_lead_time_id
    text = '9'
    additional.fill_text_field(driver, value, text)
    assert additional.get_property_value(driver, value, "id") == text, "Wrong Lead Time Value!"
示例#29
0
def fill_in_exchange_fee_price(driver):
    value = data.ex_fee_price_id
    text = '12'
    additional.fill_text_field(driver, value, text)
    driver.find_element(By.ID, value).send_keys(Keys.ENTER)
    assert additional.get_property_value(driver, value, "id") == text + ".0000", "Wrong Fee Price Value!"
    # assert additional.get_property_value(driver, data.ex_ber_price_id, "id") == "6.4815", "Ber Price Value recalculated incorrectly!!"
    assert float(additional.get_property_value(driver, data.ex_ber_price_id, "id")) == round(
        float(additional.get_property_value(driver, data.ex_ber_cost_id, "id")) / float(
            additional.get_property_value(driver, data.rfq_pn_rate_id, "id")), 4), "Ber Price Value recalculated incorrectly!!"
    # assert additional.get_property_value(driver, data.ex_service_price_id, "id") == "4.6296", "Service Price Value recalculated incorrectly!!"
    assert float(additional.get_property_value(driver, data.ex_service_price_id, "id")) == round(
        float(additional.get_property_value(driver, data.ex_service_cost_id, "id")) / float(
            additional.get_property_value(driver, data.rfq_pn_rate_id, "id")), 4), "Service Price Value recalculated incorrectly!!"

    assert additional.get_property_value(driver, data.ex_total_price_id, "id") == "83.15", "Total Price Value recalculated incorrectly!!"

    assert float(additional.get_property_value(driver, data.ex_total_price_id, "id")) == \
           round(float((float(additional.get_property_value(driver, data.ex_fee_price_id, "id"))) + (
               float(additional.get_property_value(driver, data.ex_service_price_id, "id")))) * float(
               additional.get_property_value(driver, data.ex_qty_id,
                                             "id")), 2), "MGM Value recalculated incorrectly!!"

    # assert additional.get_property_value(driver, data.ex_mgm_id, "id") == "-6.85", "MGM Value recalculated incorrectly!!"
    float(additional.get_property_value(driver, data.ex_mgm_id, "id")) == round(float(additional.get_property_value(driver, data.ex_total_price_id, "id")) - float(
        additional.get_property_value(driver, data.ex_cost_total_id, "id")), 4), "MGM Value recalculated incorrectly!!"

    # assert additional.get_property_value(driver, data.ex_mgm_percent_id, "id") == "-7.61", "MGM Percent Value recalculated incorrectly!!"
    assert float(additional.get_property_value(driver, data.ex_mgm_percent_id, "id")) == round((float(additional.get_property_value(driver, data.ex_total_price_id, "id")) - float(
    additional.get_property_value(driver, data.ex_cost_total_id, "id"))) / float(
    additional.get_property_value(driver, data.ex_cost_total_id, "id")) * 100, 2), "MGM Percent Value recalculated incorrectly!!"

    # assert additional.get_property_value(driver, data.rfq_pn_rate_id, "id") == "1.08", "Rate Value recalculated incorrectly!!"
    assert float(additional.get_property_value(driver, data.rfq_pn_rate_id, "id")) == round(float(additional.get_property_value(driver, data.ex_fee_cost_id, "id")) /\
           float(additional.get_property_value(driver, data.ex_fee_price_id, "id")), 2), "Rate Value recalculated incorrectly!!"
示例#30
0
def fill_in_qty(driver):
    value = data.stock_out_qty_id
    text = "20"
    additional.fill_text_field(driver, value, text)
    assert additional.get_property_value(driver, value, "id") == text,  "Wrong Delivery Stock Out Qty Value!"