1 Star 0 Fork 35

lijingweidawang/jenkins4python_1

forked from kevin_gao71/jenkins4python 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
test_example.py 979 Bytes
一键复制 编辑 原始数据 按行查看 历史
kevin_gao71 提交于 2024-10-31 15:13 . 2024.10.31
#kehua2024
import allure
import pytest
from example import login
@allure.feature("登录功能")
class TestLogin:
@allure.story("成功登录")
def test_login_success(self):
with allure.step("输入用户名"):
username = "test_user"
allure.attach(f"用户名: {username}")
with allure.step("输入密码"):
password = "password123"
allure.attach(f"密码: {password}")
with allure.step("点击登录按钮"):
assert login(username, password)
@allure.story("登录失败")
def test_login_failure(self):
with allure.step("输入错误用户名"):
username = "wrong_user"
allure.attach(f"用户名: {username}")
with allure.step("输入正确密码"):
password = "password123"
allure.attach(f"密码: {password}")
with allure.step("点击登录按钮"):
assert not login(username, password)
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Python
1
https://gitee.com/king-li-jingwei/jenkins4python_1.git
[email protected]:king-li-jingwei/jenkins4python_1.git
king-li-jingwei
jenkins4python_1
jenkins4python_1
master

搜索帮助