Loading

摘要: 使用过程中遇到的报错信息记录... $ git add readme.md fatal: not a git repository (or any of the parent directories) # Git命令必须在Git仓库目录内执行(git init除外),在仓库目录外执行是没有意义的 f 阅读全文
posted @ 2023-03-10 15:21 ABEELAN 阅读(43) 评论(0) 推荐(0)
摘要: 问题 使用命令行提交时,中文乱码。 $ git commit -m "selenium cookies api" [main 2cc063e] selenium cookies api 2 files changed, 448 insertions(+) create mode 100644 "16 阅读全文
posted @ 2023-03-10 15:18 ABEELAN 阅读(20) 评论(0) 推荐(0)
摘要: 常用命令记录,速查速记... 初始化仓库提示命令 创建新版本库 git clone https://gitlab.xxx.com/test/xxx.git touch README.md git add README.md git commit -m "add README" 项目已存在 cd ex 阅读全文
posted @ 2023-03-10 15:17 ABEELAN 阅读(22) 评论(0) 推荐(0)
摘要: # 获取页面源码 d.dump_hierarchy(compressed=False, pretty=False) UiObject driver UiObject.info -> uiautomator2.session.UiObject text, textContains, textMatch 阅读全文
posted @ 2023-03-10 15:15 ABEELAN 阅读(993) 评论(0) 推荐(0)
摘要: 性能监控系统 InfluxDB 存储压力测试结果,go 语言开发,8086 端口 # 新建容器网络 $ docker network create grafana # 运行容器 $ cd ~/volumes $ docker run -d --name=influxdb --network graf 阅读全文
posted @ 2023-03-10 15:13 ABEELAN 阅读(51) 评论(0) 推荐(0)
摘要: Jmeter 介绍与安装 性能测试:模拟多个用户的操作对服务器硬件性能的影响。 TPS:每秒事物处理能力 RT:响应时间 常见性能压力测试工具 Apache Jmeter:Java 语言开发,开源 LoadRunner:C 语言开发,商业 Locust:python 语言开发,开源 Jmeter 优 阅读全文
posted @ 2023-03-10 15:04 ABEELAN 阅读(32) 评论(0) 推荐(0)
摘要: pytest-xdist 分布式测试插件 安装 $ pip install pytest-xdist 测试代码准备 class Test: def test_sleep_2(self): sleep(2) assert False def test_sleep_3(self): sleep(3) a 阅读全文
posted @ 2023-03-10 14:59 ABEELAN 阅读(158) 评论(0) 推荐(0)
摘要: 记录一个 pytest-reruns 插件和 pytest-timeout 插件的 兼容性问题。 先说结论: 当两个插件一起使用时,需要设置 timeout_func_only=true 问题 接口自动化项目在容器内执行时 reruns 插件闪退,配置的 timeout 时间不生效,导致项目一直在阻 阅读全文
posted @ 2023-03-10 14:58 ABEELAN 阅读(100) 评论(0) 推荐(0)
摘要: pytest-rerunfailures 插件,功能是用例执行失败可以重试。 python 3.6+ pytest 5.3+ 用例重试时,fixture 或 setup_class 也将被重新执行。 安装 $ pip install pytest-rerunfailures 使用 命令行使用 # 用 阅读全文
posted @ 2023-03-10 14:57 ABEELAN 阅读(186) 评论(0) 推荐(0)
摘要: pytest-html 测试报告生成插件 安装 适用版本:Python >=3.6. $ pip install pytest-html 准备测试代码 # test_login.py class TestLogin: def test_success(self): print("login succ 阅读全文
posted @ 2023-03-10 14:55 ABEELAN 阅读(657) 评论(0) 推荐(0)
摘要: 通过 python 调用 $ python -m pytest [...] 等同于直接调用 pytest,通过 python 调用会将当前目录添加到 sys.path 退出码 Exit code 0: 找到所有测试用例并测试通过 Exit code 1: 部分用例运行失败 Exit code 2: 阅读全文
posted @ 2023-03-10 14:53 ABEELAN 阅读(84) 评论(0) 推荐(0)
摘要: 记录一个测试类变量初始化问题。 测试场景:初始化变量 a=1 ,每执行一条测试用例前,都使变量 a 自增 1,保证每条用例内的 a 都是不等的。 就像实例变量的值传递一样,如下: class Demo: def __init__(self): self.a = 1 print("init: ", s 阅读全文
posted @ 2023-03-10 14:52 ABEELAN 阅读(123) 评论(0) 推荐(0)
摘要: webview Android(6.0 以上)需要打开 webview 调试开关 if (Biuld.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT){ WebView.setWebContentsDebuggingEnabled(true); } mum 阅读全文
posted @ 2023-03-10 14:48 ABEELAN 阅读(55) 评论(0) 推荐(0)
摘要: 启动 appium server 后,再次启动 weditor 连接设备报错 [E 221216 18:20:07 web:2162] 500 GET /api/v1/devices/android%3Aemulator-5554/screenshot (::1) 2133.77ms 解决办法: 停 阅读全文
posted @ 2023-03-10 14:46 ABEELAN 阅读(81) 评论(0) 推荐(0)
摘要: iOS Predicate String 定位表达式结构:属性 + 运算符 + 值 # == 运算符: # 属性 label 的值 与 字符串 "SYSTEM(TEXT)" 相等 label == "SYSTEM(TEXT)" # AND 运算符 # 同时满足多个条件 label == "SYSTE 阅读全文
posted @ 2023-03-10 14:44 ABEELAN 阅读(118) 评论(0) 推荐(0)
摘要: Appium 常用 API。 元素定位 DOM 结构 dom:Document Object Model,文档对象模型。 dom 应用:用于表示界面的控件层级,界面的结构化描述。常见的格式为 html\xml。核心元素为节点和属性。 Andoid 应用的层级结构和 html 不一样,是一个定制的 x 阅读全文
posted @ 2023-03-10 14:42 ABEELAN 阅读(236) 评论(0) 推荐(0)
摘要: 简介 Appium 是一个移动端自动化测试框架,可用于测试: 原生应用:安卓或 iOS 应用 移动网页应用:网页应用,h5,safari 或者手机 chrome 混合应用:原生应用嵌套 webview 支持跨平台,底层多引擎可切换,生态丰富,社区强大。 概念 客户端 / 服务器 架构 Appium 阅读全文
posted @ 2023-03-10 14:35 ABEELAN 阅读(135) 评论(0) 推荐(0)
摘要: 使用 pytest 做自动化测试过程中,关于 allure 报告的使用方法汇总 python allure 包使用 allure 命令行工具 生成测试报告不启动服务 $ allure generate {allure_result} # -o 指定生成报告目录 # --clean 在生成新的 All 阅读全文
posted @ 2023-03-10 14:32 ABEELAN 阅读(133) 评论(0) 推荐(0)
摘要: Translation:翻译插件,快捷键:cmd+ctl+u;https://yiiguxing.gitee.io/translation-plugin/start.html Markdown statistic: 统计代码行数 Json Parser:json 格式化插件 SonarLint:代码 阅读全文
posted @ 2023-03-10 14:27 ABEELAN 阅读(38) 评论(0) 推荐(0)
摘要: 插件介绍 PlantUML 是画程序时序图的,Pycharm 有插件,可以创建 *.puml 文件,非常方便。 官方网站:http://plantuml.com/sequence-diagram 在线使用:https://plantuml.ceshiren.com/uml/SyfFKj2rKt3Co 阅读全文
posted @ 2023-03-10 14:26 ABEELAN 阅读(1109) 评论(0) 推荐(0)
摘要: 原因是配置了版本控制,但是目录却没有添加到版本控制内 设置 - VersionControl - Directory Mappings - 项目的 VCS 设置为 none 即可。 阅读全文
posted @ 2023-03-10 14:25 ABEELAN 阅读(64) 评论(0) 推荐(0)
摘要: def _is_page(self, locator): """判断是否到达指定页面""" caller_name = traceback.extract_stack()[-2][2] is_page = self.ele_actions(locator).exists() self.log.opt 阅读全文
posted @ 2023-03-10 14:22 ABEELAN 阅读(171) 评论(0) 推荐(0)
摘要: python 项目中的依赖库,可以创建一个requirements.txt文件来管理。 allure-pytest=2.12.0 pytest=7.2.0 pytest-rerunfailures=10.3 pytest-sugar=0.9.6 # 安装 $ pip install -r requi 阅读全文
posted @ 2023-03-10 14:21 ABEELAN 阅读(34) 评论(0) 推荐(0)
摘要: Mac Python 3.7 https://www.modb.pro/db/454999 安装 # 搜索仓库 $ brew search gdb # 安装 $ brew install gdb Error: python@3.10: the bottle needs the Apple Comma 阅读全文
posted @ 2023-03-10 14:19 ABEELAN 阅读(392) 评论(0) 推荐(0)
摘要: python 连接数据库操作 pymysql import pymysql def get_connect(): connect = pymysql.connect( host="xxx.com", port=3306, user="test", password="test1234", datab 阅读全文
posted @ 2023-03-10 14:18 ABEELAN 阅读(16) 评论(0) 推荐(0)
摘要: 数据处理 pandas 数据读取 pd.read_csv:csv/tsv/txt 用逗号、tab 分隔的纯文本文件 pd.read_excel::微软 xls 或者 xlsx 文件 pd.read_sql:mysql 关系型数据库 pd.read_csv 读取纯文本文件 userId,movieId 阅读全文
posted @ 2023-03-10 14:17 ABEELAN 阅读(12) 评论(0) 推荐(0)
摘要: else 使用汇总。 问题 阅读别人代码,有点疑惑,精简后如下: def code_example(arg=None): for i in range(5): if arg: break else: print('else branch') 循环语句后面直接跟了 else 语句,未报错,程序正常运行 阅读全文
posted @ 2023-03-10 14:16 ABEELAN 阅读(49) 评论(0) 推荐(0)
摘要: 递归学习,通过汉诺塔游戏加强理解! 递归 在一个函数内部调用自身本身,就是递归函数。 阶乘 5 的阶乘为:5*4*3*2*1 n 的阶乘为:1*2*3*…*(n-1) 所以其实就是n*(n-1)的循环,只有当n=1时,需要特殊处理。 # 递归实现,暂不考虑负数和零 def fact(n): if n 阅读全文
posted @ 2023-03-10 14:15 ABEELAN 阅读(87) 评论(0) 推荐(0)
摘要: # 安装包出现错误 $ pip install -r requirements.txt -i http://pypi.douban.com/simple/ ERROR: Could not find a version that satisfies the requirement pbr (from 阅读全文
posted @ 2023-03-10 14:14 ABEELAN 阅读(36) 评论(0) 推荐(0)
摘要: python 3.7 Mac 安装 psycopg2 $ pip install psycopg2 ... Error: pg_config executable not found. ... 出现报错:Error: pg_config executable not found. 解决 参考:htt 阅读全文
posted @ 2023-03-10 14:14 ABEELAN 阅读(85) 评论(0) 推荐(0)
摘要: yap-pro.sh # https://hub.docker.com/r/yapipro/yapi # 创建容器网络 docker network create yapi # 删除历史构建容器 docker rm -f yapi docker rm -f mongodb # 启动 mongoDB 阅读全文
posted @ 2023-03-10 14:08 ABEELAN 阅读(496) 评论(0) 推荐(0)
摘要: Yapi 是比较好用的接口管理平台,之前写过一篇关于搭建过程的文章。 YApi - 通过docker搭建接口管理平台 本篇文章,记录下使用过程中遇到的问题。 YAPI 安全漏洞解决方法 Yapi 使用的脚本执行沙箱存在安全漏洞问题,需要更换为更安全的沙箱 safeify。详情参考 yapi 安全漏洞 阅读全文
posted @ 2023-03-10 14:06 ABEELAN 阅读(504) 评论(0) 推荐(0)
摘要: YApi 是比较好用的接口管理平台,通过 docker-compose 搭建记录。 准备工作 CentOS Linux release 7.9.2009 (Core) Docker 20.10.8 搭建 1. 创建容器网络 $ docker network create --driver bridg 阅读全文
posted @ 2023-03-10 14:05 ABEELAN 阅读(375) 评论(0) 推荐(0)