Пример #1
0
    def test_pub_artical(self, ar_cont, ch_name):

        # 定义测试数据
        ar_title = PUB_ARTICAL_TITLE
        # ar_content = "我要去找工作"
        # option_name = "数码产品"
        logging.info("发布文章信息为文章标题={}, 文章内容={}, 文章频道={}".format(
            ar_title, ar_cont, ch_name))
        # 调用业务层方法
        logging.info("------>调用首页进入发布文章的业务方法")
        self.home_proxy.to_pub_pg()
        logging.info("------>调用发布文章页面发布文章的业务方法")
        # self.pub_ar_proxy.test_pup_artical(ar_title, ar_content, option_name)
        self.pub_ar_proxy.test_pup_artical(ar_title, ar_cont, ch_name)
        # 执行断言
        is_exists_element(self.driver, "新增文章成功")
Пример #2
0
    def test_login(self):
        username = "******"
        password = "******"

        self.login_proxy.test_mis_login(username, password)

        assert is_exists_element(self.driver, "管理员")
Пример #3
0
 def test_mp_login(self):
     # a.定义测试数据
     phone_num = "13911111111"
     code = "246810"
     # b.调用业务层已经封装好的业务方法
     self.login_proxy.test_login(phone_num, code)
     # c.对测试结果进行断言
     assert is_exists_element(self.driver, "传智播客")
Пример #4
0
 def test_aduit_aritcal(self):
     # 定义测试数据
     ari_title = PUB_ARTICAL_TITLE
     # 执行测试步骤
     self.home_proxy.to_aduit_page()
     self.aduit_proxy.test_aduit_ari(ari_title)
     # 断言
     assert is_exists_element(self.driver, PUB_ARTICAL_TITLE)
Пример #5
0
 def test02_add_chuzi(self):
     logging.info("---------------->设置-标准-添加出资方式")
     # 定义测试数据
     app.chuziname = '测试一下_{}'.format(time.strftime('%d%H%M%S'))
     # 调用业务层方法
     self.set_proxy.add_chuzi(app.chuziname)
     # 断言
     assert is_exists_element(self.driver, '测试一下')
Пример #6
0
 def test01_add_gongcheng(self):
     logging.info("---------------->设置-标准-添加工程类型")
     # 定义测试数据
     app.gongchengname = '测试一下_{}'.format(time.strftime('%d%H%M%S'))
     # 调用业务层方法
     self.set_proxy.add_gongcheng(app.gongchengname)
     # 断言
     assert is_exists_element(self.driver, '测试一下')
Пример #7
0
 def test_mis_login(self):
     # 定义测试数据
     username = "******"
     password = "******"
     # 执行测试用例步骤
     self.login_proxy.test_mis_login(username, password)
     # 断言
     assert is_exists_element(self.driver, "管理员")
Пример #8
0
    def test_audit_artical(self):
        # 定义测试数据
        art_title = PUB_ARTICAL_TITLE
        # 执行测试步骤
        self.home_proxy.to_audit_page()
        self.audit_proxy.test_audit_art(art_title)

        # 断言
        assert is_exists_element(self.driver,art_title)
Пример #9
0
 def test_pub_artical(self):
     # 定义测试数据
     ari_title = "testCase_{}".format(time.strftime("%d%H%M%S"))
     ari_content = "我要出去找工作,找个好工作,月薪8W8,迎娶白富美!!!"
     option_name = "授课专用"
     # 调用业务层方法
     self.home_proxy.to_pub_ar_pg()
     self.pub_ari_proxy.test_pub_aritcal(ari_title, ari_content,
                                         option_name)
     # 执行断言
     assert is_exists_element(self.driver, "新增文章成功")
Пример #10
0
 def test_01_login(self, username, code, message, title, content, zhuanti):
     self.title_name = title + self.titles
     try:
         # 登陆
         Page.get_login_page().mp_login_login(username, code)
         # 断言
         is_exists_element(message)
         # 存入日志
         logging.info("---------------->登陆成功")
         # 点击内容管理和发布文章
         Page.get_home_page().mp_home_ca()
         # 确认发布文章内容
         Page.get_pusair_page().mp_pusair_contant(self.title_name, content,
                                                  self.driver, zhuanti)
         logging.info("---------------->发布成功")
     except Exception:
         print("操作失败,请查看页面是否有问题")
         # 错误截图
         DriverUtils().screen_image()
         raise
     config.TITLE = self.title_name
     print(config.TITLE)
Пример #11
0
 def test_pub_artical(self, ar_cont, ch_name):
     # 定义测试数据
     ari_title = PUB_ARTICAL_TITLE
     ari_content = ar_cont
     option_name = ch_name
     logging.info("发布文章信息为文章标题={},文章内容={},文章频道={}".format(
         ari_title, ar_cont, ch_name))
     # 调用业务层方法
     logging.info("----->调用首页进入发布文章的业务方法")
     self.home_proxy.to_pub_ar_pg()
     logging.info("----->调用发布文章页面发布文章的业务方法")
     self.pub_ari_proxy.test_pub_aritcal(ari_title, ari_content,
                                         option_name)
     # 执行断言
     assert is_exists_element(self.driver, "新增文章成功")
Пример #12
0
    def test_mp_pub_art(self, art_content, channel_name):

        # a.定义测试数据
        art_title = PUB_ARTICAL_TITLE
        art_content = art_content
        option_name = channel_name

        logging.info("发布文章信息为:文章标题={},文章内容={},文章频道={}".format(
            art_title, art_content, channel_name))

        # b.调用业务层已经封装好的业务方法
        self.home_proxy.to_pub_artical_page()
        self.pub_art_proxy.test_pub_artical(art_title, art_content,
                                            option_name)
        # c 对测试结果进行断言
        assert is_exists_element(self.driver, "新增文章成功")
Пример #13
0
 def test03_add_guanlian(self):
     logging.info("---------------->设置-标准-添加关联设置")
     # 调用业务层方法
     self.set_proxy.add_guanlian()
     # 断言
     assert is_exists_element(self.driver, f'{app.gongchengname}')