IT数码 购物 网址 头条 软件 日历 阅读 图书馆
TxT小说阅读器
↓语音阅读,小说下载,古典文学↓
图片批量下载器
↓批量下载图片,美女图库↓
图片自动播放器
↓图片自动播放器↓
一键清除垃圾
↓轻轻一点,清除系统垃圾↓
开发: C++知识库 Java知识库 JavaScript Python PHP知识库 人工智能 区块链 大数据 移动开发 嵌入式 开发工具 数据结构与算法 开发测试 游戏开发 网络协议 系统运维
教程: HTML教程 CSS教程 JavaScript教程 Go语言教程 JQuery教程 VUE教程 VUE3教程 Bootstrap教程 SQL数据库教程 C语言教程 C++教程 Java教程 Python教程 Python3教程 C#教程
数码: 电脑 笔记本 显卡 显示器 固态硬盘 硬盘 耳机 手机 iphone vivo oppo 小米 华为 单反 装机 图拉丁
 
   -> 开发测试 -> 自动化测试pytest.ini文件 -> 正文阅读

[开发测试]自动化测试pytest.ini文件

[pytest]
addopts= -vs ./testcase/test_import_order.py
testpaths= ./testcase
python_files= test_*.py
python_classes=Test*
python_functions=test_*
markers=
        login
        order
        smoke

@pytest.mark.login
@pytest.mark.run(order=1)
def test_login(self,browser_fixture):

conftest.py

@pytest.fixture(scope='class',params=[url])
def browser_fixture(request):
    driver = webdriver.Chrome()
    driver.get(request.param)
    print('打开浏览器'+request.param)
    yield driver
    driver.quit()
    print('关闭浏览器')

readexcel.py

from openpyxl import Workbook, load_workbook


class ReadExcel():
    # 定义方法:读取指定目录下Excel文件某个sheet单元格的值
    def read_excel(filepath,index,x,y):
        #wb=Workbook()
        wb=load_workbook(filepath)
        sheetname=wb.sheetnames[index]
        sheet=wb[sheetname]

        return sheet.cell(x,y).value

    def write_excel(filepath,index,x,y,newstr):
        wb = load_workbook(filepath)
        sheetname = wb.sheetnames[index]
        sheet = wb[sheetname]
        sheet.cell(x,y).value=newstr
        wb.save(filepath)

readfile.py

class ReadFile:
    def get_txtfile(self,filename):
        # 获取登录参数
        with open(filename, 'r', encoding='utf-8') as loginfile:
            login_dict = {}
            for loginline in loginfile.readlines():
                loginline = loginline.strip()
                k = loginline.split(' ')[0]
                v = loginline.split(' ')[1]
                login_dict[k] = v

            loginfile.close()
            return login_dict

    def get_txtfile1(filename):
        # 获取登录参数
        with open(filename, 'r', encoding='utf-8') as loginfile:
            login_dict = {}
            for loginline in loginfile.readlines():
                loginline = loginline.strip()
                k = loginline.split(' ')[0]
                v = loginline.split(' ')[1]
                login_dict[k] = v

            loginfile.close()
            return login_dict

    def get_jsonfile(self,filename):
        with open(filename,'r',newline='') as file:
            lcookie=json.load(file)
        file.close()
        return lcookie

    def get_jsonfile1(filename):
        with open(filename,'r',newline='') as file:
            lcookie=json.load(file)
        file.close()
        return lcookie

readyml

def read_yaml():
    fileNamePath = os.path.split(os.path.realpath(__file__))[0]
    yamlpath = os.path.join(fileNamePath, 'nfig.yaml')
    with open(yamlpath,'r',encoding='utf-8') as ymalfile:
        conf=ymalfile.read()
    mysqlyaml=yaml.load(conf)
    #print(mysqlyaml)
    return  mysqlyaml

https://docs.qameta.io/allure/#_python

  开发测试 最新文章
pytest系列——allure之生成测试报告(Wind
某大厂软件测试岗一面笔试题+二面问答题面试
iperf 学习笔记
关于Python中使用selenium八大定位方法
【软件测试】为什么提升不了?8年测试总结再
软件测试复习
PHP笔记-Smarty模板引擎的使用
C++Test使用入门
【Java】单元测试
Net core 3.x 获取客户端地址
上一篇文章      下一篇文章      查看所有文章
加:2021-07-22 14:29:45  更:2021-07-22 14:31:13 
 
开发: C++知识库 Java知识库 JavaScript Python PHP知识库 人工智能 区块链 大数据 移动开发 嵌入式 开发工具 数据结构与算法 开发测试 游戏开发 网络协议 系统运维
教程: HTML教程 CSS教程 JavaScript教程 Go语言教程 JQuery教程 VUE教程 VUE3教程 Bootstrap教程 SQL数据库教程 C语言教程 C++教程 Java教程 Python教程 Python3教程 C#教程
数码: 电脑 笔记本 显卡 显示器 固态硬盘 硬盘 耳机 手机 iphone vivo oppo 小米 华为 单反 装机 图拉丁

360图书馆 购物 三丰科技 阅读网 日历 万年历 2024年5日历 -2024/5/7 4:08:08-

图片自动播放器
↓图片自动播放器↓
TxT小说阅读器
↓语音阅读,小说下载,古典文学↓
一键清除垃圾
↓轻轻一点,清除系统垃圾↓
图片批量下载器
↓批量下载图片,美女图库↓
  网站联系: qq:121756557 email:121756557@qq.com  IT数码