|
Post by account_disabled on Apr 4, 2024 4:26:55 GMT
使用我们首先与客户交谈并创建一个自动化任务如下所示功能预订报告。场景用户请求所有预订的总收入给定考虑多次预订的可能性。时间收到总收入报告请求时。然后然后报告根据所有订单计算的总金额。该脚本采用语言编写某些自动化工具可以使用它来创建故障安全自动检查。它不起作用因为它应该检查的生产代码尚不存在。但如果我们编写代码使测试通过那么它的成功就意味着工作的完成我们已经创建了客户需要的东西并避免了扩大项目范围的风险。 设置自动验收测试框架对于此作业我们将创建一个新的项目这次包含扩展的依赖项列表以包含用于运行自动验收测试的新库 阿曼数据 如下所示版本版本除了我添加了两个库来自黄瓜。这使我们能够在示例脚本和自动化代码之间建立连接。例如当执行考虑多个预订的可能性步骤时它将运行自动代码来创建多个预订。首先我们将创建一个与之前使用的框架类似的框架并在测试文件夹中包含以下包在中我们将创建一个新类其中包含以下内容最后我们需要通过在资源文件夹中创建一个新文件来将示例脚本添加到我们的框架。 中如下所示如下功能预订报告场景用户请求所有预订的总收入假设我有多个预订当我请求有关我的总收入的报告时那么我将收到基于我所有预订的总金额这意味着当我们运行时测试我们得到步骤我有多个预订未定义。您可以使用下面的代码片段来实现它在此编写代码将上述短语转换为具体操作类将和我们的功能文件链接在一起允许运行文件作为测试。抛出是因为当运行函数文件时它会查找与正在执行的检查中的步骤相匹配的步骤定义。我们将在下面更详细地讨论这一点但现在我们将注意到这确认您已准备好创建失败的自动检查。
|
|