zoukankan      html  css  js  c++  java
  • Web自动化测试—PO设计模式(三)

    test_case目录下面放你要执行的用例

    目录结构

    ui_auto_test
        --src
            --test_case
                --__init.py
                --test_login_case
            --pages
                --__init.py
                --base_page.py
                --login_page.py
                --work_table_page.py
    

    test_login_case.py

    # conding:utf8
    
    import unittest
    import os, sys
    
    #获取项目顶级文件夹绝对路径
    src_path = os.path.split(os.path.split(__file__)[0])[0]
    
    sys.path.insert(0, src_path)
    from pages.login_page import LoginAction
    from selenium import webdriver
    
    
    class LoginCase(unittest.TestCase):
    
        def setUp(self):
            self.driver = webdriver.Chrome()
    
        def test_login_success(self):
            login_page = LoginAction(self.driver, path='cloud_logins/login')
            username = 'xxxxxx'
            password = 'xxxxxx'
            home_page = login_page.login_action(username, password)
            text = home_page.get_undo_word_text()
            print(text)
            self.assertEqual('我的待办', text)
    
        def tearDown(self):
            self.driver.quit()
    
    
    if __name__ == '__main__':
        unittest.main()
    
    
  • 相关阅读:
    树的同构
    最大子列和
    多项式的表示和运算
    图1
    集合及运算
    树4
    树3
    树2
    期末作业验收
    个人总结
  • 原文地址:https://www.cnblogs.com/snailrunning/p/9226726.html
Copyright © 2011-2022 走看看