当前位置:网站首页>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 
边栏推荐
- MFC picture control
- Sword finger offer (53): a string representing a numeric value
- Sword finger offer (44): flip the word order sequence
- Sword finger offer (49): convert a string to an integer
- @The difference and use of jsonformat and @datetimeformat
- WinPcap packet capturing function pcap_ Loop (), stop the problem
- Wireshark basic tutorial Ethernet frame analysis.
- Sword finger offer (8): jump the steps
- Sql Server 数据库之初学体验
- Many people don't know whether they are looking for Kanban software or Kanban software
猜你喜欢

pytest conftest.py和fixture的配合使用

349. Intersection of two arrays

Drbl diskless startup + Clonezilla network backup and restore system

Bash shell learning notes (6)

Software Testing Overview: the background, essence and process of software testing

pytest 执行规则_基本用法_常用插件_常用断言_常用参数

ESXi6.5补丁更新

Bash shell学习笔记(五)

RT thread learning notes (VII) -- open the elmfat file system based on SPI flash (middle)

344.反转字符串
随机推荐
MFC多线程的简单使用
Flutter jni混淆 引入.so文件release包闪退
@Validated 和 @Valid 的真正区别和使用方式
BigDecimal's addition, subtraction, multiplication and division, size comparison, rounding up and down, and BigDecimal's set accumulation, judge whether BigDecimal has decimal
2021-08-12 function recursion_ Learn C language with brother Peng
面试过程中,面试官是如何考察Rust工程师的水平?
Bash shell learning notes (I)
很多人都不清楚自己找的是Kanban软件还是看板软件
344.反转字符串
Sword finger offer (52): regularization expression
Pengge C language - minesweeping 2021-08-16
mysql学习笔记
MFC中0x003b66c3 处有未经处理的异常: 0xC000041D: 用户回调期间遇到未经处理的异常
ESXi6.5补丁更新
Capture ZABBIX performance monitoring chart with selenium
flutter dart生成N个区间范围内不重复随机数List
智能合约dapp系统开发流程技术
Bash shell学习笔记(二)
母亲
Software Testing Overview: the background, essence and process of software testing