ino*_*nor 6 java automated-tests gherkin
英语可能含糊不清,在我看来,采用Gherkin的方法有一个假设,即在某种程度上说英语的人,即使在任何代码编写之前,也可以编写和理解测试用例.
因此,考虑到以下需要自动化的简单测试场景,该方法如何指导您工作:
在库应用程序中,要向库中添加书籍,用户单击"添加",弹出"书籍信息"对话框,并且用户需要填写书名等,然后单击"确定".
假设QA人员写下以下内容:
Scenario: clicking the Add button
Given a user who is already logged in to the application
When the user clicks the Add button
Then the Book Info dialog is displayed
Run Code Online (Sandbox Code Playgroud)
够简单吗?这是一个很好的测试吗?我想我会说英语,但我不明白.
对话框中的字段应为空,也许某些字段应具有某些默认值或初始值.也许测试人员期望实现"然后显示书本信息"对话框以确保所有这些,但实现者是否知道这一点?怎么沟通?
也许测试应该写成
Scenario: clicking the Add button
Given a user who is already logged in to the application
When the user clicks the Add button
Then the Book Info dialog is displayed and all the fields are empty
Run Code Online (Sandbox Code Playgroud)
添加点击和显示的对话框之间可能需要几秒钟.因此,测试可能会失败,因为如果对话框已启动,或者没有等待足够长的时间来显示对话框,并且测试失败,则实施过早检查.
进行手动测试的人不需要涉及该问题,除非对话框出现需要很长时间.所以上面就是这个人编写测试的原因(所以这里的重点是测试人员需要足够聪明才能考虑到这一点,或者某些开发人员需要解释这一点,或者他们只是在测试失败后修复它) .
不知何故,这个简单的动作需要更多信息......什么时候在编写测试的人和实现测试操作的人之间进行通信?
也许测试应该写成
Scenario: clicking the Add button
Given a user who is already logged in to the application
When the user clicks the Add button
Then the Book Info dialog is displayed within a couple of seconds and all the fields are empty
Run Code Online (Sandbox Code Playgroud)
或者它应该写成:
Scenario: clicking the Add button
Given a user who is already logged in to the application
When the user clicks the Add button
And the user waits a couple of seconds
Then the Book Info dialog is displayed and all the fields are empty
Run Code Online (Sandbox Code Playgroud)
是否应该用英语撰写考试的人
| 归档时间: |
|
| 查看次数: |
1013 次 |
| 最近记录: |