TA的每日心情 | 无聊 4 天前 |
---|
签到天数: 530 天 连续签到: 2 天 [LV.9]测试副司令
|
1测试积点
代码:
- mport openpyxl
- import pytest
- from page.env_elements import Elements
- from logic.login_tp import Login
- def get_excel():
- case = openpyxl.load_workbook('C:/Users/57890/Desktop/demo1.xlsx')
- sheet = case.active
- vlaues = []
- for row in sheet:
- line = []
- for cell in row:
- line.append(cell.value)
- vlaues.append(line)
- print(vlaues)
- return vlaues
- class Login_test:
- @pytest.mark.parametrize('username,password', get_excel())
- def test_case01(self, username, password):
- action = Login()
- action.login_tpshop(username, password)
- assert '安全退出' in action.get_text(Elements.SAFEQUIT_BUTTON)
- if name == 'main':
- pytest.main(['-s'])
复制代码结果: 进程已结束,退出代码为 5 空套件
|
|