Exemplo n.º 1
0
def init_add_ad():
    """
    新增广告
    :return:
    """
    af = ApiFunction()
    af.api_add_ad(apd.api_ad_del_name)
    yield
Exemplo n.º 2
0
def non_tax_page3():
    """
    删除非税局前置条件
    :return:
    """
    af = ApiFunction()
    agent_name, agent_id = af.api_add_tax_manage()

    driver = webdriver.Chrome()
    driver.get(cd.login_boss_url)
    driver.maximize_window()
    lp = LoginPage(driver)
    lp.boss_login(cd.boss_user["user"], cd.boss_user["pwd"])
    hp = HomePage(driver)
    hp.click_element(hl.non_tax_menu, "点击非税局管理菜单")
    np = NonTaxManagePage(driver)

    yield np, agent_name

    driver.quit()
Exemplo n.º 3
0
def init_add_ad_manage():
    """
    广告管理
    前置:新增广告
    后置:删除广告
    :return:
    """
    af = ApiFunction()
    af.api_add_ad(apd.api_ad_name)
    mysql = MySql(cf.get_value("db_msg", "user1"),
                  cf.get_value("db_msg", "pwd1"),
                  cf.get_value("db_msg", "database1"))
    result = mysql.run_sql(apd.sql1)
    ad_id = result["id"]

    yield ad_id,

    af = ApiFunction()
    af.api_del_ad(ad_id)
Exemplo n.º 4
0
def init_gui_manage():
    """
    指引模块前置后置
    :return:
    """
    af = ApiFunction()
    gui_module_id, gui_module_name, gui_module_sort = af.api_add_gui_module()
    af.api_add_gui_item(gui_module_id)

    driver = webdriver.Chrome()
    driver.get(cd.login_boss_url)
    driver.maximize_window()
    lp = LoginPage(driver)
    lp.boss_login(cd.boss_user["user"], cd.boss_user["pwd"])
    hp = HomePage(driver)
    hp.click_element(hl.gui_menu, "点击指引管理菜单")
    sm = ShowManagePage(driver)

    yield sm, gui_module_id, gui_module_name, gui_module_sort

    af = ApiFunction()
    af.api_del_gui_module(gui_module_id, gui_module_sort)
    driver.quit()