def test_login(self, phone, code, exp): """自媒体登陆""" logging.info("自媒体登录输入数据,phone:{} - code:{} - exp:{}".format( phone, code, exp)) # 登录 Page.get_mp_login().login(phone, code) # 断言 assert Page.get_mp_home().page_exits_text(exp)
from Base.page import Page import time from Base.driver import Driver Page.get_mp_login().login('13911111111', '246810') print(Page.get_mp_home().get_company_name()) Page.get_mp_home().content_manage() Page.get_mp_home().publish_article() Page.get_mp_publish().publish_article('asdasd', 'sdasdsada', 'python') time.sleep(2) Driver.quit_mp_driver()
def test_login(self, phone, code, exp): Page.get_mp_login().login(phone, code) assert Page.get_mp_login().page_exists_text(exp)
from Base.page import Page # 登录 Page.get_mp_login().login("13911111111", "246810") # 进入发表文章 Page.get_mp_home().click_publish_article() # 发布文章 Page.get_publish_article().publish_article("嘻嘻哈哈1", "哈哈哈哈啊", "设计")