def input_ari_content(self, content):
     # iframe切换
     DriverUtils.get_mp_driver().switch_to.frame(
         self.pub_ari_page.find_cont_iframe())
     self.input_text(self.pub_ari_page.find_ari_content(), content)
     # 返回默认页面
     DriverUtils.get_mp_driver().switch_to.default_content()
 def input_ari_content(self, context):
     DriverUtils.get_mp_driver().switch_to.frame(
         self.pub_ari_page.find_ari_iframe())
     # 输入文章内容
     self.input_text(self.pub_ari_page.find_ari_context(), context)
     # 返回默认界面
     DriverUtils.get_mp_driver().switch_to.default_content()
示例#3
0
 def check_ari_channel(self, channel_name):
     # # 点击频道框
     # self.pub_ari_page.find_channel().click()
     # # # 发表点击
     # # self.pub_ari_page.find_channel_option().click()
     # # 获取所有选项的列表
     # channel_option = DriverUtils.get_mp_driver().find_elements_by_css_selector(
     #     ".el-select-dropdown__item span")
     # is_suc = False
     # # 遍历所获取的频道名称
     # for option in channel_option:
     #     # 判断当前遍历的元素文本信息是否等于所想要的频道名称
     #     if option.text == channel_name:
     #         # 如果相等则点击 跳出 吧默认标识改成True
     #         option.click()
     #         is_suc = True
     #         break
     #     # 不相等则 鼠标悬浮到当前遍历的元素对象上并按下向下的按钮
     #     else:
     #         # 创建鼠标对象
     #         action = ActionChains(DriverUtils.get_mp_driver()
     #         action.move_to_element(option).send_keys(Keys.DOWN).perform()
     # # 判断标识是否为False,则掏出没找到对应频道的选项
     # if is_suc is False:
     #     NoSuchElementException(f"找不到名称为{channel_name}的频道")
     channel_option = DriverUtils.get_mp_driver(
     ).find_elements_by_css_selector(".el-select-dropdown__item span")
     not_select_check(DriverUtils.get_mp_driver(),
                      self.pub_ari_page.find_channel(), channel_option,
                      channel_name)
示例#4
0
 def to_ari_iframe(self, content):
     # 1. iframe切换
     DriverUtils.get_mp_driver().switch_to.frame(
         self.pub_ari_page.find_ari_iframe())
     # 2. 输入文字的内容
     self.input_text(self.pub_ari_page.find_ari_content(), content)
     # 3. 返回默认界面
     DriverUtils.get_mp_driver().switch_to.default_content()
示例#5
0
 def input_ari_content(self, context):
     # iframe切换
     DriverUtils.get_mp_driver().switch_to.frame(
         self.pub_ari_page.find_ari_iframe())
     # 输入文章内容
     self.pub_ari_page.find_ari_context().send_keys(context)
     # 切换回默认页面
     DriverUtils.get_mp_driver().switch_to.default_content()
示例#6
0
 def setup_class(self):
     # 1.打开浏览器
     self.driver = DriverUtils.get_mp_driver()
     # 创建首页业务层的对象
     self.home_proxy = HomeProxy()
     # 创建发布文章业务层的对象
     self.pub_ari_proxy = PubAriProxy()
示例#7
0
 def setup_class(self):
     # 获取驱动的对象
     self.driver = DriverUtils.get_mp_driver()
     # 创建好所需要调用业务方法所在的类的对象
     self.login_proxy = LoginProxy()
     self.home_proxy = HomeProxy()
     self.pub_proxy = PubAriProxy()
示例#8
0
    def setup_class(self):
        self.driver = DriverUtils.get_mp_driver()
        #登陆
        self.login = LoginProxy()
        self.login.test_login("13911111111", "246810")

        self.home_proxy = HomeProxy()
        self.pub_ari_proxy = PubAriProxy()
示例#9
0
 def test_mp_login(self, username, verity):
     # 输入用户名
     self.login_handle.input_username(username)
     # 输入验证码
     self.login_handle.input_verity(verity)
     #截图
     get_allure_picture(DriverUtils.get_mp_driver())
     # 点击登录按钮
     self.login_handle.click_login_but()
示例#10
0
 def test_pub_article(self, title, context, channel_name):
     # 输入标题内容
     self.pub_ari_handle.input_ari_title(title)
     # 输入内容
     self.pub_ari_handle.input_ari_content(context)
     # 选择封面
     self.pub_ari_handle.check_ari_cover()
     # 选择频道
     self.pub_ari_handle.check_ari_channel(channel_name)
     # 截图
     get_allure_picture(DriverUtils.get_mp_driver())
     # 点击发表按钮
     self.pub_ari_handle.click_pub_btn()
示例#11
0
 def setup_class(self):
     #   2.1 获取驱动都对象
     self.driver = DriverUtils.get_mp_driver()
     #   2.2 创建好所需要调用业务方法所在的类的对象
     self.login_proxy = LoginProxy()
示例#12
0
 def setup_class(self):
     # 获取自媒体端的浏览器驱动对象并且赋给driver的实例属性
     self.driver = DriverUtils.get_mp_driver()
     # 创建业务层对象
     self.login_proxy = LoginPorxy()
示例#13
0
 def __init__(self):
     self.driver = DriverUtils.get_mp_driver()
示例#14
0
 def setup_method(self):
     DriverUtils.get_mp_driver().get("http://ttmp.research.itcast.cn/")
示例#15
0
 def __init__(self):
     # 获取浏览器驱动
     self.driver = DriverUtils.get_mp_driver()
示例#16
0
 def setup_class(self):
     # 获取驱动对象
     self.driver = DriverUtils.get_mp_driver()
     # 创建好所需要的调用业务方法所在的类的对象
     self.login_proxy = LoginProxy()
 def setup_class(self):
     self.driver = DriverUtils.get_mp_driver()
     self.home_proxy = HomePorxy()
     self.pub_proxy = PubPorxy()
 def setup_class(self):
     # 启动浏览器
     self.driver = DriverUtils.get_mp_driver()
     # 创建好对应要调用的业务层对象
     self.home_proxy = HomeProxy()
     self.pub_art_proxy = PubArtProxy()
示例#19
0
 def setup_class(self):
     self.driver = DriverUtils.get_mp_driver()
     self.home_proxy = HomeProxy()
     self.pub_ari_proxy = PubAriProxy()
示例#20
0
 def setup_class(self):
     self.driver = DriverUtils.get_mp_driver()
     self.login_proxy = LoginProxy()
示例#21
0
 def __init__(self):
     # 获取自媒体端的浏览器驱动对象
     self.driver = DriverUtils.get_mp_driver()
示例#22
0
 def input_article_content(self, content):
     DriverUtils.get_mp_driver().switch_to.frame(
         self.pub_article_page.find_frame_ele())
     self.input_text(self.pub_article_page.find_article_content(), content)
     DriverUtils.get_mp_driver().switch_to.default_content()
 def setup_class(self):
     # 打开浏览器
     self.driver = DriverUtils.get_mp_driver()
     # 创建所需要页面的业务层的对象
     self.home_proxy = HomePorxy()
     self.pub_proxy = PubProxy()
示例#24
0
 def click_choose_channel(self, channel_name):
     check_channel_option(DriverUtils.get_mp_driver(), "请选择", channel_name)
 def check_ari_channel(self, channel_name):
     # 调用工具类中的公用下拉框选择方法
     check_channel_option(DriverUtils.get_mp_driver(), "请选择", channel_name)
示例#26
0
 def check_target_channel(self, option_name):
     select_option(DriverUtils.get_mp_driver(), "请选择", option_name)
示例#27
0
 def setup_class(self):
     # 启动浏览器
     self.driver = DriverUtils.get_mp_driver()
     # 创建好对应要调用的业务层对象
     self.login_proxy = LoginProxy()
示例#28
0
 def setup_class(self):
     # 2.1 实例化浏览器驱动对象
     self.driver = DriverUtils.get_mp_driver()
     # 2.2 实例化需调用的业务方法所在类的对象
     self.home_proxy = HomeProxy()
     self.pub_ari_proxy = PubAriProxy()
 def __init__(self):
     self.pub_page = PubAriPage()
     self.driver = DriverUtils.get_mp_driver()
示例#30
0
 def __init__(self):
     self.pub_page = PulPage()
     # 因为切换iframe需要使用到driver,所以要实例化浏览器驱动对象
     self.driver = DriverUtils.get_mp_driver()