编写首个验收测试及添加新功能指南
1. 编写首个验收测试
在调试过程中,如果使用控制台日志辅助调试,需要提供另一个参数将控制台输出转储到标准输出:
const browser = await puppeteer.launch({ dumpio: true });
1.1 使用数据表格进行设置
可以利用 Cucumber 的数据表格功能编写测试。以下是具体步骤:
1. 创建新的特性文件 :创建一个名为 features/drawing.feature 的文件,并写入以下内容:
Feature: Drawing
A user can draw shapes by entering commands at the prompt.
Scenario: Drawing functions
Given the user navigated to the application page
When the user enters the following instructions at the prompt:
| to drawsquare |
| repeat 4 [ forward 10 right 90 ] |
| end |
| drawsquare |
Then these lines should have been drawn:
超级会员免费看
订阅专栏 解锁全文

被折叠的 条评论
为什么被折叠?



