当前位置:网站首页>Pre post pytest method
Pre post pytest method
2022-07-26 10:55:00 【Yasso won't blow】
Code
import pytest
class TestFrontBack:
def setup_class(self):
print(" precondition ( Scope : Before the execution of each class ): Create a log object , Create database connection ")
def setup(self):
print(" precondition ( Scope : Before each use case is executed ): Open Google , window maximizing ")
def test_login(self):
print(' Click login ')
print(' Enter account ')
print(' Input password ')
print(' Click login ')
def test_buy(self):
print(' Enter the account and password in the login interface ')
print(' Click login ')
print(' View items and add them to the shopping cart ')
print(' Shopping cart purchase payment goods ')
print(' Check the account balance ')
def teardown(self):
print(' Postcondition ( Scope : Before and after the execution of each use case ): Shut down Google ')
def teardown_class(self):
print(' Postcondition ( Scope : Before and after the execution of each class ): Destroy log object , Destroy the database connection ')
if __name__ == '__main__':
pytest.main([r'D:\python New code set \pytest_study\basics\test_front_back.py'])
Running results 
边栏推荐
- Bash shell学习笔记(六)
- RT thread learning notes (I) -- configure RT thread development environment
- LIst和Dictionary实例应用(※)
- SCADA和三大工业控制系统PLC、DCS、FCS
- Linkedblockingqueue of novice source code
- Flutter jni混淆 引入.so文件release包闪退
- 232. Implement queue with stack
- During the interview, how did the interviewer evaluate the level of rust engineers?
- 按二进制数中1的个数分类
- Esxi6.5 patch update
猜你喜欢
随机推荐
MFC picture control
SparseArray of the source code for novices
菜鸟看源码之ArrayList
Sql Server 之SQL语句对基本表及其中的数据的创建和修改
@Notblank, @notnull, @notempty differences and uses
Pengge C language - minesweeping 2021-08-16
经典蓝牙的连接过程
Sql Server 数据库之完整性约束
35. Search the insertion position
Sql Server之查询总结
35. 搜索插入位置
像素和内存的关系
pytest conftest.py和fixture的配合使用
Solve the problem of the popularity of org.apache.commons.codec.binary.base64
Successfully transplanted stemwin v5.22 on Shenzhou IV development board
Bash shell学习笔记(六)
How to assemble a registry?
Traversal recursion + iteration of binary tree
Kali view IP address
SCADA and three industrial control systems PLC, DCS and FCS









