2025年6月13日

设备之间内网内容互传,创建本地文件服务器

摘要: 使用场景: 当你需要从手机把文件或者文本传输到电脑,或者电脑文件或者文本传到手机时: 部署文件服务器: #!/usr/bin/python # -*- coding: UTF-8 -*- """Simple HTTP Server With Upload. This module builds on 阅读全文

posted @ 2025-06-13 10:17 老吃鸡 阅读(18) 评论(0) 推荐(0)

2025年6月12日

ws代理服务,mock ws

摘要: 结合charles + python websocket代理服务器,mock web 、app端的websocket。 1、将 APP,web端的ws请求代理到charles 2、设置 charles 代理ws 到 remote server 3 启动remote server 。 Python代码 阅读全文

posted @ 2025-06-12 13:56 老吃鸡 阅读(47) 评论(0) 推荐(0)

2025年3月27日

使用pytest钩子,替换测试数据,自动命名ids

摘要: 注意,以下内容放在conftest.py文件中 0、动态替换测试数据: # 替换数据 def pytest_collection_modifyitems(config, items): value_list = set() g_price = {} for item in items: data_g 阅读全文

posted @ 2025-03-27 14:08 老吃鸡 阅读(32) 评论(0) 推荐(0)

pytest 读取yml文件测试数据

摘要: yml文件模版: place_parent_order: &place_parent_order endpoint: /api/algo/order/place-parent-order method: POST stop_parent_order: &stop_parent_order endpo 阅读全文

posted @ 2025-03-27 13:54 老吃鸡 阅读(8) 评论(0) 推荐(0)

2022年11月15日

UI自动化环境搭建

摘要: 使用pyenv安装管理python环境(mac教程) - brew安装(已安装忽略):```/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"``` - pye 阅读全文

posted @ 2022-11-15 11:10 老吃鸡 阅读(55) 评论(0) 推荐(0)

2022年4月2日

pytest 自动赋值ids ids中文乱码问题

摘要: 1. 添加用例运行前的钩子,赋值自定义ids 2. ids中文乱码问题 阅读全文

posted @ 2022-04-02 19:57 老吃鸡 阅读(153) 评论(1) 推荐(0)

pytest 自定义命令行变量

摘要: 在执行pytest命令时,我们经常需要在命令行中传参。 可以用一下方法处理: # 接收一个env命令行参数 def pytest_addoption(parser): parser.addoption( "--env", action="store", default="", help="conf 阅读全文

posted @ 2022-04-02 19:42 老吃鸡 阅读(170) 评论(0) 推荐(0)

pytest UI自动化 失败截图

摘要: 分享一个使用pytest失败自动截图的方法 1. 功能当用例运行失败时,在当前界面截图并保存到测试报告中。 支持pytest-html 支持allure 代码如下: _driver = None @pytest.fixture(scope="function") def driver(request 阅读全文

posted @ 2022-04-02 19:40 老吃鸡 阅读(928) 评论(0) 推荐(0)

2021年7月5日

关于百度搜索的一些隐藏用法

摘要: 包含全部关键词--and: 关键词1 关键词2 搜索包含任意关键词--or:(关键词1 关键词2) 不包括关键词--not: -(关键词) 搜索包含完整关键词:“完整关键词” 搜索网页标题:title:关键词等 其他的设置: 阅读全文

posted @ 2021-07-05 23:47 老吃鸡 阅读(615) 评论(0) 推荐(0)

2021年6月19日

两个json字符串的对比

摘要: def verify_data(resdata,expdata,ignorkey=[]): logging.info("-" * 100) logging.info("响应数据:{0}".format(resdata)) logging.info("期望数据:{0}".format(expdata) 阅读全文

posted @ 2021-06-19 17:07 老吃鸡 阅读(710) 评论(0) 推荐(0)

导航