前言
import allure
class TestCase:
@allure.title('用例1的名称')
def test_01(self):
print('---用例01---')
assert 1
@allure.title('用例2的名称')
def test_02(self):
print('---用例02---')
assert 1
@allure.title('用例3的名称')
def test_03(self):
print('---用例03---')
assert 2
import allure
class TestCase:
@allure.title('用例1的名称')
def test_01(self):
'''用例_01的描述内容'''
print('---用例01---')
assert 1
@allure.title('用例2的名称')
def test_02(self):
'''用例_02的描述内容'''
print('---用例02---')
assert 1
@allure.title('用例3的名称')
def test_03(self):
'''用例_03的描述内容'''
print('---用例03---')
assert 2
import allure
class TestCase:
@allure.title('登录用户')
def test_01(self):
'''登录用户'''
print('---用例01---')
with allure.step('输入登录用户名'):
print('输入用户名')
with allure.step('输入登录的密码'):
print('输入密码')
with allure.step('点击登录'):
print('点击登录!')
assert 1
@allure.title('进入测试页面')
def test_02(self):
'''进入测试页面'''
print('---用例02---')
with allure.step('进入测试页面'):
print('进入测试页面')
with allure.step('点击测试内容'):
print('点击测试内容')
assert 1
import allure
class TestCase:
@allure.issue('https://home.cnblogs.com/u/qican/')
@allure.testcase('https://www.baidu.com/')
@allure.title('登录用户')
def test_01(self):
'''登录用户'''
print('---用例01---')
with allure.step('输入登录用户名'):
print('输入用户名')
with allure.step('输入登录的密码'):
print('输入密码')
with allure.step('点击登录'):
print('点击登录!')
assert 1
@allure.issue('https://home.cnblogs.com/u/qican/')
@allure.testcase('https://www.baidu.com/')
@allure.title('进入测试页面')
def test_02(self):
'''进入测试页面'''
print('---用例02---')
with allure.step('进入测试页面'):
print('进入测试页面')
with allure.step('点击测试内容'):
print('点击测试内容')
assert 1
import allure
@allure.epic("属于登录标签")
@allure.feature('登录模块')
class TestCase:
@allure.title('登录用户')
def test_01(self):
'''登录用户'''
print('---用例01---')
with allure.step('输入登录用户名'):
print('输入用户名')
with allure.step('输入登录的密码'):
print('输入密码')
with allure.step('点击登录'):
print('点击登录!')
assert 1
@allure.title('进入测试页面')
def test_02(self):
'''进入测试页面'''
print('---用例02---')
with allure.step('进入测试页面'):
print('进入测试页面')
with allure.step('点击测试内容'):
print('点击测试内容')
assert 1
@allure.epic("属于退出登录标签")
@allure.feature('退出登录模块')
class Test01:
def test_01(self):
print('---用例03---')
def test_02(self):
print('---用例04---')