├── Cases ├── __init__.py ├── logincases │ ├── __init__.py │ ├── conftest.py │ └── test_login.py ├── usercases │ ├── __init__.py │ ├── conftest.py │ └── test_user_add.py └── conftest.py ├── Common ├── __init__.py ├── plugs │ ├── __init__.py │ ├── __pycache__ │ │ ├── __init__.cpython-36.pyc │ │ ├── basepage.cpython-36.pyc │ │ ├── get_log.cpython-36.pyc │ │ └── get_config.cpython-36.pyc │ ├── get_config.py │ ├── get_log.py │ └── basepage.py ├── __pycache__ │ └── __init__.cpython-36.pyc └── config │ └── config.ini ├── Locators ├── __init__.py ├── UserLocators │ ├── __init__.py │ └── user_locators.py ├── IndexLocators │ ├── __init__.py │ └── index_locators.py └── LoginLocators │ ├── __init__.py │ └── login_locators.py ├── PageObjects ├── __init__.py ├── IndexPage │ ├── __init__.py │ └── index_page.py ├── LoginPage │ ├── __init__.py │ └── login_page.py └── UserPage │ ├── __init__.py │ └── user_page.py ├── TestDatas ├── __init__.py ├── GobalDatas │ ├── __init__.py │ └── gobal_datas.py ├── LoginDatas │ ├── __init__.py │ └── login_datas.py └── UserDatas │ ├── __init__.py │ └── user_add_datas.py ├── requirements.txt ├── OutPuts ├── image │ ├── 登录功能-正常测试-正常截图_2019-10-26_20_26_18.png │ ├── 新增用户功能-正常测试-正常截图_2019-10-26_20_26_26.png │ ├── 登录功能-异常测试-密码为空-正常截图_2019-10-26_20_26_09.png │ ├── 登录功能-异常测试-密码错误-正常截图_2019-10-26_20_26_13.png │ ├── 登录功能-异常测试-用户名为空-正常截图_2019-10-26_20_25_59.png │ ├── 新增用户功能-异常测试-用户名为空-正常截图_2019-10-26_20_26_36.png │ ├── 新增用户功能-异常测试-用户名为空-正常截图_2019-10-26_20_26_46.png │ ├── 新增用户功能-异常测试-用户已存在-正常截图_2019-10-26_20_26_31.png │ ├── 新增用户功能-异常测试-用户已存在-正常截图_2019-10-26_20_26_41.png │ └── 登录功能-异常测试-用户名不存在-正常截图_2019-10-26_20_26_04.png └── log │ └── 2019-10-29.log ├── assets └── style.css ├── .gitignore ├── README.md └── .idea └── workspace.xml /Cases/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Common/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Locators/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /PageObjects/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /TestDatas/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Cases/logincases/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Cases/usercases/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Common/plugs/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Locators/UserLocators/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /PageObjects/IndexPage/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /PageObjects/LoginPage/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /PageObjects/UserPage/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /TestDatas/GobalDatas/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /TestDatas/LoginDatas/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /TestDatas/UserDatas/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Locators/IndexLocators/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Locators/LoginLocators/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | selenium==3.141.0 2 | pytest==5.1.3 3 | -------------------------------------------------------------------------------- /TestDatas/GobalDatas/gobal_datas.py: -------------------------------------------------------------------------------- 1 | web_login_url = 'http://localhost:8080/#/login' 2 | 3 | web_user_url = 'http://localhost:8080/#/users' 4 | -------------------------------------------------------------------------------- /Common/__pycache__/__init__.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lucas3414/python_web_framework/HEAD/Common/__pycache__/__init__.cpython-36.pyc -------------------------------------------------------------------------------- /Common/plugs/__pycache__/__init__.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lucas3414/python_web_framework/HEAD/Common/plugs/__pycache__/__init__.cpython-36.pyc -------------------------------------------------------------------------------- /Common/plugs/__pycache__/basepage.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lucas3414/python_web_framework/HEAD/Common/plugs/__pycache__/basepage.cpython-36.pyc -------------------------------------------------------------------------------- /Common/plugs/__pycache__/get_log.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lucas3414/python_web_framework/HEAD/Common/plugs/__pycache__/get_log.cpython-36.pyc -------------------------------------------------------------------------------- /Common/plugs/__pycache__/get_config.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lucas3414/python_web_framework/HEAD/Common/plugs/__pycache__/get_config.cpython-36.pyc -------------------------------------------------------------------------------- /OutPuts/image/登录功能-正常测试-正常截图_2019-10-26_20_26_18.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lucas3414/python_web_framework/HEAD/OutPuts/image/登录功能-正常测试-正常截图_2019-10-26_20_26_18.png -------------------------------------------------------------------------------- /OutPuts/image/新增用户功能-正常测试-正常截图_2019-10-26_20_26_26.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lucas3414/python_web_framework/HEAD/OutPuts/image/新增用户功能-正常测试-正常截图_2019-10-26_20_26_26.png -------------------------------------------------------------------------------- /OutPuts/image/登录功能-异常测试-密码为空-正常截图_2019-10-26_20_26_09.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lucas3414/python_web_framework/HEAD/OutPuts/image/登录功能-异常测试-密码为空-正常截图_2019-10-26_20_26_09.png -------------------------------------------------------------------------------- /OutPuts/image/登录功能-异常测试-密码错误-正常截图_2019-10-26_20_26_13.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lucas3414/python_web_framework/HEAD/OutPuts/image/登录功能-异常测试-密码错误-正常截图_2019-10-26_20_26_13.png -------------------------------------------------------------------------------- /OutPuts/image/登录功能-异常测试-用户名为空-正常截图_2019-10-26_20_25_59.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lucas3414/python_web_framework/HEAD/OutPuts/image/登录功能-异常测试-用户名为空-正常截图_2019-10-26_20_25_59.png -------------------------------------------------------------------------------- /Locators/IndexLocators/index_locators.py: -------------------------------------------------------------------------------- 1 | from selenium.webdriver.common.by import By 2 | 3 | 4 | class IndexLocator: 5 | logout_loc = (By.XPATH, '//a[text()="退出"]') 6 | 7 | 8 | -------------------------------------------------------------------------------- /OutPuts/image/新增用户功能-异常测试-用户名为空-正常截图_2019-10-26_20_26_36.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lucas3414/python_web_framework/HEAD/OutPuts/image/新增用户功能-异常测试-用户名为空-正常截图_2019-10-26_20_26_36.png -------------------------------------------------------------------------------- /OutPuts/image/新增用户功能-异常测试-用户名为空-正常截图_2019-10-26_20_26_46.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lucas3414/python_web_framework/HEAD/OutPuts/image/新增用户功能-异常测试-用户名为空-正常截图_2019-10-26_20_26_46.png -------------------------------------------------------------------------------- /OutPuts/image/新增用户功能-异常测试-用户已存在-正常截图_2019-10-26_20_26_31.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lucas3414/python_web_framework/HEAD/OutPuts/image/新增用户功能-异常测试-用户已存在-正常截图_2019-10-26_20_26_31.png -------------------------------------------------------------------------------- /OutPuts/image/新增用户功能-异常测试-用户已存在-正常截图_2019-10-26_20_26_41.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lucas3414/python_web_framework/HEAD/OutPuts/image/新增用户功能-异常测试-用户已存在-正常截图_2019-10-26_20_26_41.png -------------------------------------------------------------------------------- /OutPuts/image/登录功能-异常测试-用户名不存在-正常截图_2019-10-26_20_26_04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lucas3414/python_web_framework/HEAD/OutPuts/image/登录功能-异常测试-用户名不存在-正常截图_2019-10-26_20_26_04.png -------------------------------------------------------------------------------- /Common/config/config.ini: -------------------------------------------------------------------------------- 1 | [log] 2 | log_path = base_dir/OutPuts/log/ 3 | 4 | [image] 5 | img_path = base_dir/OutPuts/image/ 6 | 7 | [report] 8 | report_path = base_dir/OutPuts/reports/ 9 | 10 | [test_case] 11 | test_case_path = base_dir/cases/ -------------------------------------------------------------------------------- /Locators/LoginLocators/login_locators.py: -------------------------------------------------------------------------------- 1 | from selenium.webdriver.common.by import By 2 | 3 | 4 | class LoginLocator: 5 | username_loc = (By.XPATH, '//*[@id="app"]/div/form/div[1]/div/div/input') 6 | password_loc = (By.XPATH, '//*[@id="app"]/div/form/div[2]/div/div/input') 7 | login_btn_loc = (By.XPATH, '//*[@type="button"]') 8 | error_msg_loc = (By.CLASS_NAME, 'el-message__content') 9 | -------------------------------------------------------------------------------- /PageObjects/IndexPage/index_page.py: -------------------------------------------------------------------------------- 1 | from selenium.webdriver.support.wait import WebDriverWait 2 | from selenium.webdriver.support import expected_conditions as EC 3 | from Locators.IndexLocators.index_locators import IndexLocator as loc 4 | 5 | 6 | class IndexPage: 7 | 8 | def __init__(self, driver): 9 | self.driver = driver 10 | 11 | # 判断当前元素是否存在 存在返回True 否则返回false 12 | def isExist_logout_ele(self): 13 | try: 14 | WebDriverWait(self.driver, 20).until(EC.visibility_of_element_located(loc.logout_loc)) 15 | return True 16 | except: 17 | return False 18 | 19 | 20 | -------------------------------------------------------------------------------- /TestDatas/LoginDatas/login_datas.py: -------------------------------------------------------------------------------- 1 | # 正常场景测试数据 2 | success_data = {'name': '登录功能-正常测试', 'username': 'admin', 'password': '123456'} 3 | 4 | # 异常场景测试 - username 5 | error_usernameFormat_data = [ 6 | {'name': '登录功能-异常测试-用户名为空', 'username': '', 'password': '123456', 'errorMsg': '参数错误'}, 7 | {'name': '登录功能-异常测试-用户名不存在', 'username': 'xxoo', 'password': '123456', 'errorMsg': '用户名不存在'}, 8 | ] 9 | 10 | # 异常场景测试 - password 11 | error_passwordFormat_data = [ 12 | {'name': '登录功能-异常测试-密码为空', 'username': 'admin', 'password': '', 'errorMsg': '参数错误'}, 13 | {'name': '登录功能-异常测试-密码错误', 'username': 'admin', 'password': '1234567', 'errorMsg': '密码错误'}, 14 | ] 15 | -------------------------------------------------------------------------------- /PageObjects/LoginPage/login_page.py: -------------------------------------------------------------------------------- 1 | from Locators.LoginLocators.login_locators import LoginLocator as loc 2 | from Common.plugs.basepage import BasePage 3 | 4 | 5 | class LoginPage(BasePage): 6 | 7 | # 登录 8 | def login(self, username, password): 9 | doc = '登录页面_登录功能' 10 | self.input_element(loc.username_loc, username, doc) 11 | self.input_element(loc.password_loc, password, doc) 12 | self.click_element(loc.login_btn_loc, doc) 13 | 14 | # 获取错误提示 15 | def get_login_errMsg(self): 16 | doc = '登录页面_登录功能错误信息_获取错误信息' 17 | # self.wait_eleVisible(loc.error_msg_loc) 18 | return self.get_element_text(loc.error_msg_loc, doc) 19 | -------------------------------------------------------------------------------- /PageObjects/UserPage/user_page.py: -------------------------------------------------------------------------------- 1 | from Locators.UserLocators.user_locators import UserLocator as loc 2 | from Common.plugs.basepage import BasePage 3 | 4 | 5 | class UserPage(BasePage): 6 | 7 | def add_user(self, username, password, email, phone): 8 | doc = '用户列表页面_新增用户功能' 9 | self.click_element(loc.user_add_btn, doc) 10 | self.input_element(loc.user_add_dialog_username, username, doc) 11 | self.input_element(loc.user_add_dialog_password, password, doc) 12 | self.input_element(loc.user_add_dialog_email, email, doc) 13 | self.input_element(loc.user_add_dialog_phone, phone, doc) 14 | self.click_element(loc.user_add_dialog_confirm_btn, doc) 15 | 16 | def get_add_result_msg(self): 17 | doc = '用户列表页面_新增用户功能_获取新增结果信息' 18 | # self.wait_eleVisible(loc.user_add_dialog_msg, doc) 19 | return self.get_element_text(loc.user_add_dialog_msg, doc) 20 | -------------------------------------------------------------------------------- /TestDatas/UserDatas/user_add_datas.py: -------------------------------------------------------------------------------- 1 | # 正常场景测试数据 2 | success_data = {'name': '新增用户功能-正常测试', 'username': 'haha', 'password': '123456', 'email': '123@qq.com', 3 | 'phone': '13776787676', 'Msg': '创建成功'} 4 | 5 | # 异常场景测试 - username 6 | error_usernameFormat_data = [ 7 | {'name': '新增用户功能-异常测试-用户已存在', 'username': 'haha', 'password': '123456', 'email': '123@qq.com', 8 | 'phone': '13776787676', 'Msg': '用户名已存在'}, 9 | {'name': '新增用户功能-异常测试-用户名为空', 'username': '', 'password': '123456', 'email': '123@qq.com', 'phone': '13776787676', 10 | 'Msg': '用户名不能为空'}, 11 | ] 12 | 13 | # 异常场景测试 - password 14 | error_passwordFormat_data = [ 15 | {'name': '新增用户功能-异常测试-用户已存在', 'username': 'haha', 'password': '123456', 'email': '123@qq.com', 16 | 'phone': '13776787676', 'Msg': '用户名已存在'}, 17 | {'name': '新增用户功能-异常测试-密码为空', 'username': 'wang', 'password': '', 'email': '123@qq.com', 'phone': '13776787676', 18 | 'Msg': '密码不能为空'}, 19 | ] 20 | -------------------------------------------------------------------------------- /Locators/UserLocators/user_locators.py: -------------------------------------------------------------------------------- 1 | from selenium.webdriver.common.by import By 2 | 3 | 4 | class UserLocator: 5 | user_add_btn = (By.XPATH, '//span[text()="添加按钮"]') 6 | 7 | user_add_dialog_username = ( 8 | By.XPATH, '//div[@aria-label="添加用户"]/div[@class="el-dialog__body"]/form/div[1]//input') 9 | # By.XPATH, '//*[@id="app"]/section/section/main/div/div/div[5]/div/div[2]/form/div[1]/div/div/input') 10 | 11 | user_add_dialog_password = ( 12 | By.XPATH, '//*[@id="app"]/section/section/main/div/div/div[5]/div/div[2]/form/div[2]/div/div/input') 13 | 14 | user_add_dialog_email = ( 15 | By.XPATH, '//*[@id="app"]/section/section/main/div/div/div[5]/div/div[2]/form/div[3]/div/div/input') 16 | 17 | user_add_dialog_phone = ( 18 | By.XPATH, '//*[@id="app"]/section/section/main/div/div/div[5]/div/div[2]/form/div[4]/div/div/input') 19 | 20 | user_add_dialog_confirm_btn = (By.XPATH, '//*[@id="app"]/section/section/main/div/div/div[5]/div/div[3]/div/button[2]') 21 | 22 | user_add_dialog_cancel_btn = (By.XPATH, '//*[@id="app"]/section/section/main/div/div/div[5]/div/div[3]/div/button[1]') 23 | 24 | user_add_dialog_msg = (By.XPATH, '//div[@role="alert"]/p[@class="el-message__content"]') 25 | -------------------------------------------------------------------------------- /Cases/conftest.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | import os 3 | import sys 4 | from selenium import webdriver 5 | from Common.plugs.get_log import Log 6 | from Common.plugs.get_config import r_config 7 | 8 | BASE_DIR = os.path.dirname(os.path.dirname(__file__)) 9 | if sys.platform == "win32": 10 | conf_dir = os.path.join(BASE_DIR, 'Common/config/config.ini').replace('/', '\\') 11 | else: 12 | conf_dir = os.path.join(BASE_DIR, 'Common/config/config.ini') 13 | log_dir = r_config(conf_dir, "log", "log_path") 14 | logger = Log(log_dir) 15 | 16 | driver = None 17 | 18 | 19 | @pytest.fixture(scope='session') 20 | def project_session_start(): 21 | logger.info("==========开始 XX项目 执行测试===========") 22 | global driver 23 | driver = webdriver.Chrome() 24 | driver.maximize_window() 25 | yield driver 26 | driver.quit() 27 | logger.info("==========结束 XX项目 测试===========") 28 | 29 | 30 | @pytest.fixture(scope='module') 31 | def project_module_start(): 32 | logger.info("==========开始 XX模块 执行测试===========") 33 | global driver 34 | driver = webdriver.Chrome() 35 | driver.maximize_window() 36 | yield driver 37 | driver.quit() 38 | logger.info("==========结束 XX模块 测试===========") 39 | 40 | 41 | @pytest.fixture() 42 | def project_func(): 43 | print("project_func") 44 | 45 | 46 | 47 | def pytest_configure(config): 48 | # 标签名集合 49 | marker_list = ['smoke', 'lucas'] 50 | for markers in marker_list: 51 | config.addinivalue_line('markers', markers) 52 | -------------------------------------------------------------------------------- /Common/plugs/get_config.py: -------------------------------------------------------------------------------- 1 | import configparser 2 | import os 3 | import sys 4 | 5 | BASE_DIR = os.path.dirname(os.path.dirname(os.path.dirname(__file__))) 6 | 7 | if sys.platform == "win32": 8 | conf_dir = os.path.join(BASE_DIR, 'Common/config/config.ini').replace('/', '\\') 9 | else: 10 | conf_dir = os.path.join(BASE_DIR, 'Common/config/config.ini') 11 | 12 | 13 | class Config(object): 14 | 15 | def __init__(self, path): 16 | self.path = path 17 | self.cf = configparser.ConfigParser() 18 | self.cf.read(self.path, encoding='utf-8') 19 | 20 | def get(self, field, key): 21 | result = "" 22 | try: 23 | result = self.cf.get(field, key) 24 | except: 25 | result = "" 26 | return result 27 | 28 | def set(self, field, key, value): 29 | try: 30 | self.cf.set(field, key, value) 31 | self.cf.write(open(self.path, 'w')) 32 | except: 33 | return False 34 | return True 35 | 36 | 37 | def r_config(config_file_path, field, key): 38 | rf = configparser.ConfigParser() 39 | try: 40 | rf.read(config_file_path, encoding='utf-8') 41 | if sys.platform == "win32": 42 | result = rf.get(field, key).replace('base_dir', str(BASE_DIR)).replace('/', '\\') 43 | else: 44 | result = rf.get(field, key).replace('base_dir', str(BASE_DIR)) 45 | except: 46 | sys.exit(1) 47 | return result 48 | 49 | 50 | def w_config(config_file_path, field, key, value): 51 | wf = configparser.ConfigParser() 52 | try: 53 | wf.read(config_file_path) 54 | wf.set(field, key, value) 55 | wf.write(open(config_file_path, 'w')) 56 | except: 57 | sys.exit(1) 58 | return True 59 | 60 | 61 | if __name__ == '__main__': 62 | b = r_config(conf_dir, 'image', 'img_path') 63 | print(b) 64 | -------------------------------------------------------------------------------- /Cases/logincases/conftest.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | import os 3 | import sys 4 | from time import sleep 5 | from selenium import webdriver 6 | from TestDatas.GobalDatas import gobal_datas as GD 7 | from PageObjects.LoginPage.login_page import LoginPage 8 | from Common.plugs.basepage import BasePage 9 | from Common.plugs.get_log import Log 10 | from Common.plugs.get_config import r_config 11 | 12 | BASE_DIR = os.path.dirname(os.path.dirname(os.path.dirname(__file__))) 13 | if sys.platform == "win32": 14 | conf_dir = os.path.join(BASE_DIR, 'Common/config/config.ini').replace('/', '\\') 15 | else: 16 | conf_dir = os.path.join(BASE_DIR, 'Common/config/config.ini') 17 | log_dir = r_config(conf_dir, "log", "log_path") 18 | logger = Log(log_dir) 19 | 20 | driver = None 21 | 22 | 23 | @pytest.fixture(scope='class') 24 | def start_module(project_module_start): 25 | ''' 26 | 每个模块单独打开一次浏览器,此时 driver.quit() 需要单独加上 27 | :param project_module_start: 每个模块单独打开一次浏览器 28 | :return: driver lg 29 | ''' 30 | logger.info("==========开始执行测试用例集===========") 31 | global driver 32 | driver = project_module_start 33 | driver.get(GD.web_login_url) 34 | lg = LoginPage(driver) 35 | yield (driver, lg) 36 | logger.info("==========结束执行测试用例集===========") 37 | driver.quit() 38 | 39 | 40 | @pytest.fixture(scope='class') 41 | def start_session(project_session_start): 42 | ''' 43 | 所有模块只打开一次浏览器 44 | :param project_session_start: 所有模块只打开一次浏览器 45 | :return: driver lg 46 | ''' 47 | logger.info("==========开始执行测试用例集===========") 48 | global driver 49 | driver = project_session_start 50 | logger.info("----------------------------------------------------------------------------------" + str(driver)) 51 | driver.get(GD.web_login_url) 52 | lg = LoginPage(driver) 53 | yield (driver, lg) 54 | logger.info("==========结束执行测试用例集===========") 55 | 56 | 57 | @pytest.fixture() 58 | def refresh_page(): 59 | yield 60 | driver.refresh() 61 | sleep(3) 62 | -------------------------------------------------------------------------------- /Common/plugs/get_log.py: -------------------------------------------------------------------------------- 1 | # coding=utf-8 2 | 3 | import os, time, logging, sys 4 | 5 | from Common.plugs.get_config import r_config 6 | 7 | BASE_DIR = os.path.dirname(os.path.dirname(os.path.dirname(__file__))) 8 | if sys.platform == "win32": 9 | conf_dir = os.path.join(BASE_DIR, 'Common/config/config.ini').replace('/', '\\') 10 | else: 11 | conf_dir = os.path.join(BASE_DIR, 'Common/config/config.ini') 12 | log_path = r_config(conf_dir, "log", "log_path") 13 | 14 | 15 | class Log(): 16 | 17 | def __init__(self, log_path): 18 | self.logname = os.path.join(log_path, '{0}.log'.format(time.strftime('%Y-%m-%d'))) 19 | 20 | def __printconsole(self, level, message): 21 | # 创建一个logger 22 | logger = logging.getLogger() 23 | logger.setLevel(logging.DEBUG) 24 | # 创建一个handler,用于写入日志文件 25 | fh = logging.FileHandler(self.logname, 'a+', encoding='utf-8') 26 | fh.setLevel(logging.DEBUG) 27 | # 再创建一个handler,用于输出到控制台 28 | ch = logging.StreamHandler() 29 | ch.setLevel(logging.DEBUG) 30 | # 定义handler的输出格式 31 | formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(message)s') 32 | fh.setFormatter(formatter) 33 | ch.setFormatter(formatter) 34 | # 给logger添加handler 35 | logger.addHandler(fh) 36 | logger.addHandler(ch) 37 | # 记录一条日志 38 | if level == 'info': 39 | logger.info(message) 40 | elif level == 'debug': 41 | logger.debug(message) 42 | elif level == 'warning': 43 | logger.warning(message) 44 | elif level == 'error': 45 | logger.error(message) 46 | logger.removeHandler(ch) 47 | logger.removeHandler(fh) 48 | # 关闭打开的文件 49 | fh.close() 50 | 51 | def debug(self, message): 52 | self.__printconsole('debug', message) 53 | 54 | def info(self, message): 55 | self.__printconsole('info', message) 56 | 57 | def warning(self, message): 58 | self.__printconsole('warning', message) 59 | 60 | def error(self, message): 61 | self.__printconsole('error', message) 62 | 63 | 64 | if __name__ == '__main__': 65 | Log(log_path).info("adasd") 66 | -------------------------------------------------------------------------------- /Cases/usercases/conftest.py: -------------------------------------------------------------------------------- 1 | import pytest, os, sys 2 | from time import sleep 3 | from selenium import webdriver 4 | from TestDatas.GobalDatas import gobal_datas as GD 5 | from TestDatas.LoginDatas.login_datas import success_data as LD 6 | from PageObjects.LoginPage.login_page import LoginPage 7 | from PageObjects.UserPage.user_page import UserPage 8 | from Common.plugs.basepage import BasePage 9 | from Common.plugs.get_log import Log 10 | from Common.plugs.get_config import r_config 11 | 12 | BASE_DIR = os.path.dirname(os.path.dirname(os.path.dirname(__file__))) 13 | if sys.platform == "win32": 14 | conf_dir = os.path.join(BASE_DIR, 'Common/config/config.ini').replace('/', '\\') 15 | else: 16 | conf_dir = os.path.join(BASE_DIR, 'Common/config/config.ini') 17 | log_dir = r_config(conf_dir, "log", "log_path") 18 | logger = Log(log_dir) 19 | driver = None 20 | 21 | 22 | @pytest.fixture(scope='class') 23 | def start_module(project_module_start): 24 | ''' 25 | 每个模块单独打开一次浏览器,此时 driver.quit() 需要单独加上 26 | :param project_module_start: 每个模块单独打开一次浏览器 27 | :return: driver ug 28 | ''' 29 | logger.info("==========开始执行测试用例集===========") 30 | global driver 31 | driver = project_module_start 32 | logger.info("----------------------------------------------------------------------------------" + str(driver)) 33 | driver.get(GD.web_login_url) 34 | LoginPage(driver).login(LD['username'], LD['password']) 35 | sleep(2) 36 | driver.get(GD.web_user_url) 37 | ug = UserPage(driver) 38 | yield (driver, ug) 39 | logger.info("==========结束执行测试用例集===========") 40 | driver.quit() 41 | 42 | 43 | @pytest.fixture(scope='class') 44 | def start_session(project_session_start): 45 | ''' 46 | 所有模块只打开一次浏览器 47 | :param project_session_start: 所有模块只打开一次浏览器 48 | :return: driver ug 49 | ''' 50 | logger.info("==========开始执行测试用例集===========") 51 | global driver 52 | driver = project_session_start 53 | logger.info("----------------------------------------------------------------------------------" + str(driver)) 54 | driver.get(GD.web_login_url) 55 | LoginPage(driver).login(LD['username'], LD['password']) 56 | sleep(2) 57 | driver.get(GD.web_user_url) 58 | ug = UserPage(driver) 59 | yield (driver, ug) 60 | logger.info("==========结束执行测试用例集===========") 61 | 62 | 63 | @pytest.fixture() 64 | def refresh_page(): 65 | yield 66 | sleep(3) 67 | -------------------------------------------------------------------------------- /assets/style.css: -------------------------------------------------------------------------------- 1 | body { 2 | font-family: Helvetica, Arial, sans-serif; 3 | font-size: 12px; 4 | min-width: 1200px; 5 | color: #999; 6 | } 7 | 8 | h1 { 9 | font-size: 24px; 10 | color: black; 11 | } 12 | 13 | h2 { 14 | font-size: 16px; 15 | color: black; 16 | } 17 | 18 | p { 19 | color: black; 20 | } 21 | 22 | a { 23 | color: #999; 24 | } 25 | 26 | table { 27 | border-collapse: collapse; 28 | } 29 | 30 | /****************************** 31 | * SUMMARY INFORMATION 32 | ******************************/ 33 | 34 | #environment td { 35 | padding: 5px; 36 | border: 1px solid #E6E6E6; 37 | } 38 | 39 | #environment tr:nth-child(odd) { 40 | background-color: #f6f6f6; 41 | } 42 | 43 | /****************************** 44 | * TEST RESULT COLORS 45 | ******************************/ 46 | span.passed, .passed .col-result { 47 | color: green; 48 | } 49 | span.skipped, span.xfailed, span.rerun, .skipped .col-result, .xfailed .col-result, .rerun .col-result { 50 | color: orange; 51 | } 52 | span.error, span.failed, span.xpassed, .error .col-result, .failed .col-result, .xpassed .col-result { 53 | color: red; 54 | } 55 | 56 | 57 | /****************************** 58 | * RESULTS TABLE 59 | * 60 | * 1. Table Layout 61 | * 2. Extra 62 | * 3. Sorting items 63 | * 64 | ******************************/ 65 | 66 | /*------------------ 67 | * 1. Table Layout 68 | *------------------*/ 69 | 70 | #results-table { 71 | border: 1px solid #e6e6e6; 72 | color: #999; 73 | font-size: 12px; 74 | width: 100% 75 | } 76 | 77 | #results-table th, #results-table td { 78 | padding: 5px; 79 | border: 1px solid #E6E6E6; 80 | text-align: left 81 | } 82 | #results-table th { 83 | font-weight: bold 84 | } 85 | 86 | /*------------------ 87 | * 2. Extra 88 | *------------------*/ 89 | 90 | .log:only-child { 91 | height: inherit 92 | } 93 | .log { 94 | background-color: #e6e6e6; 95 | border: 1px solid #e6e6e6; 96 | color: black; 97 | display: block; 98 | font-family: "Courier New", Courier, monospace; 99 | height: 230px; 100 | overflow-y: scroll; 101 | padding: 5px; 102 | white-space: pre-wrap 103 | } 104 | div.image { 105 | border: 1px solid #e6e6e6; 106 | float: right; 107 | height: 240px; 108 | margin-left: 5px; 109 | overflow: hidden; 110 | width: 320px 111 | } 112 | div.image img { 113 | width: 320px 114 | } 115 | .collapsed { 116 | display: none; 117 | } 118 | .expander::after { 119 | content: " (show details)"; 120 | color: #BBB; 121 | font-style: italic; 122 | cursor: pointer; 123 | } 124 | .collapser::after { 125 | content: " (hide details)"; 126 | color: #BBB; 127 | font-style: italic; 128 | cursor: pointer; 129 | } 130 | 131 | /*------------------ 132 | * 3. Sorting items 133 | *------------------*/ 134 | .sortable { 135 | cursor: pointer; 136 | } 137 | 138 | .sort-icon { 139 | font-size: 0px; 140 | float: left; 141 | margin-right: 5px; 142 | margin-top: 5px; 143 | /*triangle*/ 144 | width: 0; 145 | height: 0; 146 | border-left: 8px solid transparent; 147 | border-right: 8px solid transparent; 148 | } 149 | 150 | .inactive .sort-icon { 151 | /*finish triangle*/ 152 | border-top: 8px solid #E6E6E6; 153 | } 154 | 155 | .asc.active .sort-icon { 156 | /*finish triangle*/ 157 | border-bottom: 8px solid #999; 158 | } 159 | 160 | .desc.active .sort-icon { 161 | /*finish triangle*/ 162 | border-top: 8px solid #999; 163 | } 164 | -------------------------------------------------------------------------------- /Cases/usercases/test_user_add.py: -------------------------------------------------------------------------------- 1 | import pytest, sys, os 2 | from TestDatas.UserDatas import user_add_datas as UAD 3 | from Common.plugs.get_log import Log 4 | from Common.plugs.get_config import r_config 5 | 6 | BASE_DIR = os.path.dirname(os.path.dirname(os.path.dirname(__file__))) 7 | if sys.platform == "win32": 8 | conf_dir = os.path.join(BASE_DIR, 'Common/config/config.ini').replace('/', '\\') 9 | else: 10 | conf_dir = os.path.join(BASE_DIR, 'Common/config/config.ini') 11 | log_dir = r_config(conf_dir, "log", "log_path") 12 | logger = Log(log_dir) 13 | 14 | 15 | @pytest.mark.usefixtures('start_session') 16 | @pytest.mark.usefixtures('refresh_page') 17 | class TestUserAdd: 18 | 19 | @pytest.mark.smoke 20 | def test_add_user(self, start_session): 21 | logger.info(" 执行 {0} 测试用例 ".format(sys._getframe().f_code.co_name)) 22 | logger.info('正常新增用户测试用例') 23 | start_session[1].add_user(UAD.success_data['username'], UAD.success_data['password'], 24 | UAD.success_data['email'], 25 | UAD.success_data['phone']) 26 | logger.info("期望值:{0}".format(UAD.success_data['Msg'])) 27 | logger.info("实际值:{0}".format(start_session[1].get_add_result_msg())) 28 | try: 29 | assert start_session[1].get_add_result_msg() == UAD.success_data['Msg'] 30 | logger.info(" 结束执行 {0} 测试用例, 测试结果 --- PASS ".format(sys._getframe().f_code.co_name)) 31 | start_session[1].save_pictuer("{0}-正常截图".format(UAD.success_data['name'])) 32 | except: 33 | logger.error(" 结束执行 {0} 测试用例, 测试结果 --- False ".format(sys._getframe().f_code.co_name)) 34 | start_session[1].save_pictuer("{0}-异常截图".format(UAD.success_data['name'])) 35 | raise 36 | 37 | @pytest.mark.parametrize('data', UAD.error_usernameFormat_data) 38 | def test_add_usernameFormat_error(self, data, start_session): 39 | print(" 执行 {0} 测试用例 ".format(sys._getframe().f_code.co_name)) 40 | logger.info(" 异常测试用例:{0} ".format(data['name'])) 41 | start_session[1].add_user(data['username'], data['password'], data['email'], data['phone']) 42 | logger.info("期望值:{0}".format(data['Msg'])) 43 | logger.info("实际值:{0}".format(start_session[1].get_add_result_msg())) 44 | try: 45 | assert start_session[1].get_add_result_msg() == data['Msg'] 46 | logger.info(" 结束执行 {0} 测试用例, 测试结果 --- PASS ".format(sys._getframe().f_code.co_name)) 47 | start_session[1].save_pictuer("{0}-正常截图".format(data['name'])) 48 | except: 49 | logger.error(" 结束执行 {0} 测试用例, 测试结果 --- False ".format(sys._getframe().f_code.co_name)) 50 | start_session[1].save_pictuer("{0}-异常截图".format(data['name'])) 51 | raise 52 | 53 | @pytest.mark.parametrize('data', UAD.error_usernameFormat_data) 54 | def test_add_passwordFormat_error(self, data, start_session): 55 | logger.info(" 执行 {0} 测试用例 ".format(sys._getframe().f_code.co_name)) 56 | logger.info(" 异常测试用例:{0} ".format(data['name'])) 57 | start_session[1].add_user(data['username'], data['password'], data['email'], data['phone']) 58 | logger.info("期望值:{0}".format(data['Msg'])) 59 | logger.info("实际值:{0}".format(start_session[1].get_add_result_msg())) 60 | try: 61 | assert start_session[1].get_add_result_msg() == data['Msg'] 62 | logger.info(" 结束执行 {0} 测试用例, 测试结果 --- PASS ".format(sys._getframe().f_code.co_name)) 63 | start_session[1].save_pictuer("{0}-正常截图".format(data['name'])) 64 | except: 65 | logger.error(" 结束执行 {0} 测试用例, 测试结果 --- False ".format(sys._getframe().f_code.co_name)) 66 | start_session[1].save_pictuer("{0}-异常截图".format(data['name'])) 67 | raise 68 | -------------------------------------------------------------------------------- /Cases/logincases/test_login.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | import sys 3 | import os 4 | from PageObjects.IndexPage.index_page import IndexPage 5 | from TestDatas.LoginDatas import login_datas as LD 6 | from Common.plugs.get_log import Log 7 | from Common.plugs.get_config import r_config 8 | 9 | BASE_DIR = os.path.dirname(os.path.dirname(os.path.dirname(__file__))) 10 | if sys.platform == "win32": 11 | conf_dir = os.path.join(BASE_DIR, 'Common/config/config.ini').replace('/', '\\') 12 | else: 13 | conf_dir = os.path.join(BASE_DIR, 'Common/config/config.ini') 14 | log_dir = r_config(conf_dir, "log", "log_path") 15 | logger = Log(log_dir) 16 | 17 | 18 | @pytest.mark.usefixtures('start_session') 19 | @pytest.mark.usefixtures('refresh_page') 20 | class TestLogin: 21 | 22 | # 异常测试用例 23 | @pytest.mark.parametrize('data', LD.error_usernameFormat_data) 24 | def test_login_usernameFormat_error(self, data, start_session): 25 | logger.info(" 执行 {0} 测试用例 ".format(sys._getframe().f_code.co_name)) 26 | logger.info(" 异常测试用例:{0} ".format(data['name'])) 27 | # 前置 访问登录页面 28 | # 步骤 输入用户名为空 密码 点击登录 29 | # 断言 登录中 提示:用户名或密码错误 30 | start_session[1].login(data['username'], data['password']) 31 | logger.info("期望值:{0}".format(data['errorMsg'])) 32 | logger.info("实际值:{0}".format(start_session[1].get_login_errMsg())) 33 | try: 34 | assert start_session[1].get_login_errMsg() == data['errorMsg'] 35 | logger.info(" 结束执行 {0} 测试用例, 测试结果 --- PASS ".format(sys._getframe().f_code.co_name)) 36 | start_session[1].save_pictuer("{0}-正常截图".format(data['name'])) 37 | except: 38 | logger.error(" 结束执行 {0} 测试用例, 测试结果 --- False ".format(sys._getframe().f_code.co_name)) 39 | start_session[1].save_pictuer("{0}-异常截图".format(data['name'])) 40 | raise 41 | 42 | # 异常测试用例 43 | @pytest.mark.parametrize('data', LD.error_passwordFormat_data) 44 | def test_login_passwordFormat_error(self, data, start_session): 45 | logger.info(" 执行 {0} 测试用例 ".format(sys._getframe().f_code.co_name)) 46 | logger.info(" 异常测试用例:{0} ".format(data['name'])) 47 | # 前置 访问登录页面 48 | # 步骤 输入用户名为空 密码 点击登录 49 | # 断言 登录中 提示:用户名或密码错误 50 | 51 | start_session[1].login(data['username'], data['password']) 52 | logger.info("期望值:{0}".format(data['errorMsg'])) 53 | logger.info("实际值:{0}".format(start_session[1].get_login_errMsg())) 54 | try: 55 | assert start_session[1].get_login_errMsg() == data['errorMsg'] 56 | logger.info(" 结束执行 {0} 测试用例, 测试结果 --- PASS ".format(sys._getframe().f_code.co_name)) 57 | start_session[1].save_pictuer("{0}-正常截图".format(data['name'])) 58 | except: 59 | logger.error(" 结束执行 {0} 测试用例, 测试结果 --- False ".format(sys._getframe().f_code.co_name)) 60 | start_session[1].save_pictuer("{0}-异常截图".format(data['name'])) 61 | raise 62 | 63 | # 正常用例 64 | @pytest.mark.lucas 65 | @pytest.mark.smoke 66 | def test_login_success(self, start_session): 67 | logger.info(" 执行 {0} 测试用例 ".format(sys._getframe().f_code.co_name)) 68 | logger.info(" 正常登录测试用例 ") 69 | # 前置 访问登录页面 70 | # 步骤 输入用户名 密码 点击登录 71 | # 断言 首页中 能否找到退出 这个元素 72 | start_session[1].login(LD.success_data['username'], LD.success_data['password']) 73 | logger.info("期望值:{0}".format(True)) 74 | logger.info("实际值:{0}".format(IndexPage(start_session[0]).isExist_logout_ele())) 75 | try: 76 | assert IndexPage(start_session[0]).isExist_logout_ele() 77 | logger.info(" 结束执行 {0} 测试用例, 测试结果 --- PASS ".format(sys._getframe().f_code.co_name)) 78 | start_session[1].save_pictuer("{0}-正常截图".format(LD.success_data['name'])) 79 | except: 80 | logger.error(" 结束执行 {0} 测试用例, 测试结果 --- False ".format(sys._getframe().f_code.co_name)) 81 | start_session[1].save_pictuer("{0}-异常截图".format(LD.success_data['name'])) 82 | raise 83 | -------------------------------------------------------------------------------- /Common/plugs/basepage.py: -------------------------------------------------------------------------------- 1 | import time, datetime, os, sys 2 | from selenium.webdriver.support.wait import WebDriverWait 3 | from selenium.webdriver.support import expected_conditions as EC 4 | from Common.plugs.get_log import Log 5 | from Common.plugs.get_config import r_config 6 | 7 | BASE_DIR = os.path.dirname(os.path.dirname(os.path.dirname(__file__))) 8 | 9 | if sys.platform == "win32": 10 | conf_dir = os.path.join(BASE_DIR, 'Common/config/config.ini').replace('/', '\\') 11 | else: 12 | conf_dir = os.path.join(BASE_DIR, 'Common/config/config.ini') 13 | log_dir = r_config(conf_dir, "log", "log_path") 14 | images_dir = r_config(conf_dir, "image", "img_path") 15 | 16 | logger = Log(log_dir) 17 | 18 | 19 | # 封装基本函数 - 执行日志、 异常处理、 截图 20 | class BasePage: 21 | 22 | def __init__(self, driver): 23 | self.driver = driver 24 | 25 | # 截图 26 | def save_pictuer(self, doc): 27 | filePath = images_dir + '{0}_{1}.png'.format(doc, time.strftime('%Y-%m-%d_%H_%M_%S', time.localtime())) 28 | try: 29 | self.driver.save_screenshot(filePath) 30 | logger.info('{0}截图成功,图片路径为: {0}'.format(doc, filePath)) 31 | except: 32 | logger.info('{0}截图 失败'.format(doc)) 33 | 34 | # 等待页面元素可见 35 | def wait_eleVisible(self, locator, doc=''): 36 | try: 37 | start = datetime.datetime.now() 38 | WebDriverWait(self.driver, timeout=20, poll_frequency=0.5).until(EC.visibility_of_element_located(locator)) 39 | end = datetime.datetime.now() 40 | wait_time = (end - start).seconds 41 | logger.info('{0},等待页面元素:{1}:可见,共耗时{2}s '.format(doc, locator, wait_time)) 42 | except: 43 | logger.info('{0},等待页面元素:{1} 失败!!!'.format(doc, locator)) 44 | self.save_pictuer(doc) 45 | 46 | # 等待页面元素存在 47 | def wait_elePresence(self): 48 | pass 49 | 50 | # 查找页面元素 51 | def get_element(self, locator, doc=''): 52 | print(locator) 53 | logger.info('{0},查找页面元素:{1}'.format(doc, locator)) 54 | try: 55 | self.wait_eleVisible(locator, doc) 56 | return self.driver.find_element(*locator) 57 | except: 58 | logger.info('{0},查找页面元素:{1} 失败!!!'.format(doc, locator)) 59 | raise 60 | 61 | # 点击页面元素 62 | def click_element(self, locator, doc=''): 63 | logger.info('{0},点击页面元素:{1}'.format(doc, locator)) 64 | try: 65 | self.get_element(locator, doc).click() 66 | except: 67 | logger.info('点击页面元素:{0},失败!!!'.format(locator)) 68 | raise 69 | 70 | # 输入操作 71 | def input_element(self, locator, key, doc=''): 72 | logger.info('{0},页面元素:{1} 输入值 {2}'.format(doc, locator, key)) 73 | try: 74 | self.wait_eleVisible(locator, doc) 75 | self.get_element(locator, doc).send_keys(key) 76 | except: 77 | logger.info('{0},页面元素输入失败!!!'.format(doc)) 78 | raise 79 | 80 | # 获取文本 81 | def get_element_text(self, locator, doc=''): 82 | logger.info('{0},获取页面元素:{1}'.format(doc, locator)) 83 | try: 84 | self.wait_eleVisible(locator, doc) 85 | return self.get_element(locator, doc).text 86 | except: 87 | logger.info('{0},页面元素的文本获取失败!!!'.format(doc)) 88 | raise 89 | 90 | # 获取页面元素属性 91 | def get_element_attribute(self, attr, locator, doc=''): 92 | logger.info('{0},获取页面元素属性:{1}'.format(doc, locator)) 93 | try: 94 | self.wait_eleVisible(locator, doc) 95 | return self.get_element(locator, doc).get_attribute(attr) 96 | except: 97 | logger.info('{0},页面元素的属性获取 失败!!!'.format(doc)) 98 | raise 99 | 100 | # alter 处理 101 | def alter_action(self): 102 | pass 103 | 104 | # iframe 切换 105 | def switch_iframe(self): 106 | pass 107 | 108 | # windows 切换 109 | def switch_window(self): 110 | pass 111 | 112 | # 上传操作 113 | def upload_file(self): 114 | pass 115 | 116 | # 滚动条处理 117 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Created by .ignore support plugin (hsz.mobi) 2 | ### Eclipse template 3 | .metadata 4 | bin/ 5 | tmp/ 6 | *.tmp 7 | *.bak 8 | *.swp 9 | *~.nib 10 | local.properties 11 | .settings/ 12 | .loadpath 13 | .recommenders 14 | 15 | # External tool builders 16 | .externalToolBuilders/ 17 | 18 | # Locally stored "Eclipse launch configurations" 19 | *.launch 20 | 21 | # PyDev specific (Python IDE for Eclipse) 22 | *.pydevproject 23 | 24 | # CDT-specific (C/C++ Development Tooling) 25 | .cproject 26 | 27 | # CDT- autotools 28 | .autotools 29 | 30 | # Java annotation processor (APT) 31 | .factorypath 32 | 33 | # PDT-specific (PHP Development Tools) 34 | .buildpath 35 | 36 | # sbteclipse plugin 37 | .target 38 | 39 | # Tern plugin 40 | .tern-project 41 | 42 | # TeXlipse plugin 43 | .texlipse 44 | 45 | # STS (Spring Tool Suite) 46 | .springBeans 47 | 48 | # Code Recommenders 49 | .recommenders/ 50 | 51 | # Annotation Processing 52 | .apt_generated/ 53 | 54 | # Scala IDE specific (Scala & Java development for Eclipse) 55 | .cache-main 56 | .scala_dependencies 57 | .worksheet 58 | 59 | ### JetBrains template 60 | # Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and WebStorm 61 | # Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839 62 | 63 | # User-specific stuff 64 | .idea/**/workspace.xml 65 | .idea/**/tasks.xml 66 | .idea/**/usage.statistics.xml 67 | .idea/**/dictionaries 68 | .idea/**/shelf 69 | 70 | # Generated files 71 | .idea/**/contentModel.xml 72 | 73 | # Sensitive or high-churn files 74 | .idea/**/dataSources/ 75 | .idea/**/dataSources.ids 76 | .idea/**/dataSources.local.xml 77 | .idea/**/sqlDataSources.xml 78 | .idea/**/dynamic.xml 79 | .idea/**/uiDesigner.xml 80 | .idea/**/dbnavigator.xml 81 | 82 | # Gradle 83 | .idea/**/gradle.xml 84 | .idea/**/libraries 85 | 86 | # Gradle and Maven with auto-import 87 | # When using Gradle or Maven with auto-import, you should exclude module files, 88 | # since they will be recreated, and may cause churn. Uncomment if using 89 | # auto-import. 90 | # .idea/modules.xml 91 | # .idea/*.iml 92 | # .idea/modules 93 | # *.iml 94 | # *.ipr 95 | 96 | # CMake 97 | cmake-build-*/ 98 | 99 | # Mongo Explorer plugin 100 | .idea/**/mongoSettings.xml 101 | 102 | # File-based project format 103 | *.iws 104 | 105 | # IntelliJ 106 | 107 | 108 | # mpeltonen/sbt-idea plugin 109 | .idea_modules/ 110 | 111 | # JIRA plugin 112 | atlassian-ide-plugin.xml 113 | 114 | # Cursive Clojure plugin 115 | .idea/replstate.xml 116 | 117 | # Crashlytics plugin (for Android Studio and IntelliJ) 118 | com_crashlytics_export_strings.xml 119 | crashlytics.properties 120 | crashlytics-build.properties 121 | fabric.properties 122 | 123 | # Editor-based Rest Client 124 | .idea/httpRequests 125 | 126 | # Android studio 3.1+ serialized cache file 127 | .idea/caches/build_file_checksums.ser 128 | 129 | ### VirtualEnv template 130 | # Virtualenv 131 | # http://iamzed.com/2009/05/07/a-primer-on-virtualenv/ 132 | .Python 133 | [Bb]in 134 | [Ii]nclude 135 | [Ll]ib 136 | [Ll]ib64 137 | [Ll]ocal 138 | [Ss]cripts 139 | pyvenv.cfg 140 | .venv 141 | pip-selfcheck.json 142 | 143 | ### Python template 144 | # Byte-compiled / optimized / DLL files 145 | __pycache__/ 146 | *.py[cod] 147 | *$py.class 148 | 149 | # C extensions 150 | *.so 151 | 152 | # Distribution / packaging 153 | build/ 154 | develop-eggs/ 155 | dist/ 156 | downloads/ 157 | eggs/ 158 | .eggs/ 159 | lib/ 160 | lib64/ 161 | parts/ 162 | sdist/ 163 | var/ 164 | wheels/ 165 | pip-wheel-metadata/ 166 | share/python-wheels/ 167 | *.egg-info/ 168 | .installed.cfg 169 | *.egg 170 | MANIFEST 171 | 172 | # PyInstaller 173 | # Usually these files are written by a python script from a template 174 | # before PyInstaller builds the exe, so as to inject date/other infos into it. 175 | *.manifest 176 | *.spec 177 | 178 | # Installer logs 179 | pip-log.txt 180 | pip-delete-this-directory.txt 181 | 182 | # Unit test / coverage reports 183 | htmlcov/ 184 | .tox/ 185 | .nox/ 186 | .coverage 187 | .coverage.* 188 | .cache 189 | nosetests.xml 190 | coverage.xml 191 | *.cover 192 | .hypothesis/ 193 | .pytest_cache/ 194 | 195 | # Translations 196 | *.mo 197 | *.pot 198 | 199 | # Django stuff: 200 | local_settings.py 201 | db.sqlite3 202 | 203 | # Flask stuff: 204 | instance/ 205 | .webassets-cache 206 | 207 | # Scrapy stuff: 208 | .scrapy 209 | 210 | # Sphinx documentation 211 | docs/_build/ 212 | 213 | # PyBuilder 214 | target/ 215 | 216 | # Jupyter Notebook 217 | .ipynb_checkpoints 218 | 219 | # IPython 220 | profile_default/ 221 | ipython_config.py 222 | 223 | # pyenv 224 | .python-version 225 | 226 | # pipenv 227 | # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. 228 | # However, in case of collaboration, if having platform-specific dependencies or dependencies 229 | # having no cross-platform support, pipenv may install dependencies that don't work, or not 230 | # install all needed dependencies. 231 | #Pipfile.lock 232 | 233 | # celery beat schedule file 234 | celerybeat-schedule 235 | 236 | # SageMath parsed files 237 | *.sage.py 238 | 239 | # Environments 240 | .env 241 | env/ 242 | venv/ 243 | ENV/ 244 | env.bak/ 245 | venv.bak/ 246 | 247 | # Spyder project settings 248 | .spyderproject 249 | .spyproject 250 | 251 | # Rope project settings 252 | .ropeproject 253 | 254 | # mkdocs documentation 255 | /site 256 | 257 | # mypy 258 | .mypy_cache/ 259 | .dmypy.json 260 | dmypy.json 261 | 262 | # Pyre type checker 263 | .pyre/ 264 | .idea/* 265 | Case/__pycache__/ 266 | Case/logincase/__pycache__/ 267 | Case/usercase/__pycache__/ 268 | Common/__pycache__/ 269 | Common/plugs/__pycache__/ 270 | 271 | 272 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # python_web_framework 2 | 这是一个关于python的WebUI自动化测试的项目,之前用的是unittest测试框架,现在改成pytest测试框架,Python+PageObject+Pytest 3 | 4 | 实现页面元素、页面对象及业务、测试数据分离 5 | 6 | 项目结构:说明 7 | 8 | . 9 | |-- assets 10 | | `-- style.css 11 | |-- cases --------------------- 测试用例模块 12 | | |-- conftest.py 13 | | |-- __init__.py 14 | | |-- logincases --------------------- 测试模块1 15 | | | |-- conftest.py 16 | | | |-- __init__.py 17 | | | `-- test_login.py 18 | | `-- usercases --------------------- 测试模块2 19 | | |-- conftest.py 20 | | |-- __init__.py 21 | | `-- test_user_add.py 22 | |-- Common --------------------- 配置和功能函数 23 | | |-- config 24 | | | `-- config.ini --------------------- 配置文件, 日志、报告、截图的目录等 25 | | |-- __init__.py 26 | | |-- plugs --------------------- 功能函数 27 | | | |-- basepage.py --------------------- 封装的 webdriver Api (后续可以自己添加,目前只是封装的少许) 28 | | | |-- get_config.py --------------------- 获取配置文件方法 29 | | | |-- get_log.py --------------------- 日志的配置方法 30 | | | |-- __init__.py 31 | |-- Locators --------------------- 测试页面定位 32 | | |-- __init__.py 33 | | |-- LoginLocators --------------------- 登录模块的页面对象定位 34 | | | |-- __init__.py 35 | | | |-- login_locators.py 36 | | `-- UserLocators --------------------- 用户模块的页面对象定位 37 | | |-- __init__.py 38 | | `-- user_locators.py 39 | |-- OutPuts --------------------- 输出 40 | | |-- image --------------------- 截图 41 | | |-- log --------------------- 日志 42 | | `-- reports --------------------- 报告 43 | | `-- report.html 44 | |-- PageObjects ---------------------- 业务流程 45 | | |-- IndexPage ---------------------- 主页模块的页面对象 46 | | | |-- index_page.py 47 | | | |-- __init__.py 48 | | |-- __init__.py 49 | | |-- LoginPage ---------------------- 登录模块的页面对象 50 | | | |-- __init__.py 51 | | | |-- login_page.py 52 | | `-- UserPage ---------------------- 用户模块的页面对象 53 | | |-- __init__.py 54 | | `-- user_page.py 55 | |-- README.md 56 | `-- TestDatas ---------------------- 测试数据 57 | |-- GobalDatas ---------------------- 全局的测试数据 58 | | |-- gobal_datas.py 59 | | |-- __init__.py 60 | |-- __init__.py 61 | |-- LoginDatas ---------------------- 登录模块的正常、异常测试数据 62 | | |-- __init__.py 63 | | |-- login_datas.py 64 | `-- UserDatas ---------------------- 用户模块的正常、异常测试数据 65 | |-- __init__.py 66 | `-- user_add_datas.py 67 | 68 | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 69 | 70 | 以下是简单说明: 71 | 72 | case: pytest的参数化 fixture的使用 conftest全局和本地的配置 73 | Cases/conftest:测试类的前置和后置,单个测试用例的前置和后置 74 | 75 | @pytest.fixture(scope='session') 76 | def project_session_start(): 77 | logger.info("==========开始 XX项目 执行测试===========") 78 | global driver 79 | driver = webdriver.Chrome() 80 | driver.maximize_window() 81 | yield driver 82 | driver.quit() 83 | logger.info("==========结束 XX项目 测试===========") 84 | 85 | 86 | @pytest.fixture(scope='module') 87 | def project_module_start(): 88 | logger.info("==========开始 XX模块 执行测试===========") 89 | global driver 90 | driver = webdriver.Chrome() 91 | driver.maximize_window() 92 | yield driver 93 | driver.quit() 94 | logger.info("==========结束 XX模块 测试===========") 95 | 96 | 97 | 98 | ------------------------------------------------------------------------------------------------------------------------------------- 99 | ------------------------------------------------------------------------------------------------------------------------------------- 100 | 101 | 测试用例:参数的正常和异常用例 102 | 103 | 104 | pytest.mark.usefixtures('start_session') 105 | @pytest.mark.usefixtures('refresh_page') 106 | class TestUserAdd: 107 | 108 | @pytest.mark.smoke 109 | def test_add_user(self, start_session): 110 | logger.info(" 执行 {0} 测试用例 ".format(sys._getframe().f_code.co_name)) 111 | logger.info('正常新增用户测试用例') 112 | start_session[1].add_user(UAD.success_data['username'], UAD.success_data['password'], 113 | UAD.success_data['email'], 114 | UAD.success_data['phone']) 115 | logger.info("期望值:{0}".format(UAD.success_data['Msg'])) 116 | logger.info("实际值:{0}".format(start_session[1].get_add_result_msg())) 117 | try: 118 | assert start_session[1].get_add_result_msg() == UAD.success_data['Msg'] 119 | logger.info(" 结束执行 {0} 测试用例, 测试结果 --- PASS ".format(sys._getframe().f_code.co_name)) 120 | start_session[1].save_pictuer("{0}-正常截图".format(UAD.success_data['name'])) 121 | except: 122 | logger.info(" 结束执行 {0} 测试用例, 测试结果 --- False ".format(sys._getframe().f_code.co_name)) 123 | start_session[1].save_pictuer("{0}-异常截图".format(UAD.success_data['name'])) 124 | raise 125 | 126 | @pytest.mark.parametrize('data', UAD.error_usernameFormat_data) 127 | def test_add_usernameFormat_error(self, data, start_session): 128 | print(" 执行 {0} 测试用例 ".format(sys._getframe().f_code.co_name)) 129 | logger.info(" 异常测试用例:{0} ".format(data['name'])) 130 | start_session[1].add_user(data['username'], data['password'], data['email'], data['phone']) 131 | logger.info("期望值:{0}".format(data['Msg'])) 132 | logger.info("实际值:{0}".format(start_session[1].get_add_result_msg())) 133 | try: 134 | assert start_session[1].get_add_result_msg() == data['Msg'] 135 | logger.info(" 结束执行 {0} 测试用例, 测试结果 --- PASS ".format(sys._getframe().f_code.co_name)) 136 | start_session[1].save_pictuer("{0}-正常截图".format(data['name'])) 137 | except: 138 | logger.info(" 结束执行 {0} 测试用例, 测试结果 --- False ".format(sys._getframe().f_code.co_name)) 139 | start_session[1].save_pictuer("{0}-异常截图".format(data['name'])) 140 | raise 141 | 142 | @pytest.mark.parametrize('data', UAD.error_usernameFormat_data) 143 | def test_add_passwordFormat_error(self, data, start_session): 144 | logger.info(" 执行 {0} 测试用例 ".format(sys._getframe().f_code.co_name)) 145 | logger.info(" 异常测试用例:{0} ".format(data['name'])) 146 | start_session[1].add_user(data['username'], data['password'], data['email'], data['phone']) 147 | logger.info("期望值:{0}".format(data['Msg'])) 148 | logger.info("实际值:{0}".format(start_session[1].get_add_result_msg())) 149 | try: 150 | assert start_session[1].get_add_result_msg() == data['Msg'] 151 | logger.info(" 结束执行 {0} 测试用例, 测试结果 --- PASS ".format(sys._getframe().f_code.co_name)) 152 | start_session[1].save_pictuer("{0}-正常截图".format(data['name'])) 153 | except: 154 | logger.info(" 结束执行 {0} 测试用例, 测试结果 --- False ".format(sys._getframe().f_code.co_name)) 155 | start_session[1].save_pictuer("{0}-异常截图".format(data['name'])) 156 | raise 157 | ------------------------------------------------------------------------------------------------------------------------------------- 158 | ------------------------------------------------------------------------------------------------------------------------------------- 159 | Locators: 160 | #页面的元素 161 | 162 | 163 | class LoginLocator: 164 | username_loc = (By.XPATH, '//*[@id="app"]/div/form/div[1]/div/div/input') 165 | password_loc = (By.XPATH, '//*[@id="app"]/div/form/div[2]/div/div/input') 166 | login_btn_loc = (By.XPATH, '//*[@type="button"]') 167 | error_msg_loc = (By.CLASS_NAME, 'el-message__content') 168 | 169 | ------------------------------------------------------------------------------------------------------------------------------------- 170 | ------------------------------------------------------------------------------------------------------------------------------------- 171 | PageObjects: 172 | # 业务功能流程 173 | 174 | 175 | class LoginPage(BasePage): 176 | 177 | # 登录 178 | def login(self, username, password): 179 | doc = '登录页面_登录功能_查找元素失败' 180 | self.input_element(loc.username_loc, username, doc) 181 | self.input_element(loc.password_loc, password, doc) 182 | self.click_element(loc.login_btn_loc, doc) 183 | 184 | # 获取错误提示 185 | def get_login_errMsg(self): 186 | doc = '登录页面_登录功能错误信息_查找元素失败' 187 | # self.wait_eleVisible(loc.error_msg_loc) 188 | return self.get_element_text(loc.error_msg_loc, doc) 189 | ------------------------------------------------------------------------------------------------------------------------------------- 190 | ------------------------------------------------------------------------------------------------------------------------------------- 191 | TestDatas 192 | # 测试数据 193 | 194 | 195 | # 正常场景测试数据 196 | success_data = {'name': '登录功能-正常测试', 'username': 'admin', 'password': '123456'} 197 | 198 | # 异常场景测试 - username 199 | error_usernameFormat_data = [ 200 | {'name': '登录功能-异常测试-用户名为空', 'username': '', 'password': '123456', 'errorMsg': '参数错误'}, 201 | {'name': '登录功能-异常测试-用户名不存在', 'username': 'xxoo', 'password': '123456', 'errorMsg': '用户名不存在'}, 202 | ] 203 | 204 | # 异常场景测试 - password 205 | error_passwordFormat_data = [ 206 | {'name': '登录功能-异常测试-密码为空', 'username': 'admin', 'password': '', 'errorMsg': '参数错误'}, 207 | {'name': '登录功能-异常测试-密码错误', 'username': 'admin', 'password': '1234567', 'errorMsg': '密码错误'}, 208 | ] 209 | ------------------------------------------------------------------------------------------------------------------------------------- 210 | ------------------------------------------------------------------------------------------------------------------------------------- 211 | -------------------------------------------------------------------------------- /OutPuts/log/2019-10-29.log: -------------------------------------------------------------------------------- 1 | 2019-10-29 12:16:08,280 - root - INFO - ==========开始 XX项目 执行测试=========== 2 | 2019-10-29 12:16:17,443 - root - INFO - ==========开始执行测试用例集=========== 3 | 2019-10-29 12:16:17,445 - root - INFO - ---------------------------------------------------------------------------------- 4 | 2019-10-29 12:16:18,652 - root - INFO - 执行 test_login_usernameFormat_error 测试用例 5 | 2019-10-29 12:16:18,652 - root - INFO - 异常测试用例:登录功能-异常测试-用户名为空 6 | 2019-10-29 12:16:18,652 - root - INFO - 登录页面_登录功能,页面元素:('xpath', '//*[@id="app"]/div/form/div[1]/div/div/input') 输入值 7 | 2019-10-29 12:16:18,672 - root - INFO - 登录页面_登录功能,等待页面元素:('xpath', '//*[@id="app"]/div/form/div[1]/div/div/input'):可见,共耗时0s 8 | 2019-10-29 12:16:18,673 - root - INFO - 登录页面_登录功能,查找页面元素:('xpath', '//*[@id="app"]/div/form/div[1]/div/div/input') 9 | 2019-10-29 12:16:18,688 - root - INFO - 登录页面_登录功能,等待页面元素:('xpath', '//*[@id="app"]/div/form/div[1]/div/div/input'):可见,共耗时0s 10 | 2019-10-29 12:16:18,720 - root - INFO - 登录页面_登录功能,页面元素:('xpath', '//*[@id="app"]/div/form/div[2]/div/div/input') 输入值 123456 11 | 2019-10-29 12:16:18,737 - root - INFO - 登录页面_登录功能,等待页面元素:('xpath', '//*[@id="app"]/div/form/div[2]/div/div/input'):可见,共耗时0s 12 | 2019-10-29 12:16:18,738 - root - INFO - 登录页面_登录功能,查找页面元素:('xpath', '//*[@id="app"]/div/form/div[2]/div/div/input') 13 | 2019-10-29 12:16:18,750 - root - INFO - 登录页面_登录功能,等待页面元素:('xpath', '//*[@id="app"]/div/form/div[2]/div/div/input'):可见,共耗时0s 14 | 2019-10-29 12:16:18,801 - root - INFO - 登录页面_登录功能,点击页面元素:('xpath', '//*[@type="button"]') 15 | 2019-10-29 12:16:18,801 - root - INFO - 登录页面_登录功能,查找页面元素:('xpath', '//*[@type="button"]') 16 | 2019-10-29 12:16:18,816 - root - INFO - 登录页面_登录功能,等待页面元素:('xpath', '//*[@type="button"]'):可见,共耗时0s 17 | 2019-10-29 12:16:18,860 - root - INFO - 期望值:参数错误 18 | 2019-10-29 12:16:18,860 - root - INFO - 登录页面_登录功能错误信息_获取错误信息,获取页面元素:('class name', 'el-message__content') 19 | 2019-10-29 12:16:19,395 - root - INFO - 登录页面_登录功能错误信息_获取错误信息,等待页面元素:('class name', 'el-message__content'):可见,共耗时0s 20 | 2019-10-29 12:16:19,395 - root - INFO - 登录页面_登录功能错误信息_获取错误信息,查找页面元素:('class name', 'el-message__content') 21 | 2019-10-29 12:16:19,407 - root - INFO - 登录页面_登录功能错误信息_获取错误信息,等待页面元素:('class name', 'el-message__content'):可见,共耗时0s 22 | 2019-10-29 12:16:19,421 - root - INFO - 实际值:参数错误 23 | 2019-10-29 12:16:19,421 - root - INFO - 登录页面_登录功能错误信息_获取错误信息,获取页面元素:('class name', 'el-message__content') 24 | 2019-10-29 12:16:19,432 - root - INFO - 登录页面_登录功能错误信息_获取错误信息,等待页面元素:('class name', 'el-message__content'):可见,共耗时0s 25 | 2019-10-29 12:16:19,432 - root - INFO - 登录页面_登录功能错误信息_获取错误信息,查找页面元素:('class name', 'el-message__content') 26 | 2019-10-29 12:16:19,444 - root - INFO - 登录页面_登录功能错误信息_获取错误信息,等待页面元素:('class name', 'el-message__content'):可见,共耗时0s 27 | 2019-10-29 12:16:19,454 - root - INFO - 结束执行 test_login_usernameFormat_error 测试用例, 测试结果 --- PASS 28 | 2019-10-29 12:16:20,173 - root - INFO - 登录功能-异常测试-用户名为空-正常截图截图成功,图片路径为: 登录功能-异常测试-用户名为空-正常截图 29 | 2019-10-29 12:16:23,184 - root - INFO - 执行 test_login_usernameFormat_error 测试用例 30 | 2019-10-29 12:16:23,184 - root - INFO - 异常测试用例:登录功能-异常测试-用户名不存在 31 | 2019-10-29 12:16:23,185 - root - INFO - 登录页面_登录功能,页面元素:('xpath', '//*[@id="app"]/div/form/div[1]/div/div/input') 输入值 xxoo 32 | 2019-10-29 12:16:23,199 - root - INFO - 登录页面_登录功能,等待页面元素:('xpath', '//*[@id="app"]/div/form/div[1]/div/div/input'):可见,共耗时0s 33 | 2019-10-29 12:16:23,199 - root - INFO - 登录页面_登录功能,查找页面元素:('xpath', '//*[@id="app"]/div/form/div[1]/div/div/input') 34 | 2019-10-29 12:16:23,210 - root - INFO - 登录页面_登录功能,等待页面元素:('xpath', '//*[@id="app"]/div/form/div[1]/div/div/input'):可见,共耗时0s 35 | 2019-10-29 12:16:23,252 - root - INFO - 登录页面_登录功能,页面元素:('xpath', '//*[@id="app"]/div/form/div[2]/div/div/input') 输入值 123456 36 | 2019-10-29 12:16:23,265 - root - INFO - 登录页面_登录功能,等待页面元素:('xpath', '//*[@id="app"]/div/form/div[2]/div/div/input'):可见,共耗时0s 37 | 2019-10-29 12:16:23,265 - root - INFO - 登录页面_登录功能,查找页面元素:('xpath', '//*[@id="app"]/div/form/div[2]/div/div/input') 38 | 2019-10-29 12:16:23,276 - root - INFO - 登录页面_登录功能,等待页面元素:('xpath', '//*[@id="app"]/div/form/div[2]/div/div/input'):可见,共耗时0s 39 | 2019-10-29 12:16:23,318 - root - INFO - 登录页面_登录功能,点击页面元素:('xpath', '//*[@type="button"]') 40 | 2019-10-29 12:16:23,318 - root - INFO - 登录页面_登录功能,查找页面元素:('xpath', '//*[@type="button"]') 41 | 2019-10-29 12:16:23,330 - root - INFO - 登录页面_登录功能,等待页面元素:('xpath', '//*[@type="button"]'):可见,共耗时0s 42 | 2019-10-29 12:16:23,377 - root - INFO - 期望值:用户名不存在 43 | 2019-10-29 12:16:23,377 - root - INFO - 登录页面_登录功能错误信息_获取错误信息,获取页面元素:('class name', 'el-message__content') 44 | 2019-10-29 12:16:23,937 - root - INFO - 登录页面_登录功能错误信息_获取错误信息,等待页面元素:('class name', 'el-message__content'):可见,共耗时0s 45 | 2019-10-29 12:16:23,937 - root - INFO - 登录页面_登录功能错误信息_获取错误信息,查找页面元素:('class name', 'el-message__content') 46 | 2019-10-29 12:16:23,950 - root - INFO - 登录页面_登录功能错误信息_获取错误信息,等待页面元素:('class name', 'el-message__content'):可见,共耗时0s 47 | 2019-10-29 12:16:23,966 - root - INFO - 实际值:用户名不存在 48 | 2019-10-29 12:16:23,966 - root - INFO - 登录页面_登录功能错误信息_获取错误信息,获取页面元素:('class name', 'el-message__content') 49 | 2019-10-29 12:16:23,977 - root - INFO - 登录页面_登录功能错误信息_获取错误信息,等待页面元素:('class name', 'el-message__content'):可见,共耗时0s 50 | 2019-10-29 12:16:23,978 - root - INFO - 登录页面_登录功能错误信息_获取错误信息,查找页面元素:('class name', 'el-message__content') 51 | 2019-10-29 12:16:23,988 - root - INFO - 登录页面_登录功能错误信息_获取错误信息,等待页面元素:('class name', 'el-message__content'):可见,共耗时0s 52 | 2019-10-29 12:16:23,999 - root - INFO - 结束执行 test_login_usernameFormat_error 测试用例, 测试结果 --- PASS 53 | 2019-10-29 12:16:24,730 - root - INFO - 登录功能-异常测试-用户名不存在-正常截图截图成功,图片路径为: 登录功能-异常测试-用户名不存在-正常截图 54 | 2019-10-29 12:16:27,742 - root - INFO - 执行 test_login_passwordFormat_error 测试用例 55 | 2019-10-29 12:16:27,742 - root - INFO - 异常测试用例:登录功能-异常测试-密码为空 56 | 2019-10-29 12:16:27,742 - root - INFO - 登录页面_登录功能,页面元素:('xpath', '//*[@id="app"]/div/form/div[1]/div/div/input') 输入值 admin 57 | 2019-10-29 12:16:27,758 - root - INFO - 登录页面_登录功能,等待页面元素:('xpath', '//*[@id="app"]/div/form/div[1]/div/div/input'):可见,共耗时0s 58 | 2019-10-29 12:16:27,758 - root - INFO - 登录页面_登录功能,查找页面元素:('xpath', '//*[@id="app"]/div/form/div[1]/div/div/input') 59 | 2019-10-29 12:16:27,770 - root - INFO - 登录页面_登录功能,等待页面元素:('xpath', '//*[@id="app"]/div/form/div[1]/div/div/input'):可见,共耗时0s 60 | 2019-10-29 12:16:27,814 - root - INFO - 登录页面_登录功能,页面元素:('xpath', '//*[@id="app"]/div/form/div[2]/div/div/input') 输入值 61 | 2019-10-29 12:16:27,827 - root - INFO - 登录页面_登录功能,等待页面元素:('xpath', '//*[@id="app"]/div/form/div[2]/div/div/input'):可见,共耗时0s 62 | 2019-10-29 12:16:27,827 - root - INFO - 登录页面_登录功能,查找页面元素:('xpath', '//*[@id="app"]/div/form/div[2]/div/div/input') 63 | 2019-10-29 12:16:27,839 - root - INFO - 登录页面_登录功能,等待页面元素:('xpath', '//*[@id="app"]/div/form/div[2]/div/div/input'):可见,共耗时0s 64 | 2019-10-29 12:16:27,867 - root - INFO - 登录页面_登录功能,点击页面元素:('xpath', '//*[@type="button"]') 65 | 2019-10-29 12:16:27,867 - root - INFO - 登录页面_登录功能,查找页面元素:('xpath', '//*[@type="button"]') 66 | 2019-10-29 12:16:27,880 - root - INFO - 登录页面_登录功能,等待页面元素:('xpath', '//*[@type="button"]'):可见,共耗时0s 67 | 2019-10-29 12:16:27,925 - root - INFO - 期望值:参数错误 68 | 2019-10-29 12:16:27,925 - root - INFO - 登录页面_登录功能错误信息_获取错误信息,获取页面元素:('class name', 'el-message__content') 69 | 2019-10-29 12:16:28,452 - root - INFO - 登录页面_登录功能错误信息_获取错误信息,等待页面元素:('class name', 'el-message__content'):可见,共耗时0s 70 | 2019-10-29 12:16:28,453 - root - INFO - 登录页面_登录功能错误信息_获取错误信息,查找页面元素:('class name', 'el-message__content') 71 | 2019-10-29 12:16:28,464 - root - INFO - 登录页面_登录功能错误信息_获取错误信息,等待页面元素:('class name', 'el-message__content'):可见,共耗时0s 72 | 2019-10-29 12:16:28,479 - root - INFO - 实际值:参数错误 73 | 2019-10-29 12:16:28,479 - root - INFO - 登录页面_登录功能错误信息_获取错误信息,获取页面元素:('class name', 'el-message__content') 74 | 2019-10-29 12:16:28,491 - root - INFO - 登录页面_登录功能错误信息_获取错误信息,等待页面元素:('class name', 'el-message__content'):可见,共耗时0s 75 | 2019-10-29 12:16:28,491 - root - INFO - 登录页面_登录功能错误信息_获取错误信息,查找页面元素:('class name', 'el-message__content') 76 | 2019-10-29 12:16:28,504 - root - INFO - 登录页面_登录功能错误信息_获取错误信息,等待页面元素:('class name', 'el-message__content'):可见,共耗时0s 77 | 2019-10-29 12:16:28,513 - root - INFO - 结束执行 test_login_passwordFormat_error 测试用例, 测试结果 --- PASS 78 | 2019-10-29 12:16:29,233 - root - INFO - 登录功能-异常测试-密码为空-正常截图截图成功,图片路径为: 登录功能-异常测试-密码为空-正常截图 79 | 2019-10-29 12:16:32,358 - root - INFO - 执行 test_login_passwordFormat_error 测试用例 80 | 2019-10-29 12:16:32,358 - root - INFO - 异常测试用例:登录功能-异常测试-密码错误 81 | 2019-10-29 12:16:32,358 - root - INFO - 登录页面_登录功能,页面元素:('xpath', '//*[@id="app"]/div/form/div[1]/div/div/input') 输入值 admin 82 | 2019-10-29 12:16:32,372 - root - INFO - 登录页面_登录功能,等待页面元素:('xpath', '//*[@id="app"]/div/form/div[1]/div/div/input'):可见,共耗时0s 83 | 2019-10-29 12:16:32,372 - root - INFO - 登录页面_登录功能,查找页面元素:('xpath', '//*[@id="app"]/div/form/div[1]/div/div/input') 84 | 2019-10-29 12:16:32,385 - root - INFO - 登录页面_登录功能,等待页面元素:('xpath', '//*[@id="app"]/div/form/div[1]/div/div/input'):可见,共耗时0s 85 | 2019-10-29 12:16:32,428 - root - INFO - 登录页面_登录功能,页面元素:('xpath', '//*[@id="app"]/div/form/div[2]/div/div/input') 输入值 1234567 86 | 2019-10-29 12:16:32,441 - root - INFO - 登录页面_登录功能,等待页面元素:('xpath', '//*[@id="app"]/div/form/div[2]/div/div/input'):可见,共耗时0s 87 | 2019-10-29 12:16:32,442 - root - INFO - 登录页面_登录功能,查找页面元素:('xpath', '//*[@id="app"]/div/form/div[2]/div/div/input') 88 | 2019-10-29 12:16:32,455 - root - INFO - 登录页面_登录功能,等待页面元素:('xpath', '//*[@id="app"]/div/form/div[2]/div/div/input'):可见,共耗时0s 89 | 2019-10-29 12:16:32,500 - root - INFO - 登录页面_登录功能,点击页面元素:('xpath', '//*[@type="button"]') 90 | 2019-10-29 12:16:32,500 - root - INFO - 登录页面_登录功能,查找页面元素:('xpath', '//*[@type="button"]') 91 | 2019-10-29 12:16:32,512 - root - INFO - 登录页面_登录功能,等待页面元素:('xpath', '//*[@type="button"]'):可见,共耗时0s 92 | 2019-10-29 12:16:32,559 - root - INFO - 期望值:密码错误 93 | 2019-10-29 12:16:32,559 - root - INFO - 登录页面_登录功能错误信息_获取错误信息,获取页面元素:('class name', 'el-message__content') 94 | 2019-10-29 12:16:33,078 - root - INFO - 登录页面_登录功能错误信息_获取错误信息,等待页面元素:('class name', 'el-message__content'):可见,共耗时0s 95 | 2019-10-29 12:16:33,078 - root - INFO - 登录页面_登录功能错误信息_获取错误信息,查找页面元素:('class name', 'el-message__content') 96 | 2019-10-29 12:16:33,089 - root - INFO - 登录页面_登录功能错误信息_获取错误信息,等待页面元素:('class name', 'el-message__content'):可见,共耗时0s 97 | 2019-10-29 12:16:33,103 - root - INFO - 实际值:密码错误 98 | 2019-10-29 12:16:33,104 - root - INFO - 登录页面_登录功能错误信息_获取错误信息,获取页面元素:('class name', 'el-message__content') 99 | 2019-10-29 12:16:33,116 - root - INFO - 登录页面_登录功能错误信息_获取错误信息,等待页面元素:('class name', 'el-message__content'):可见,共耗时0s 100 | 2019-10-29 12:16:33,116 - root - INFO - 登录页面_登录功能错误信息_获取错误信息,查找页面元素:('class name', 'el-message__content') 101 | 2019-10-29 12:16:33,128 - root - INFO - 登录页面_登录功能错误信息_获取错误信息,等待页面元素:('class name', 'el-message__content'):可见,共耗时0s 102 | 2019-10-29 12:16:33,138 - root - INFO - 结束执行 test_login_passwordFormat_error 测试用例, 测试结果 --- PASS 103 | 2019-10-29 12:16:33,864 - root - INFO - 登录功能-异常测试-密码错误-正常截图截图成功,图片路径为: 登录功能-异常测试-密码错误-正常截图 104 | 2019-10-29 12:16:36,993 - root - INFO - 执行 test_login_success 测试用例 105 | 2019-10-29 12:16:36,993 - root - INFO - 正常登录测试用例 106 | 2019-10-29 12:16:36,993 - root - INFO - 登录页面_登录功能,页面元素:('xpath', '//*[@id="app"]/div/form/div[1]/div/div/input') 输入值 admin 107 | 2019-10-29 12:16:37,009 - root - INFO - 登录页面_登录功能,等待页面元素:('xpath', '//*[@id="app"]/div/form/div[1]/div/div/input'):可见,共耗时0s 108 | 2019-10-29 12:16:37,009 - root - INFO - 登录页面_登录功能,查找页面元素:('xpath', '//*[@id="app"]/div/form/div[1]/div/div/input') 109 | 2019-10-29 12:16:37,021 - root - INFO - 登录页面_登录功能,等待页面元素:('xpath', '//*[@id="app"]/div/form/div[1]/div/div/input'):可见,共耗时0s 110 | 2019-10-29 12:16:37,063 - root - INFO - 登录页面_登录功能,页面元素:('xpath', '//*[@id="app"]/div/form/div[2]/div/div/input') 输入值 123456 111 | 2019-10-29 12:16:37,075 - root - INFO - 登录页面_登录功能,等待页面元素:('xpath', '//*[@id="app"]/div/form/div[2]/div/div/input'):可见,共耗时0s 112 | 2019-10-29 12:16:37,075 - root - INFO - 登录页面_登录功能,查找页面元素:('xpath', '//*[@id="app"]/div/form/div[2]/div/div/input') 113 | 2019-10-29 12:16:37,087 - root - INFO - 登录页面_登录功能,等待页面元素:('xpath', '//*[@id="app"]/div/form/div[2]/div/div/input'):可见,共耗时0s 114 | 2019-10-29 12:16:37,130 - root - INFO - 登录页面_登录功能,点击页面元素:('xpath', '//*[@type="button"]') 115 | 2019-10-29 12:16:37,130 - root - INFO - 登录页面_登录功能,查找页面元素:('xpath', '//*[@type="button"]') 116 | 2019-10-29 12:16:37,142 - root - INFO - 登录页面_登录功能,等待页面元素:('xpath', '//*[@type="button"]'):可见,共耗时0s 117 | 2019-10-29 12:16:37,175 - root - INFO - 期望值:True 118 | 2019-10-29 12:16:37,698 - root - INFO - 实际值:True 119 | 2019-10-29 12:16:37,710 - root - INFO - 结束执行 test_login_success 测试用例, 测试结果 --- PASS 120 | 2019-10-29 12:16:37,972 - root - INFO - 登录功能-正常测试-正常截图截图成功,图片路径为: 登录功能-正常测试-正常截图 121 | 2019-10-29 12:16:41,091 - root - INFO - ==========结束执行测试用例集=========== 122 | 2019-10-29 12:16:41,109 - root - INFO - ==========开始执行测试用例集=========== 123 | 2019-10-29 12:16:41,109 - root - INFO - ---------------------------------------------------------------------------------- 124 | 2019-10-29 12:16:41,133 - root - INFO - 登录页面_登录功能,页面元素:('xpath', '//*[@id="app"]/div/form/div[1]/div/div/input') 输入值 admin 125 | 2019-10-29 12:16:41,148 - root - INFO - 登录页面_登录功能,等待页面元素:('xpath', '//*[@id="app"]/div/form/div[1]/div/div/input'):可见,共耗时0s 126 | 2019-10-29 12:16:41,148 - root - INFO - 登录页面_登录功能,查找页面元素:('xpath', '//*[@id="app"]/div/form/div[1]/div/div/input') 127 | 2019-10-29 12:16:41,161 - root - INFO - 登录页面_登录功能,等待页面元素:('xpath', '//*[@id="app"]/div/form/div[1]/div/div/input'):可见,共耗时0s 128 | 2019-10-29 12:16:41,204 - root - INFO - 登录页面_登录功能,页面元素:('xpath', '//*[@id="app"]/div/form/div[2]/div/div/input') 输入值 123456 129 | 2019-10-29 12:16:41,216 - root - INFO - 登录页面_登录功能,等待页面元素:('xpath', '//*[@id="app"]/div/form/div[2]/div/div/input'):可见,共耗时0s 130 | 2019-10-29 12:16:41,216 - root - INFO - 登录页面_登录功能,查找页面元素:('xpath', '//*[@id="app"]/div/form/div[2]/div/div/input') 131 | 2019-10-29 12:16:41,228 - root - INFO - 登录页面_登录功能,等待页面元素:('xpath', '//*[@id="app"]/div/form/div[2]/div/div/input'):可见,共耗时0s 132 | 2019-10-29 12:16:41,273 - root - INFO - 登录页面_登录功能,点击页面元素:('xpath', '//*[@type="button"]') 133 | 2019-10-29 12:16:41,273 - root - INFO - 登录页面_登录功能,查找页面元素:('xpath', '//*[@type="button"]') 134 | 2019-10-29 12:16:41,286 - root - INFO - 登录页面_登录功能,等待页面元素:('xpath', '//*[@type="button"]'):可见,共耗时0s 135 | 2019-10-29 12:16:43,425 - root - INFO - 执行 test_add_user 测试用例 136 | 2019-10-29 12:16:43,425 - root - INFO - 正常新增用户测试用例 137 | 2019-10-29 12:16:43,425 - root - INFO - 用户列表页面_新增用户功能,点击页面元素:('xpath', '//span[text()="添加按钮"]') 138 | 2019-10-29 12:16:43,425 - root - INFO - 用户列表页面_新增用户功能,查找页面元素:('xpath', '//span[text()="添加按钮"]') 139 | 2019-10-29 12:16:43,461 - root - INFO - 用户列表页面_新增用户功能,等待页面元素:('xpath', '//span[text()="添加按钮"]'):可见,共耗时0s 140 | 2019-10-29 12:16:43,538 - root - INFO - 用户列表页面_新增用户功能,页面元素:('xpath', '//div[@aria-label="添加用户"]/div[@class="el-dialog__body"]/form/div[1]//input') 输入值 haha 141 | 2019-10-29 12:16:44,069 - root - INFO - 用户列表页面_新增用户功能,等待页面元素:('xpath', '//div[@aria-label="添加用户"]/div[@class="el-dialog__body"]/form/div[1]//input'):可见,共耗时0s 142 | 2019-10-29 12:16:44,070 - root - INFO - 用户列表页面_新增用户功能,查找页面元素:('xpath', '//div[@aria-label="添加用户"]/div[@class="el-dialog__body"]/form/div[1]//input') 143 | 2019-10-29 12:16:44,082 - root - INFO - 用户列表页面_新增用户功能,等待页面元素:('xpath', '//div[@aria-label="添加用户"]/div[@class="el-dialog__body"]/form/div[1]//input'):可见,共耗时0s 144 | 2019-10-29 12:16:44,141 - root - INFO - 用户列表页面_新增用户功能,页面元素:('xpath', '//*[@id="app"]/section/section/main/div/div/div[5]/div/div[2]/form/div[2]/div/div/input') 输入值 123456 145 | 2019-10-29 12:16:44,162 - root - INFO - 用户列表页面_新增用户功能,等待页面元素:('xpath', '//*[@id="app"]/section/section/main/div/div/div[5]/div/div[2]/form/div[2]/div/div/input'):可见,共耗时0s 146 | 2019-10-29 12:16:44,162 - root - INFO - 用户列表页面_新增用户功能,查找页面元素:('xpath', '//*[@id="app"]/section/section/main/div/div/div[5]/div/div[2]/form/div[2]/div/div/input') 147 | 2019-10-29 12:16:44,189 - root - INFO - 用户列表页面_新增用户功能,等待页面元素:('xpath', '//*[@id="app"]/section/section/main/div/div/div[5]/div/div[2]/form/div[2]/div/div/input'):可见,共耗时0s 148 | 2019-10-29 12:16:44,266 - root - INFO - 用户列表页面_新增用户功能,页面元素:('xpath', '//*[@id="app"]/section/section/main/div/div/div[5]/div/div[2]/form/div[3]/div/div/input') 输入值 123@qq.com 149 | 2019-10-29 12:16:44,282 - root - INFO - 用户列表页面_新增用户功能,等待页面元素:('xpath', '//*[@id="app"]/section/section/main/div/div/div[5]/div/div[2]/form/div[3]/div/div/input'):可见,共耗时0s 150 | 2019-10-29 12:16:44,282 - root - INFO - 用户列表页面_新增用户功能,查找页面元素:('xpath', '//*[@id="app"]/section/section/main/div/div/div[5]/div/div[2]/form/div[3]/div/div/input') 151 | 2019-10-29 12:16:44,295 - root - INFO - 用户列表页面_新增用户功能,等待页面元素:('xpath', '//*[@id="app"]/section/section/main/div/div/div[5]/div/div[2]/form/div[3]/div/div/input'):可见,共耗时0s 152 | 2019-10-29 12:16:44,389 - root - INFO - 用户列表页面_新增用户功能,页面元素:('xpath', '//*[@id="app"]/section/section/main/div/div/div[5]/div/div[2]/form/div[4]/div/div/input') 输入值 13776787676 153 | 2019-10-29 12:16:44,404 - root - INFO - 用户列表页面_新增用户功能,等待页面元素:('xpath', '//*[@id="app"]/section/section/main/div/div/div[5]/div/div[2]/form/div[4]/div/div/input'):可见,共耗时0s 154 | 2019-10-29 12:16:44,405 - root - INFO - 用户列表页面_新增用户功能,查找页面元素:('xpath', '//*[@id="app"]/section/section/main/div/div/div[5]/div/div[2]/form/div[4]/div/div/input') 155 | 2019-10-29 12:16:44,417 - root - INFO - 用户列表页面_新增用户功能,等待页面元素:('xpath', '//*[@id="app"]/section/section/main/div/div/div[5]/div/div[2]/form/div[4]/div/div/input'):可见,共耗时0s 156 | 2019-10-29 12:16:44,508 - root - INFO - 用户列表页面_新增用户功能,点击页面元素:('xpath', '//*[@id="app"]/section/section/main/div/div/div[5]/div/div[3]/div/button[2]') 157 | 2019-10-29 12:16:44,508 - root - INFO - 用户列表页面_新增用户功能,查找页面元素:('xpath', '//*[@id="app"]/section/section/main/div/div/div[5]/div/div[3]/div/button[2]') 158 | 2019-10-29 12:16:44,525 - root - INFO - 用户列表页面_新增用户功能,等待页面元素:('xpath', '//*[@id="app"]/section/section/main/div/div/div[5]/div/div[3]/div/button[2]'):可见,共耗时0s 159 | 2019-10-29 12:16:44,557 - root - INFO - 期望值:创建成功 160 | 2019-10-29 12:16:44,558 - root - INFO - 用户列表页面_新增用户功能_获取新增结果信息,获取页面元素:('xpath', '//div[@role="alert"]/p[@class="el-message__content"]') 161 | 2019-10-29 12:16:45,100 - root - INFO - 用户列表页面_新增用户功能_获取新增结果信息,等待页面元素:('xpath', '//div[@role="alert"]/p[@class="el-message__content"]'):可见,共耗时0s 162 | 2019-10-29 12:16:45,101 - root - INFO - 用户列表页面_新增用户功能_获取新增结果信息,查找页面元素:('xpath', '//div[@role="alert"]/p[@class="el-message__content"]') 163 | 2019-10-29 12:16:45,114 - root - INFO - 用户列表页面_新增用户功能_获取新增结果信息,等待页面元素:('xpath', '//div[@role="alert"]/p[@class="el-message__content"]'):可见,共耗时0s 164 | 2019-10-29 12:16:45,130 - root - INFO - 实际值:创建成功 165 | 2019-10-29 12:16:45,131 - root - INFO - 用户列表页面_新增用户功能_获取新增结果信息,获取页面元素:('xpath', '//div[@role="alert"]/p[@class="el-message__content"]') 166 | 2019-10-29 12:16:45,142 - root - INFO - 用户列表页面_新增用户功能_获取新增结果信息,等待页面元素:('xpath', '//div[@role="alert"]/p[@class="el-message__content"]'):可见,共耗时0s 167 | 2019-10-29 12:16:45,143 - root - INFO - 用户列表页面_新增用户功能_获取新增结果信息,查找页面元素:('xpath', '//div[@role="alert"]/p[@class="el-message__content"]') 168 | 2019-10-29 12:16:45,154 - root - INFO - 用户列表页面_新增用户功能_获取新增结果信息,等待页面元素:('xpath', '//div[@role="alert"]/p[@class="el-message__content"]'):可见,共耗时0s 169 | 2019-10-29 12:16:45,164 - root - INFO - 结束执行 test_add_user 测试用例, 测试结果 --- PASS 170 | 2019-10-29 12:16:45,430 - root - INFO - 新增用户功能-正常测试-正常截图截图成功,图片路径为: 新增用户功能-正常测试-正常截图 171 | 2019-10-29 12:16:48,443 - root - INFO - 异常测试用例:新增用户功能-异常测试-用户已存在 172 | 2019-10-29 12:16:48,443 - root - INFO - 用户列表页面_新增用户功能,点击页面元素:('xpath', '//span[text()="添加按钮"]') 173 | 2019-10-29 12:16:48,443 - root - INFO - 用户列表页面_新增用户功能,查找页面元素:('xpath', '//span[text()="添加按钮"]') 174 | 2019-10-29 12:16:48,456 - root - INFO - 用户列表页面_新增用户功能,等待页面元素:('xpath', '//span[text()="添加按钮"]'):可见,共耗时0s 175 | 2019-10-29 12:16:48,488 - root - INFO - 用户列表页面_新增用户功能,页面元素:('xpath', '//div[@aria-label="添加用户"]/div[@class="el-dialog__body"]/form/div[1]//input') 输入值 haha 176 | 2019-10-29 12:16:49,018 - root - INFO - 用户列表页面_新增用户功能,等待页面元素:('xpath', '//div[@aria-label="添加用户"]/div[@class="el-dialog__body"]/form/div[1]//input'):可见,共耗时0s 177 | 2019-10-29 12:16:49,018 - root - INFO - 用户列表页面_新增用户功能,查找页面元素:('xpath', '//div[@aria-label="添加用户"]/div[@class="el-dialog__body"]/form/div[1]//input') 178 | 2019-10-29 12:16:49,030 - root - INFO - 用户列表页面_新增用户功能,等待页面元素:('xpath', '//div[@aria-label="添加用户"]/div[@class="el-dialog__body"]/form/div[1]//input'):可见,共耗时0s 179 | 2019-10-29 12:16:49,073 - root - INFO - 用户列表页面_新增用户功能,页面元素:('xpath', '//*[@id="app"]/section/section/main/div/div/div[5]/div/div[2]/form/div[2]/div/div/input') 输入值 123456 180 | 2019-10-29 12:16:49,087 - root - INFO - 用户列表页面_新增用户功能,等待页面元素:('xpath', '//*[@id="app"]/section/section/main/div/div/div[5]/div/div[2]/form/div[2]/div/div/input'):可见,共耗时0s 181 | 2019-10-29 12:16:49,087 - root - INFO - 用户列表页面_新增用户功能,查找页面元素:('xpath', '//*[@id="app"]/section/section/main/div/div/div[5]/div/div[2]/form/div[2]/div/div/input') 182 | 2019-10-29 12:16:49,100 - root - INFO - 用户列表页面_新增用户功能,等待页面元素:('xpath', '//*[@id="app"]/section/section/main/div/div/div[5]/div/div[2]/form/div[2]/div/div/input'):可见,共耗时0s 183 | 2019-10-29 12:16:49,169 - root - INFO - 用户列表页面_新增用户功能,页面元素:('xpath', '//*[@id="app"]/section/section/main/div/div/div[5]/div/div[2]/form/div[3]/div/div/input') 输入值 123@qq.com 184 | 2019-10-29 12:16:49,180 - root - INFO - 用户列表页面_新增用户功能,等待页面元素:('xpath', '//*[@id="app"]/section/section/main/div/div/div[5]/div/div[2]/form/div[3]/div/div/input'):可见,共耗时0s 185 | 2019-10-29 12:16:49,180 - root - INFO - 用户列表页面_新增用户功能,查找页面元素:('xpath', '//*[@id="app"]/section/section/main/div/div/div[5]/div/div[2]/form/div[3]/div/div/input') 186 | 2019-10-29 12:16:49,191 - root - INFO - 用户列表页面_新增用户功能,等待页面元素:('xpath', '//*[@id="app"]/section/section/main/div/div/div[5]/div/div[2]/form/div[3]/div/div/input'):可见,共耗时0s 187 | 2019-10-29 12:16:49,259 - root - INFO - 用户列表页面_新增用户功能,页面元素:('xpath', '//*[@id="app"]/section/section/main/div/div/div[5]/div/div[2]/form/div[4]/div/div/input') 输入值 13776787676 188 | 2019-10-29 12:16:49,273 - root - INFO - 用户列表页面_新增用户功能,等待页面元素:('xpath', '//*[@id="app"]/section/section/main/div/div/div[5]/div/div[2]/form/div[4]/div/div/input'):可见,共耗时0s 189 | 2019-10-29 12:16:49,273 - root - INFO - 用户列表页面_新增用户功能,查找页面元素:('xpath', '//*[@id="app"]/section/section/main/div/div/div[5]/div/div[2]/form/div[4]/div/div/input') 190 | 2019-10-29 12:16:49,284 - root - INFO - 用户列表页面_新增用户功能,等待页面元素:('xpath', '//*[@id="app"]/section/section/main/div/div/div[5]/div/div[2]/form/div[4]/div/div/input'):可见,共耗时0s 191 | 2019-10-29 12:16:49,362 - root - INFO - 用户列表页面_新增用户功能,点击页面元素:('xpath', '//*[@id="app"]/section/section/main/div/div/div[5]/div/div[3]/div/button[2]') 192 | 2019-10-29 12:16:49,363 - root - INFO - 用户列表页面_新增用户功能,查找页面元素:('xpath', '//*[@id="app"]/section/section/main/div/div/div[5]/div/div[3]/div/button[2]') 193 | 2019-10-29 12:16:49,374 - root - INFO - 用户列表页面_新增用户功能,等待页面元素:('xpath', '//*[@id="app"]/section/section/main/div/div/div[5]/div/div[3]/div/button[2]'):可见,共耗时0s 194 | 2019-10-29 12:16:49,408 - root - INFO - 期望值:用户名已存在 195 | 2019-10-29 12:16:49,409 - root - INFO - 用户列表页面_新增用户功能_获取新增结果信息,获取页面元素:('xpath', '//div[@role="alert"]/p[@class="el-message__content"]') 196 | 2019-10-29 12:16:49,932 - root - INFO - 用户列表页面_新增用户功能_获取新增结果信息,等待页面元素:('xpath', '//div[@role="alert"]/p[@class="el-message__content"]'):可见,共耗时0s 197 | 2019-10-29 12:16:49,932 - root - INFO - 用户列表页面_新增用户功能_获取新增结果信息,查找页面元素:('xpath', '//div[@role="alert"]/p[@class="el-message__content"]') 198 | 2019-10-29 12:16:49,944 - root - INFO - 用户列表页面_新增用户功能_获取新增结果信息,等待页面元素:('xpath', '//div[@role="alert"]/p[@class="el-message__content"]'):可见,共耗时0s 199 | 2019-10-29 12:16:49,958 - root - INFO - 实际值:用户名已存在 200 | 2019-10-29 12:16:49,958 - root - INFO - 用户列表页面_新增用户功能_获取新增结果信息,获取页面元素:('xpath', '//div[@role="alert"]/p[@class="el-message__content"]') 201 | 2019-10-29 12:16:49,970 - root - INFO - 用户列表页面_新增用户功能_获取新增结果信息,等待页面元素:('xpath', '//div[@role="alert"]/p[@class="el-message__content"]'):可见,共耗时0s 202 | 2019-10-29 12:16:49,970 - root - INFO - 用户列表页面_新增用户功能_获取新增结果信息,查找页面元素:('xpath', '//div[@role="alert"]/p[@class="el-message__content"]') 203 | 2019-10-29 12:16:49,983 - root - INFO - 用户列表页面_新增用户功能_获取新增结果信息,等待页面元素:('xpath', '//div[@role="alert"]/p[@class="el-message__content"]'):可见,共耗时0s 204 | 2019-10-29 12:16:49,992 - root - INFO - 结束执行 test_add_usernameFormat_error 测试用例, 测试结果 --- PASS 205 | 2019-10-29 12:16:50,279 - root - INFO - 新增用户功能-异常测试-用户已存在-正常截图截图成功,图片路径为: 新增用户功能-异常测试-用户已存在-正常截图 206 | 2019-10-29 12:16:53,287 - root - INFO - 异常测试用例:新增用户功能-异常测试-用户名为空 207 | 2019-10-29 12:16:53,288 - root - INFO - 用户列表页面_新增用户功能,点击页面元素:('xpath', '//span[text()="添加按钮"]') 208 | 2019-10-29 12:16:53,288 - root - INFO - 用户列表页面_新增用户功能,查找页面元素:('xpath', '//span[text()="添加按钮"]') 209 | 2019-10-29 12:16:53,301 - root - INFO - 用户列表页面_新增用户功能,等待页面元素:('xpath', '//span[text()="添加按钮"]'):可见,共耗时0s 210 | 2019-10-29 12:16:53,328 - root - INFO - 用户列表页面_新增用户功能,页面元素:('xpath', '//div[@aria-label="添加用户"]/div[@class="el-dialog__body"]/form/div[1]//input') 输入值 211 | 2019-10-29 12:16:53,341 - root - INFO - 用户列表页面_新增用户功能,等待页面元素:('xpath', '//div[@aria-label="添加用户"]/div[@class="el-dialog__body"]/form/div[1]//input'):可见,共耗时0s 212 | 2019-10-29 12:16:53,341 - root - INFO - 用户列表页面_新增用户功能,查找页面元素:('xpath', '//div[@aria-label="添加用户"]/div[@class="el-dialog__body"]/form/div[1]//input') 213 | 2019-10-29 12:16:53,353 - root - INFO - 用户列表页面_新增用户功能,等待页面元素:('xpath', '//div[@aria-label="添加用户"]/div[@class="el-dialog__body"]/form/div[1]//input'):可见,共耗时0s 214 | 2019-10-29 12:16:53,374 - root - INFO - 用户列表页面_新增用户功能,页面元素:('xpath', '//*[@id="app"]/section/section/main/div/div/div[5]/div/div[2]/form/div[2]/div/div/input') 输入值 123456 215 | 2019-10-29 12:16:53,385 - root - INFO - 用户列表页面_新增用户功能,等待页面元素:('xpath', '//*[@id="app"]/section/section/main/div/div/div[5]/div/div[2]/form/div[2]/div/div/input'):可见,共耗时0s 216 | 2019-10-29 12:16:53,386 - root - INFO - 用户列表页面_新增用户功能,查找页面元素:('xpath', '//*[@id="app"]/section/section/main/div/div/div[5]/div/div[2]/form/div[2]/div/div/input') 217 | 2019-10-29 12:16:53,399 - root - INFO - 用户列表页面_新增用户功能,等待页面元素:('xpath', '//*[@id="app"]/section/section/main/div/div/div[5]/div/div[2]/form/div[2]/div/div/input'):可见,共耗时0s 218 | 2019-10-29 12:16:53,452 - root - INFO - 用户列表页面_新增用户功能,页面元素:('xpath', '//*[@id="app"]/section/section/main/div/div/div[5]/div/div[2]/form/div[3]/div/div/input') 输入值 123@qq.com 219 | 2019-10-29 12:16:53,463 - root - INFO - 用户列表页面_新增用户功能,等待页面元素:('xpath', '//*[@id="app"]/section/section/main/div/div/div[5]/div/div[2]/form/div[3]/div/div/input'):可见,共耗时0s 220 | 2019-10-29 12:16:53,464 - root - INFO - 用户列表页面_新增用户功能,查找页面元素:('xpath', '//*[@id="app"]/section/section/main/div/div/div[5]/div/div[2]/form/div[3]/div/div/input') 221 | 2019-10-29 12:16:53,475 - root - INFO - 用户列表页面_新增用户功能,等待页面元素:('xpath', '//*[@id="app"]/section/section/main/div/div/div[5]/div/div[2]/form/div[3]/div/div/input'):可见,共耗时0s 222 | 2019-10-29 12:16:53,547 - root - INFO - 用户列表页面_新增用户功能,页面元素:('xpath', '//*[@id="app"]/section/section/main/div/div/div[5]/div/div[2]/form/div[4]/div/div/input') 输入值 13776787676 223 | 2019-10-29 12:16:53,559 - root - INFO - 用户列表页面_新增用户功能,等待页面元素:('xpath', '//*[@id="app"]/section/section/main/div/div/div[5]/div/div[2]/form/div[4]/div/div/input'):可见,共耗时0s 224 | 2019-10-29 12:16:53,559 - root - INFO - 用户列表页面_新增用户功能,查找页面元素:('xpath', '//*[@id="app"]/section/section/main/div/div/div[5]/div/div[2]/form/div[4]/div/div/input') 225 | 2019-10-29 12:16:53,571 - root - INFO - 用户列表页面_新增用户功能,等待页面元素:('xpath', '//*[@id="app"]/section/section/main/div/div/div[5]/div/div[2]/form/div[4]/div/div/input'):可见,共耗时0s 226 | 2019-10-29 12:16:53,667 - root - INFO - 用户列表页面_新增用户功能,点击页面元素:('xpath', '//*[@id="app"]/section/section/main/div/div/div[5]/div/div[3]/div/button[2]') 227 | 2019-10-29 12:16:53,668 - root - INFO - 用户列表页面_新增用户功能,查找页面元素:('xpath', '//*[@id="app"]/section/section/main/div/div/div[5]/div/div[3]/div/button[2]') 228 | 2019-10-29 12:16:53,680 - root - INFO - 用户列表页面_新增用户功能,等待页面元素:('xpath', '//*[@id="app"]/section/section/main/div/div/div[5]/div/div[3]/div/button[2]'):可见,共耗时0s 229 | 2019-10-29 12:16:53,709 - root - INFO - 期望值:用户名不能为空 230 | 2019-10-29 12:16:53,709 - root - INFO - 用户列表页面_新增用户功能_获取新增结果信息,获取页面元素:('xpath', '//div[@role="alert"]/p[@class="el-message__content"]') 231 | 2019-10-29 12:16:54,238 - root - INFO - 用户列表页面_新增用户功能_获取新增结果信息,等待页面元素:('xpath', '//div[@role="alert"]/p[@class="el-message__content"]'):可见,共耗时0s 232 | 2019-10-29 12:16:54,238 - root - INFO - 用户列表页面_新增用户功能_获取新增结果信息,查找页面元素:('xpath', '//div[@role="alert"]/p[@class="el-message__content"]') 233 | 2019-10-29 12:16:54,249 - root - INFO - 用户列表页面_新增用户功能_获取新增结果信息,等待页面元素:('xpath', '//div[@role="alert"]/p[@class="el-message__content"]'):可见,共耗时0s 234 | 2019-10-29 12:16:54,263 - root - INFO - 实际值:用户名不能为空 235 | 2019-10-29 12:16:54,264 - root - INFO - 用户列表页面_新增用户功能_获取新增结果信息,获取页面元素:('xpath', '//div[@role="alert"]/p[@class="el-message__content"]') 236 | 2019-10-29 12:16:54,275 - root - INFO - 用户列表页面_新增用户功能_获取新增结果信息,等待页面元素:('xpath', '//div[@role="alert"]/p[@class="el-message__content"]'):可见,共耗时0s 237 | 2019-10-29 12:16:54,275 - root - INFO - 用户列表页面_新增用户功能_获取新增结果信息,查找页面元素:('xpath', '//div[@role="alert"]/p[@class="el-message__content"]') 238 | 2019-10-29 12:16:54,287 - root - INFO - 用户列表页面_新增用户功能_获取新增结果信息,等待页面元素:('xpath', '//div[@role="alert"]/p[@class="el-message__content"]'):可见,共耗时0s 239 | 2019-10-29 12:16:54,296 - root - INFO - 结束执行 test_add_usernameFormat_error 测试用例, 测试结果 --- PASS 240 | 2019-10-29 12:16:54,577 - root - INFO - 新增用户功能-异常测试-用户名为空-正常截图截图成功,图片路径为: 新增用户功能-异常测试-用户名为空-正常截图 241 | 2019-10-29 12:16:58,001 - root - INFO - 执行 test_add_passwordFormat_error 测试用例 242 | 2019-10-29 12:16:58,001 - root - INFO - 异常测试用例:新增用户功能-异常测试-用户已存在 243 | 2019-10-29 12:16:58,002 - root - INFO - 用户列表页面_新增用户功能,点击页面元素:('xpath', '//span[text()="添加按钮"]') 244 | 2019-10-29 12:16:58,002 - root - INFO - 用户列表页面_新增用户功能,查找页面元素:('xpath', '//span[text()="添加按钮"]') 245 | 2019-10-29 12:16:58,019 - root - INFO - 用户列表页面_新增用户功能,等待页面元素:('xpath', '//span[text()="添加按钮"]'):可见,共耗时0s 246 | 2019-10-29 12:16:58,049 - root - INFO - 用户列表页面_新增用户功能,页面元素:('xpath', '//div[@aria-label="添加用户"]/div[@class="el-dialog__body"]/form/div[1]//input') 输入值 haha 247 | 2019-10-29 12:16:58,576 - root - INFO - 用户列表页面_新增用户功能,等待页面元素:('xpath', '//div[@aria-label="添加用户"]/div[@class="el-dialog__body"]/form/div[1]//input'):可见,共耗时0s 248 | 2019-10-29 12:16:58,577 - root - INFO - 用户列表页面_新增用户功能,查找页面元素:('xpath', '//div[@aria-label="添加用户"]/div[@class="el-dialog__body"]/form/div[1]//input') 249 | 2019-10-29 12:16:58,588 - root - INFO - 用户列表页面_新增用户功能,等待页面元素:('xpath', '//div[@aria-label="添加用户"]/div[@class="el-dialog__body"]/form/div[1]//input'):可见,共耗时0s 250 | 2019-10-29 12:16:58,628 - root - INFO - 用户列表页面_新增用户功能,页面元素:('xpath', '//*[@id="app"]/section/section/main/div/div/div[5]/div/div[2]/form/div[2]/div/div/input') 输入值 123456 251 | 2019-10-29 12:16:58,641 - root - INFO - 用户列表页面_新增用户功能,等待页面元素:('xpath', '//*[@id="app"]/section/section/main/div/div/div[5]/div/div[2]/form/div[2]/div/div/input'):可见,共耗时0s 252 | 2019-10-29 12:16:58,641 - root - INFO - 用户列表页面_新增用户功能,查找页面元素:('xpath', '//*[@id="app"]/section/section/main/div/div/div[5]/div/div[2]/form/div[2]/div/div/input') 253 | 2019-10-29 12:16:58,652 - root - INFO - 用户列表页面_新增用户功能,等待页面元素:('xpath', '//*[@id="app"]/section/section/main/div/div/div[5]/div/div[2]/form/div[2]/div/div/input'):可见,共耗时0s 254 | 2019-10-29 12:16:58,704 - root - INFO - 用户列表页面_新增用户功能,页面元素:('xpath', '//*[@id="app"]/section/section/main/div/div/div[5]/div/div[2]/form/div[3]/div/div/input') 输入值 123@qq.com 255 | 2019-10-29 12:16:58,716 - root - INFO - 用户列表页面_新增用户功能,等待页面元素:('xpath', '//*[@id="app"]/section/section/main/div/div/div[5]/div/div[2]/form/div[3]/div/div/input'):可见,共耗时0s 256 | 2019-10-29 12:16:58,716 - root - INFO - 用户列表页面_新增用户功能,查找页面元素:('xpath', '//*[@id="app"]/section/section/main/div/div/div[5]/div/div[2]/form/div[3]/div/div/input') 257 | 2019-10-29 12:16:58,728 - root - INFO - 用户列表页面_新增用户功能,等待页面元素:('xpath', '//*[@id="app"]/section/section/main/div/div/div[5]/div/div[2]/form/div[3]/div/div/input'):可见,共耗时0s 258 | 2019-10-29 12:16:58,798 - root - INFO - 用户列表页面_新增用户功能,页面元素:('xpath', '//*[@id="app"]/section/section/main/div/div/div[5]/div/div[2]/form/div[4]/div/div/input') 输入值 13776787676 259 | 2019-10-29 12:16:58,809 - root - INFO - 用户列表页面_新增用户功能,等待页面元素:('xpath', '//*[@id="app"]/section/section/main/div/div/div[5]/div/div[2]/form/div[4]/div/div/input'):可见,共耗时0s 260 | 2019-10-29 12:16:58,810 - root - INFO - 用户列表页面_新增用户功能,查找页面元素:('xpath', '//*[@id="app"]/section/section/main/div/div/div[5]/div/div[2]/form/div[4]/div/div/input') 261 | 2019-10-29 12:16:58,820 - root - INFO - 用户列表页面_新增用户功能,等待页面元素:('xpath', '//*[@id="app"]/section/section/main/div/div/div[5]/div/div[2]/form/div[4]/div/div/input'):可见,共耗时0s 262 | 2019-10-29 12:16:58,913 - root - INFO - 用户列表页面_新增用户功能,点击页面元素:('xpath', '//*[@id="app"]/section/section/main/div/div/div[5]/div/div[3]/div/button[2]') 263 | 2019-10-29 12:16:58,913 - root - INFO - 用户列表页面_新增用户功能,查找页面元素:('xpath', '//*[@id="app"]/section/section/main/div/div/div[5]/div/div[3]/div/button[2]') 264 | 2019-10-29 12:16:58,927 - root - INFO - 用户列表页面_新增用户功能,等待页面元素:('xpath', '//*[@id="app"]/section/section/main/div/div/div[5]/div/div[3]/div/button[2]'):可见,共耗时0s 265 | 2019-10-29 12:16:58,968 - root - INFO - 期望值:用户名已存在 266 | 2019-10-29 12:16:58,969 - root - INFO - 用户列表页面_新增用户功能_获取新增结果信息,获取页面元素:('xpath', '//div[@role="alert"]/p[@class="el-message__content"]') 267 | 2019-10-29 12:16:59,494 - root - INFO - 用户列表页面_新增用户功能_获取新增结果信息,等待页面元素:('xpath', '//div[@role="alert"]/p[@class="el-message__content"]'):可见,共耗时0s 268 | 2019-10-29 12:16:59,494 - root - INFO - 用户列表页面_新增用户功能_获取新增结果信息,查找页面元素:('xpath', '//div[@role="alert"]/p[@class="el-message__content"]') 269 | 2019-10-29 12:16:59,507 - root - INFO - 用户列表页面_新增用户功能_获取新增结果信息,等待页面元素:('xpath', '//div[@role="alert"]/p[@class="el-message__content"]'):可见,共耗时0s 270 | 2019-10-29 12:16:59,521 - root - INFO - 实际值:用户名已存在 271 | 2019-10-29 12:16:59,521 - root - INFO - 用户列表页面_新增用户功能_获取新增结果信息,获取页面元素:('xpath', '//div[@role="alert"]/p[@class="el-message__content"]') 272 | 2019-10-29 12:16:59,533 - root - INFO - 用户列表页面_新增用户功能_获取新增结果信息,等待页面元素:('xpath', '//div[@role="alert"]/p[@class="el-message__content"]'):可见,共耗时0s 273 | 2019-10-29 12:16:59,534 - root - INFO - 用户列表页面_新增用户功能_获取新增结果信息,查找页面元素:('xpath', '//div[@role="alert"]/p[@class="el-message__content"]') 274 | 2019-10-29 12:16:59,544 - root - INFO - 用户列表页面_新增用户功能_获取新增结果信息,等待页面元素:('xpath', '//div[@role="alert"]/p[@class="el-message__content"]'):可见,共耗时0s 275 | 2019-10-29 12:16:59,554 - root - INFO - 结束执行 test_add_passwordFormat_error 测试用例, 测试结果 --- PASS 276 | 2019-10-29 12:16:59,829 - root - INFO - 新增用户功能-异常测试-用户已存在-正常截图截图成功,图片路径为: 新增用户功能-异常测试-用户已存在-正常截图 277 | 2019-10-29 12:17:02,837 - root - INFO - 执行 test_add_passwordFormat_error 测试用例 278 | 2019-10-29 12:17:02,837 - root - INFO - 异常测试用例:新增用户功能-异常测试-用户名为空 279 | 2019-10-29 12:17:02,838 - root - INFO - 用户列表页面_新增用户功能,点击页面元素:('xpath', '//span[text()="添加按钮"]') 280 | 2019-10-29 12:17:02,838 - root - INFO - 用户列表页面_新增用户功能,查找页面元素:('xpath', '//span[text()="添加按钮"]') 281 | 2019-10-29 12:17:02,850 - root - INFO - 用户列表页面_新增用户功能,等待页面元素:('xpath', '//span[text()="添加按钮"]'):可见,共耗时0s 282 | 2019-10-29 12:17:02,879 - root - INFO - 用户列表页面_新增用户功能,页面元素:('xpath', '//div[@aria-label="添加用户"]/div[@class="el-dialog__body"]/form/div[1]//input') 输入值 283 | 2019-10-29 12:17:03,420 - root - INFO - 用户列表页面_新增用户功能,等待页面元素:('xpath', '//div[@aria-label="添加用户"]/div[@class="el-dialog__body"]/form/div[1]//input'):可见,共耗时0s 284 | 2019-10-29 12:17:03,420 - root - INFO - 用户列表页面_新增用户功能,查找页面元素:('xpath', '//div[@aria-label="添加用户"]/div[@class="el-dialog__body"]/form/div[1]//input') 285 | 2019-10-29 12:17:03,431 - root - INFO - 用户列表页面_新增用户功能,等待页面元素:('xpath', '//div[@aria-label="添加用户"]/div[@class="el-dialog__body"]/form/div[1]//input'):可见,共耗时0s 286 | 2019-10-29 12:17:03,450 - root - INFO - 用户列表页面_新增用户功能,页面元素:('xpath', '//*[@id="app"]/section/section/main/div/div/div[5]/div/div[2]/form/div[2]/div/div/input') 输入值 123456 287 | 2019-10-29 12:17:03,463 - root - INFO - 用户列表页面_新增用户功能,等待页面元素:('xpath', '//*[@id="app"]/section/section/main/div/div/div[5]/div/div[2]/form/div[2]/div/div/input'):可见,共耗时0s 288 | 2019-10-29 12:17:03,463 - root - INFO - 用户列表页面_新增用户功能,查找页面元素:('xpath', '//*[@id="app"]/section/section/main/div/div/div[5]/div/div[2]/form/div[2]/div/div/input') 289 | 2019-10-29 12:17:03,475 - root - INFO - 用户列表页面_新增用户功能,等待页面元素:('xpath', '//*[@id="app"]/section/section/main/div/div/div[5]/div/div[2]/form/div[2]/div/div/input'):可见,共耗时0s 290 | 2019-10-29 12:17:03,524 - root - INFO - 用户列表页面_新增用户功能,页面元素:('xpath', '//*[@id="app"]/section/section/main/div/div/div[5]/div/div[2]/form/div[3]/div/div/input') 输入值 123@qq.com 291 | 2019-10-29 12:17:03,538 - root - INFO - 用户列表页面_新增用户功能,等待页面元素:('xpath', '//*[@id="app"]/section/section/main/div/div/div[5]/div/div[2]/form/div[3]/div/div/input'):可见,共耗时0s 292 | 2019-10-29 12:17:03,539 - root - INFO - 用户列表页面_新增用户功能,查找页面元素:('xpath', '//*[@id="app"]/section/section/main/div/div/div[5]/div/div[2]/form/div[3]/div/div/input') 293 | 2019-10-29 12:17:03,551 - root - INFO - 用户列表页面_新增用户功能,等待页面元素:('xpath', '//*[@id="app"]/section/section/main/div/div/div[5]/div/div[2]/form/div[3]/div/div/input'):可见,共耗时0s 294 | 2019-10-29 12:17:03,620 - root - INFO - 用户列表页面_新增用户功能,页面元素:('xpath', '//*[@id="app"]/section/section/main/div/div/div[5]/div/div[2]/form/div[4]/div/div/input') 输入值 13776787676 295 | 2019-10-29 12:17:03,632 - root - INFO - 用户列表页面_新增用户功能,等待页面元素:('xpath', '//*[@id="app"]/section/section/main/div/div/div[5]/div/div[2]/form/div[4]/div/div/input'):可见,共耗时0s 296 | 2019-10-29 12:17:03,632 - root - INFO - 用户列表页面_新增用户功能,查找页面元素:('xpath', '//*[@id="app"]/section/section/main/div/div/div[5]/div/div[2]/form/div[4]/div/div/input') 297 | 2019-10-29 12:17:03,645 - root - INFO - 用户列表页面_新增用户功能,等待页面元素:('xpath', '//*[@id="app"]/section/section/main/div/div/div[5]/div/div[2]/form/div[4]/div/div/input'):可见,共耗时0s 298 | 2019-10-29 12:17:03,716 - root - INFO - 用户列表页面_新增用户功能,点击页面元素:('xpath', '//*[@id="app"]/section/section/main/div/div/div[5]/div/div[3]/div/button[2]') 299 | 2019-10-29 12:17:03,717 - root - INFO - 用户列表页面_新增用户功能,查找页面元素:('xpath', '//*[@id="app"]/section/section/main/div/div/div[5]/div/div[3]/div/button[2]') 300 | 2019-10-29 12:17:03,729 - root - INFO - 用户列表页面_新增用户功能,等待页面元素:('xpath', '//*[@id="app"]/section/section/main/div/div/div[5]/div/div[3]/div/button[2]'):可见,共耗时0s 301 | 2019-10-29 12:17:03,757 - root - INFO - 期望值:用户名不能为空 302 | 2019-10-29 12:17:03,758 - root - INFO - 用户列表页面_新增用户功能_获取新增结果信息,获取页面元素:('xpath', '//div[@role="alert"]/p[@class="el-message__content"]') 303 | 2019-10-29 12:17:04,288 - root - INFO - 用户列表页面_新增用户功能_获取新增结果信息,等待页面元素:('xpath', '//div[@role="alert"]/p[@class="el-message__content"]'):可见,共耗时0s 304 | 2019-10-29 12:17:04,289 - root - INFO - 用户列表页面_新增用户功能_获取新增结果信息,查找页面元素:('xpath', '//div[@role="alert"]/p[@class="el-message__content"]') 305 | 2019-10-29 12:17:04,300 - root - INFO - 用户列表页面_新增用户功能_获取新增结果信息,等待页面元素:('xpath', '//div[@role="alert"]/p[@class="el-message__content"]'):可见,共耗时0s 306 | 2019-10-29 12:17:04,315 - root - INFO - 实际值:用户名不能为空 307 | 2019-10-29 12:17:04,315 - root - INFO - 用户列表页面_新增用户功能_获取新增结果信息,获取页面元素:('xpath', '//div[@role="alert"]/p[@class="el-message__content"]') 308 | 2019-10-29 12:17:04,327 - root - INFO - 用户列表页面_新增用户功能_获取新增结果信息,等待页面元素:('xpath', '//div[@role="alert"]/p[@class="el-message__content"]'):可见,共耗时0s 309 | 2019-10-29 12:17:04,327 - root - INFO - 用户列表页面_新增用户功能_获取新增结果信息,查找页面元素:('xpath', '//div[@role="alert"]/p[@class="el-message__content"]') 310 | 2019-10-29 12:17:04,338 - root - INFO - 用户列表页面_新增用户功能_获取新增结果信息,等待页面元素:('xpath', '//div[@role="alert"]/p[@class="el-message__content"]'):可见,共耗时0s 311 | 2019-10-29 12:17:04,349 - root - INFO - 结束执行 test_add_passwordFormat_error 测试用例, 测试结果 --- PASS 312 | 2019-10-29 12:17:04,627 - root - INFO - 新增用户功能-异常测试-用户名为空-正常截图截图成功,图片路径为: 新增用户功能-异常测试-用户名为空-正常截图 313 | 2019-10-29 12:17:07,633 - root - INFO - ==========结束执行测试用例集=========== 314 | 2019-10-29 12:17:09,696 - root - INFO - ==========结束 XX项目 测试=========== 315 | -------------------------------------------------------------------------------- /.idea/workspace.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 98 | 99 | 100 | 101 | logging 102 | self.lg 103 | self.ug 104 | --- False 105 | exception 106 | setUpDownClass 107 | replace('/', '\\') 108 | 109 | 110 | logger 111 | setUpDownClass[1] 112 | info 113 | start_session 114 | 115 | 116 | 117 | 119 | 120 | 175 | 176 | 177 | 178 | 179 | true 180 | DEFINITION_ORDER 181 | 182 | 183 | 184 | 185 | 186 | 191 | 192 | 193 | 194 | 195 | 196 | 197 | 198 | 199 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 209 | 210 | 211 | 212 | 213 | 214 | 215 | 216 | 217 | 218 | 219 | 220 | 221 | 222 | 223 | 224 | 225 | 226 | 227 |