Ejemplo n.º 1
0
 def test_publish_article(self, title, content, channel_name, text):
     config.PUB_ARTICLE_TITLE = title.format(time.strftime("%Y%m%d-%H%M%S"))
     print(config.PUB_ARTICLE_TITLE)
     self.home_proxy.home()
     self.pub_article_proxy.publish_article(title, content, channel_name)
     get_allure_screenshot(self.driver, "发布文章截图")
     assert is_element_exist(self.driver, text)
 def test_aduit_pass(self):
     # 定义测试数据
     ari_title = config.PUB_ARITCAL_TITLE
     print(ari_title)
     self.home_page.to_aaritcal_page()
     self.ad_page.test_aduit_pass(ari_title)
     assert is_element_exist(self.driver, "驳回")
Ejemplo n.º 3
0
 def test_mp_login(self):
     # 3.1 定义测试数据
     username = "******"
     code = "246810"
     # 3.2 调用业务方法形成完整业务操作
     self.login_proxy.test_mp_login(username, code)
     # 3.3 断言
     assert is_element_exist(self.driver, "江苏传智播客")
Ejemplo n.º 4
0
 def test_mis_login(self):
     # 定义测试数据
     username = "******"
     password = "******"
     # 调用业务方法
     self.mis_login_proxy.test_mis_login(username, password)
     # 断言
     assert is_element_exist(self.driver, "退出")
 def test_aduit_ari_pass(self):
     ari_title = config.PUB_ARITCAL_TITLE
     # print("审核文章的标题为: ", ari_title)
     logging.info("审核文章的标题为: {}".format(ari_title))
     self.mis_home_page.to_aaritcal_page()
     self.mis_ari_page.test_aduit_pass(ari_title)
     # 断言
     assert is_element_exist(self.driver, "驳回")
 def test_mis_login(self):
     # 2. 定义测试数据
     username = "******"
     password = "******"
     # 3. 调用业务方法
     self.mis_login_proxy.test_mp_login(username, password)
     # 4. 执行断言
     assert is_element_exist(self.driver, '退出')
Ejemplo n.º 7
0
 def test_mp_login(self):
     # 定义测试数据
     username = '******'
     verity = '246810'
     # 调用业务方法形成完整业务操作
     self.login_proxy.test_mp_login(username, verity)
     # 断言
     assert is_element_exist(self.driver, '江苏传智播客')
Ejemplo n.º 8
0
 def test_mis_login(self):
     # 3.1定义测试数据
     username = "******"
     password = "******"
     # 3.2调用业务方法形成完整业务操作
     self.mis_login_proxy.test_mis_login(username, password)
     # 3.3断言 在此断言调用的事utils文件中的is_element_exist公用方法
     assert is_element_exist(self.driver, "退出")
Ejemplo n.º 9
0
 def test_mis_login(self):
     # 2.定义测试数据
     username = "******"
     password = "******"
     # 3.调用业务方法 --- >执行手工测试用例的操作步骤
     self.mis_login_proxy.test_mis_login(username, password)
     # 4.执行断言
     assert is_element_exist(self.driver, "退出")
Ejemplo n.º 10
0
 def test_mp_login(self):
     # 3.1定义测试数据
     username = "******"
     code = "246810"
     # 3.2调用业务方法形成完整业务操作
     # 在此调用的是login_page中的业务层LoginProxy类中的test_mp_login方法
     self.login_proxy.test_mp_login(username, code)
     # 3.3断言 在此断言调用的事utils文件中的is_element_exist公用方法
     assert is_element_exist(self.driver, "江苏传智播客")
Ejemplo n.º 11
0
 def test_aduit_ari_pass(self):
     # 定义测试数据
     ari_title = config.PUB_ARITCAL_TITLE
     # 调用进入审核文章页面的业务方法
     self.home_page.to_aaritcal_page()
     # 调用审核文章的业务方法
     self.ad_page.test_aduit_pass(ari_title)
     # 断言
     assert is_element_exist(self.driver, "驳回")
Ejemplo n.º 12
0
 def test_mp_login(self):
     # 定义测试数据
     mobile = "15811859004"
     code = "246810"
     # 调用登陆的方法
     self.login_proxy.test_mp_login(mobile, code)
     # 执行断言
     is_element = is_element_exist(self.driver, "传智播客")
     assert is_element
Ejemplo n.º 13
0
 def test_aduit_pass(self):
     ari_title = config.PUB_ARITCAL_TITLE
     print("审核文章的标题为:",ari_title)
     # 调用进入审核页面的业务方法
     self.home_page.to_ari_mispage()
     # 调用审核文章的业务方法
     self.ad_page.test_pass(ari_title)
     # 断言
     assert is_element_exist(self.driver, "驳回")
Ejemplo n.º 14
0
 def test_pub_ari(self, ari_title, ari_context, ari_channel, expect):
     # 2.组织测试数据
     config.PubArticleName = ari_title.format(time.strftime("%H%M%S"))
     # 3.执行测试步骤
     self.home_proxy.to_pub_air_tab()
     self.pub_ari_proxy.test_pub_aritcal(config.PubArticleName, ari_context,
                                         ari_channel)
     # 4.结果断言
     assert is_element_exist(self.driver, expect)
 def test_aduit_ari_pass(self):
     # 定义测试数据
     ari_titlt = config.PUB_ARITCAL_TITLE
     print("审核文章的标题为:--》,ari_titlt{}".format(ari_titlt))
     # 调用进入审核文章页面的业务方法
     self.home_page.to_aaritcal_page()
     # 调用审核文章的业务方法
     self.ad_page.test_aduit_pass(ari_titlt)
     # 断言
     assert is_element_exist(self.driver, "驳回")
Ejemplo n.º 16
0
 def test_pub_ari(self, ari_title, ari_context, ari_channel, expect):
     # 2.组织测试数据
     config.PUB_ARITCAL_TITLE = ari_title.format(time.strftime("%H%M%S"))
     # 3.执行测试步骤
     self.home_proxy.to_pub_ari_page()
     self.pub_ari_proxy.test_pub_aritcal(config.PUB_ARITCAL_TITLE, ari_context, ari_channel)
     # 截图
     get_allure_png(self.driver, "发布文章")
     # 4.结果断言
     assert is_element_exist(self.driver, expect)
 def test_pass_article(self):
     # 2.组织测试数据
     title_name = config.PubArticleName
     # 3.执行测试步骤
     # 调用进入审核文章页面的业务方法
     self.mis_home_proxy.to_mis_article()
     # 调用审核文章的业务方法
     self.mis_article_proxy.test_article_pass(title_name)
     # 4.结果断言
     assert is_element_exist(self.driver, "驳回")
Ejemplo n.º 18
0
 def test_mis_login(self):
     # 定义测试数据
     username = "******"
     password = "******"
     # 调用登陆页面业务层登陆方法
     self.mis_login_proxy.test_mis_login(username, password)
     # 3.拿到测试步骤执行完成的后的一个结果,这个结果可以用来判断测试用例是否执行成功
     is_exist = is_element_exist(self.driver, "管理员")
     # 4.断言:拿实际结果和期望结果做对比
     assert is_exist
Ejemplo n.º 19
0
 def test_aduit_ari_pass(self):
     # 定义测试数据
     ari_titlt = config.PUB_ARITCAL_TITLE
     print("审核文章的标题为:------>", ari_titlt)
     # 调用进入审核文章页面的业务方法
     time.sleep(3)
     self.home_page.to_aaritcal_page()
     # 调用审核文章的业务方法
     self.ad_page.test_aduit_pass(ari_titlt)
     # 断言
     assert is_element_exist(self.driver, "驳回")
Ejemplo n.º 20
0
    def test_mis_login(self):
        # 2.定义测试数据
        username = "******"
        password = "******"
        # 3.调用业务方法 --- >执行手工测试用例的操作步骤
        self.mis_login_proxy.test_mis_login(username, password)

        allure.attach(self.driver.get_screenshot_as_png(), '截图',
                      allure.attachment_type.PNG)
        # 4.执行断言
        assert is_element_exist(self.driver, "退出")
Ejemplo n.º 21
0
 def test_pub_ari(self, title_ari, context_ari, channel_ari, expect):
     # 组织测试数据
     config.PUB_ARITCAL_TITLE = title_ari.format(time.strftime("%H%M%S"))
     print(config.PUB_ARITCAL_TITLE)
     # 执行测试步骤
     self.home_proxy.to_pub_ari_page()
     self.pub_ari_proxy.test_pub_artcal(config.PUB_ARITCAL_TITLE,
                                        context_ari, channel_ari)
     get_allure_pne(self.driver, "发布文章")
     # 断言
     assert is_element_exist(self.driver, expect)
Ejemplo n.º 22
0
 def test_pub_ari(self, ari_title, ari_context, ari_channel, expect):
     # 2.组织测试数据
     config.PUB_ARITCAL_TITLE = ari_title.format(time.strftime("%H%M%S"))
     logging.info("文章标题{}:".format(config.PUB_ARITCAL_TITLE))
     # 3.执行测试步骤
     self.home_proxy.to_pub_ari_page()
     self.pub_ari_proxy.test_pub_aritcal(config.PUB_ARITCAL_TITLE,
                                         ari_context, ari_channel)
     # 产生一个截图
     get_allure_png(self.driver, "发布文章")
     # 4.结果断言
     assert is_element_exist(self.driver, expect)
     self.driver.get("http://ttmp.research.itcast.cn/")
Ejemplo n.º 23
0
    def test_publish(self):

        # 数据
        title = "你好呀{}".format(time.strftime("%Y%m%d%H%M%S"))
        aritcle_content = "你好呀{}".format(time.strftime("%Y%m%d%H%M%S"))
        option = "linux"
        select_text = "请选择"

        self.publist_al_proxy.test_publish_aritcle\
            (title,aritcle_content,option,select_text)
        # 断言
        is_element = is_element_exist(self.driver, "新增文章成功")
        assert is_element
Ejemplo n.º 24
0
    def test_mis_login(self):
    # 1.定义测试数据
        username="******"
        password="******"
    # 2.调用测试方法--->执行手工测试的操作步骤
        self.mis_login_proxy.test_mis_login(username,password)
    # 3.执行断言
        assert is_element_exist(self.driver,"退出")

    # 定义类级别销毁方法
    # 5.关闭浏览器
    # def teardown_class(self):
    #     DriverUtils.quit_mis_driver()
Ejemplo n.º 25
0
 def test_mp_pub(self, ari_title, ari_context, ari_channel, expect):
     # 定义测试数据
     # username = "******"
     # code = "246810"
     # # 调用业务方法形成完整业务操作
     # self.login_proxy.test_mp_login(username, code)
     # # 断言
     # assert is_element_exist(self.driver, "江苏传智播客")
     config.PUB_ARITCAL_TITLE = ari_title.format(
         time.strftime("%Y%m%d%H%S%M"))
     self.home_proxy.to_pub_ari_page()
     self.pub_proxy.to_pub_ari_tab(config.PUB_ARITCAL_TITLE, ari_context,
                                   ari_channel)
     assert is_element_exist(self.driver, expect)
Ejemplo n.º 26
0
    def test_ari_publish(self, ari_title, ari_context, ari_channel_name, expect):
        # 3.1 定义测试数据
        # title = "test{}".format(time.strftime("%Y%m%d%H%M%S"))
        # context = "testtesttest测试测试测试"
        # channel_name = '测试开发'
        # 3.2 调用业务方法形成完整的业务
        config.PUB_ARITCAL_TITLE = ari_title.format(time.strftime("%Y%m%d%H%M%S"))
        time.sleep(3)
        self.home_proxy.to_pub_ari_page()
        time.sleep(3)
        self.pub_ari_proxy.test_publish_ari(config.PUB_ARITCAL_TITLE, ari_context, ari_channel_name)

        # 截图
        get_allure_png(self.driver, "发布文章")

        # 断言
        assert is_element_exist(self.driver, expect)
Ejemplo n.º 27
0
 def test_pb_aritcle(self):
     # 2.测试数据
     title = "web自动化技术-{}".format(time.strftime("%Y%m%d%H%M%S"))
     content = "web自动化技术-{}".format(time.strftime("%Y%m%d%H%M%S"))
     channel_option = "数据库"
     select_name = "请选择"
     # 3.执行测试步骤
     # 进入发布文章的页面
     self.index_proxy.to_publish_aritcle_page()
     # 发布文章
     self.pl_proxy.test_publish_aritcle(title=title,
                                        aritcle_content=content,
                                        option=channel_option,
                                        select_text=select_name)
     # 4.拿到测试实际结果并进行断言,如找到对应的元素则返回元素对象,其是一个字符串,断言时非空字符串都为真则通过
     # 如未找到元素则返回的是False,断言则会失败
     is_exist = is_element_exist(self.driver, "新增文章成功")
     assert is_exist
Ejemplo n.º 28
0
 def test_mis_login(self):
     username = "******"
     password = "******"
     self.mis_login_proxy.test_mp_login(username, password)
     assert is_element_exist(self.driver, "退出")
Ejemplo n.º 29
0
 def test_audit_article_pass(self):
     article_title = config.PUB_ARTICLE_TITLE
     logging.info(article_title)
     self.home_page.to_audit_page()
     self.audit_proxy.test_audit_pass(article_title)
     assert is_element_exist(DriverUtils.get_mis_driver(), '驳回')
Ejemplo n.º 30
0
 def test_mis_login(self):
     username = "******"
     password = "******"
     self.login_proxy.test_mis_login(username, password)
     time.sleep(2)
     assert is_element_exist(self.driver, "黑马头条后台管理系统")