【发布时间】:2014-12-13 12:13:05
【问题描述】:
我正在学习黄瓜并尝试编写功能文件。
以下是我的功能文件。
功能:医生交接笔记模块
Scenario: Search for patients on the bases of filter criteria
Given I am on website login page
When I put username, password and select database:
| Field | Value |
| username | test |
| password | pass |
| database | test|
Then I login to eoasis
Then I click on doctors hand over notes link
And I am on doctors handover notes page
Then I select sites, wards, onCallTeam, grades,potential Discharge, outstanding task,High priority:
| siteList | wardsList | onCallTeamList | gradesList | potentialDischargeCB | outstandingTasksCB | highPriorityCB |
| THE INFIRMARY | INFIRMARY WARD 9 - ASSESSMENT | null | null | null | null | null |
| THE INFIRMARY | INFIRMARY WARD 9 - ASSESSMENT | GENERAL MEDICINE | null | null | null | null |
| THE INFIRMARY | INFIRMARY WARD 9 - ASSESSMENT | GENERAL MEDICINE | CONSULTANT | null | null | null |
| THE INFIRMARY | INFIRMARY WARD 9 - ASSESSMENT | GENERAL MEDICINE | CONSULTANT | true | null | null |
| THE INFIRMARY | INFIRMARY WARD 9 - ASSESSMENT | GENERAL MEDICINE | CONSULTANT | true | true | null |
| THE INFIRMARY | INFIRMARY WARD 9 - ASSESSMENT | GENERAL MEDICINE | CONSULTANT | true | true | true |
Then I click on search button
Then I should see search results
我想重复最后三个步骤,例如选择搜索条件,然后单击搜索按钮,然后检查搜索结果。那么我应该如何打破这个功能文件。如果我使用场景大纲,那么将有两种不同的场景一种用于登录,另一种用于搜索条件。可以吗?在这种情况下会话会保持吗?编写此类功能文件的最佳方法是什么。
或者这是一种正确的写作方式?
【问题讨论】:
标签: unit-testing cucumber