测试
开启 Kubernetes 监控并实施压力测试
· ☕ 4 分钟
1. Kubectl 基本命令 1.1 创建对象 1 2 3 4 5 6 7 8 # 创建资源,也可以使用远程 URL kubectl create -f ./my.yaml # 使用多个文件创建资源 kubectl create -f ./my1.yaml -f ./my2.yaml # 使用目录下的所有清单文件来创建资源 kubectl create -f ./dir # 启动一个 nginx 实例 kubectl run nginx --image=nginx 1.2 显示和查找资源 1 2 3 4 5 6 7 8 # 列出所有 namespace 中的 service kubectl get services # 列出所

如何打包一个 Robot Framework 的 Docker 镜像
· ☕ 3 分钟
为了方便 CI 集成 UI 自动化测试,需要将 Robot Framework 运行环境打包为 Docker 镜像。本篇主要内容是一些与打包过程相关的配置和脚本。 1. 打包目录结构 1 2 3 4 5 6 tree . ├── docker-compose.yml ├── Dockerfile ├── google-chrome.repo ├── requirements_base.txt 1.1 Dockerfile 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 FROM centos:7 ADD ./google-chrome.repo /etc/yum.repos.d/google-chrome.repo

Robot Framework 常用库
· ☕ 3 分钟
1. 标准库 Robot Framework 可以直接导入使用的库,在目录 python\Lib\site-packages\robot\libraries 中。详细说明,可以查看说明文档。 Builtin,包含经常需要的关键字。自动导入无需 import,因此总是可用的。 Dialogs,提供了暂停测试执行和从用户的输入方式。 Collections,提供一组

Robot Framework 进阶 (2)
· ☕ 2 分钟
配置表 Robot Framework 的配置表主要有两种用途。详细说明,请参考这里。 导入测试、资源文件和变量文件。 定义元数据。 在 Setting 表格中: 1 2 3 4 5 Library 引入库 Resource 引入资源文件 Variables 引入变量文件 Test Setup 指定缺省的 test setup Test Teardown 指定缺省的 test teardown 在测试用例中: 1 2 3 4 5 6 [Documentation] 测试用例描述 [Tags] 测试用

Robot Framework 进阶 (1)
· ☕ 3 分钟
pybot 命令 执行所有测试用例 1 pybot . 执行某个测试套件 1 pybot testsuite.txt 执行某个测试套件中的测试用例 1 pybot --test case_name testsuit.txt 将测试结果输出到固定路径 1 pybot --ouputdir your_ouput_dir testsuit.txt 执行包含某个 tag 的测试用例 1 pybot --include tag_name testsuit.txt 关于日志 默认情况下,Robot Framework 中低于 INFO 级别的日志消息不会写日志。这个阈值可以通过命