qa-env-config
Skill0 starsChanged 3 months agoMITView on GitHub
当用户搭建或管理接口/UI 自动化的测试环境,需要把多环境配置(base URL、账号、 token、DB 连接)与代码分离且避免泄露时使用。本技能生成各环境的 .env 模板脚手架, 并约定环境切换与配置规范。触发词:"配置测试环境"、"多环境怎么管理"、 "接口依赖/token 怎么配"、"测试用例配置",或在 qa-api-runner / qa-ui-automation 之前使用。 英文触发词(English triggers):test environment, env config, multi-environment.
- Reads credentials
In this repository39 other files it gives its agents.
- qa-a11ySkill
- qa-agent-evalSkill
- qa-agent-securitySkill
- qa-api-contractSkill
- qa-api-docSkill
- qa-api-runnerSkill
- qa-archiveSkill
- qa-bug-reportSkill
- qa-bug-verifySkill
- qa-chaosSkill
- qa-ciSkill
- qa-code-reviewSkill
- qa-compat-matrixSkill
- qa-executionSkill
- qa-exploratorySkill
- qa-flaky-detectSkill
- qa-mobile-autotestSkill
- qa-mutationSkill
- qa-orchestratorSkill
- qa-perf-analysisSkill
- qa-perf-designSkill
- qa-perf-jmeterSkill
- qa-perf-locustSkill
- qa-release-checkSkill
- qa-reportSkill
- qa-req-specSkill
- qa-risk-basedSkill
- qa-security-reportSkill
- qa-security-scanSkill
- qa-synthetic-monitoringSkill
- qa-test-analysisSkill
- qa-test-case-genSkill
- qa-test-dataSkill
- qa-test-strategySkill
- qa-ui-automationSkill
- qa-ui-kbSkill
- qa-ui-testidSkill
- qa-unit-tddSkill
- qa-visual-regressionSkill
The file
Files
qa-env-config — 测试环境与配置管理
接口/UI 自动化的维护黑洞之一是「环境配置散落」:地址、账号、token、DB 写在代码或聊天里, 切换环境改一处漏一处,还容易把密码带进仓库。本技能约定配置与代码分离、环境只改一个文件, 并提供脚手架生成多环境模板。
何时使用
- 准备接口/UI 自动化运行环境。
- 用户说「配置测试环境」「多环境怎么管理」「token/依赖怎么配」。
- 在
qa-api-runner/qa-ui-automation执行之前准备配置。
操作流程
步骤 1 — 生成配置模板
python scripts/init_env.py --outdir <变更>/06-execution/config --envs dev,test,staging生成 config/.env.example(可提交)+ 各环境 .env.<env>(填真实值,勿提交)。
步骤 2 — 填写并隔离
- 真实值在
.env.<env>中填写;把.env*加入.gitignore,.env.example留空模板入库。 qa-api-runner用--env-file config/.env.test指向当前环境;切换只改这一个参数。
步骤 3 — 依赖与鉴权
- 登录态:在
.env填AUTH_TOKEN,或由qa-api-runner的登录用例extract后注入后续请求。 - 接口依赖(前置接口、token 传递)由场景 JSON 的
extract/${var}处理(见qa-api-runner)。
规范(references/switching-guide.md)
- 配置集中在一个
.env.<env>,禁止散落代码/用例。 - 敏感信息只存本地
.env,不进仓库、不进聊天、不进报告明文。 - 环境切换 = 换
--env-file,不改动用例与脚本。
与上下游衔接
- 供
qa-api-runner、qa-ui-automation运行时消费。 - 配合
qa-test-data的基础数据准备。 - 上线/回归时在
qa-release-check(Phase 4)切换为生产预发环境校验。
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

