Ejemplo n.º 1
0
def do_login(context, username, password):
    context.curent_page = LoginPage(context)
    wait_for_element_show(context.browser, FIND_ELEMENT_METHOD.ID,
                          context.curent_page.username_id)
    context.curent_page.set_base_element()
    context.curent_page.userNameInput.send_keys(username)
    context.curent_page.passwordInput.send_keys(password)
    context.curent_page.button.click()
    wait_ajax_finish(context.browser)
Ejemplo n.º 2
0
def log_in(context):
    loginPage = LoginPage(context)
    wait_for_element_show(context.browser, FIND_ELEMENT_METHOD.ID,
                          loginPage.username_input_id)
    loginPage.set_base_element()
    loginPage.usernameInput.send_keys(
        BASE_CONFIG["SYSTEM_INFO"]["MERCHANT_ACCOUNT"])
    loginPage.passwordInput.send_keys(BASE_CONFIG["SYSTEM_INFO"]["PASSWORD"])
    loginPage.loginBtn.click()
    wait_ajax_finish(context.browser)
    context.current_page = BasePage(context)
    wait_for_element_show(context.browser, FIND_ELEMENT_METHOD.XPATH,
                          context.current_page.user_info_xpath)
Ejemplo n.º 3
0
def check_information(context):
    """
    校验商户管理-->基本信息的页面数据是否正确
    """
    context.left_page = LeftMenuPage(context)
    context.left_page.businessManagementMenu()
    context.left_page.business_management.click()

    context.current_page = BasicInformationPage(context)
    wait_for_element_show(context.browser, FIND_ELEMENT_METHOD.XPATH,
                          context.current_page.basic_information_xpath)

    context.left_page.basic_information.click()

    wait_ajax_finish(context.browser)
Ejemplo n.º 4
0
def select_category_message(context, category_message):
    # 选择所属分类
    context.current_page.category_button.click()  #点击打开所属分类详情页面
    wait_ajax_finish(context.browser)

    category_message_list = category_message.split('|')  #将用例数据转换成数组

    category_count = 1
    for category in category_message_list:
        if category_count <= len(category_message_list):
            context.browser.find_element_by_xpath("//div/a[text()='%s']" %
                                                  category).click()
            category_count = category_count + 1
        else:
            break
    context.current_page.category_confirm_button.click()
Ejemplo n.º 5
0
def select_area_message(context, area_message):

    area_message_list = area_message.split('|')  #将用例数据转换成数组

    context.current_page.select_province.find_element_by_xpath(
        "//option[text()='%s']" % area_message_list[0]).click()
    wait_ajax_finish(context.browser)

    context.current_page.select_city.find_element_by_xpath(
        "//option[text()='%s']" % area_message_list[1]).click()
    wait_ajax_finish(context.browser)

    context.current_page.select_area.find_element_by_xpath(
        "//option[text()='%s']" % area_message_list[2]).click()
    wait_ajax_finish(context.browser)

    context.current_page.location_button.click()  #点击地区定位
    wait_ajax_finish(context.browser)
Ejemplo n.º 6
0
def enter_add_store_page(context):
    # 点击新增按钮,进入新增门店页面
    context.current_page.add_button.click()  #点击门店管理页面中的新增按钮
    wait_ajax_finish(context.browser)
Ejemplo n.º 7
0
def do_logout(context):
    head_page = HeadPage(context)
    wait_ajax_finish(context.browser)
    head_page.set_base_element()
    head_page.logoutbtn.click()
Ejemplo n.º 8
0
def wait_for_page_loading(context):
    wait_ajax_finish(context.browser)
Ejemplo n.º 9
0
def log_out(context):
    wait_ajax_finish(context.browser)
    context.browser.find_element_by_xpath(
        context.current_page.logout_xpath).click()
Ejemplo n.º 10
0
def check_good_in_good_list(context):
    wait_ajax_finish(context.browser)
    pass
Ejemplo n.º 11
0
def click_to_save_good(context):
    wait_ajax_finish(context.browser)
    context.current_page.save_good_btn.click()
Ejemplo n.º 12
0
def check_submit_for_approval(context):
    wait_ajax_finish(context.browser)
    context.current_page.submit_check_box.click()
Ejemplo n.º 13
0
def enter_search_message(context, store_name, address):
    context.current_page.store_name.send_keys(store_name) #输入门店名称
    context.current_page.address.send_keys(address) #输入门店地址
    context.current_page.search_button.click() #点击查询按钮
    wait_ajax_finish(context.browser)