知识卡片
测试夹具定义可重复前提
测试夹具是用例运行前必须成立的条件,可包括数据、配置、文件、目录或基础设施。固定 ID 的接口测试若依赖预置资源,夹具必须可重复创建和清理;否则结果会受环境旧状态影响。
这张卡片看不懂?
这张卡片的反馈已满 10 条,暂时无法继续提交。
已有反馈 · 0 / 10 条
还没有人提交反馈。
原书出处
参考来源
- 位置:《Microservice APIs》第 12 章《Testing and validating APIs》(源文件:_epub-src/OEBPS/Text/12.htm)
- 结论依据:原文定义 fixtures,并用订单资源 ID 不存在导致端点测试失败说明前提状态的重要性。
- 原始内容:fixtures are the preconditions required to run a test. Typically, fixtures are data that we load into a database for testing, but they can also include configuration, directories and files, or infrastructure resources.