self.publish_page.find_publish_btn().click() # 定义业务层 class PublishProxy: def __init__(self): self.publish_handle = PublishHandle() # 发布文章 def publish_article(self, title, content, channel): # 输入文章标题 self.publish_handle.input_title(title) self.publish_handle.input_content(content) self.publish_handle.choice_cover() self.publish_handle.choice_channel(channel) self.publish_handle.click_publish_btn() if __name__ == '__main__': loginProxy = LoginProxy() loginProxy.login("13911111111", '246810') time.sleep(3) homeProxy = HomeProxy() print('hello:', homeProxy.get_username_msg()) homeProxy.go_publish_page() publishProxy = PublishProxy() publishProxy.publish_article("titleAAA", 'contentAAA', "ios") time.sleep(3) UtilsDriver.quit_mp_driver()
def teardown_class(self): UtilsDriver.quit_mp_driver()