- pip install nose
- pip install nose-allure-plugin
- pip install nose-html-reporting
- pip install nose-ittr
- pip install nosehtmlouput-2
- pip install allure-behave
- pip install allure-python-commons
import unittest import nose from nose.tools import * import logging from page.common.tab_bar_page import TabBarPage from page.video.video_tab_bar_page import VideoTabBarPage from common.common_operate import * class TestVideoTabBar(unittest.TestCase): log = logging.getLogger(__name__) @classmethod def setUpClass(cls): cls.tab_bar = TabBarPage() cls.tab_bar.click_vedio_tab_bar() cls.video_tab_bar = VideoTabBarPage() def setUp(cls): pass # 点击视频文章标题 @nose.allure.feature('视频Tab') @nose.allure.story('点击标题-查看视频文章') def test_01_click_video_title(self): try: self.video_tab_bar.click_video_title(0) assert_true(is_visibility(self.video_tab_bar.video_article_comments_btn_loc)) except TimeoutException as e: take_screenShot(u"点击标题-查看视频文章'") logging.error(e) assert_false(True) # 点击视频预览图 @nose.allure.feature('视频Tab') @nose.allure.story('点击视频预览图-查看视频文章') def test_02_video_preview(self): try: self.video_tab_bar.click_video_preview(0) assert_true(is_visibility(self.video_tab_bar.video_article_list_comments_btn_loc)) except TimeoutException as e: take_screenShot(u"点击视频预览图-查看视频文章'") logging.error(e) assert_false(True) def tearDown(cls): get_press_keycode(4) @classmethod def tearDownClass(cls): time.sleep(3) get_press_keycode(4)@H_502_0@ @H_502_0@这里先贴一下测试用例脚本,后面会介绍自动化项目代码、设计、运行原理等。
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。