Cucumber 场景:应按 ASC 顺序中的日期按时间顺序列出
场景:事件应按 ASC 顺序中的事件日期按时间顺序列出
我如何在 Cucumber 中测试此场景? 事件有一个名称和一个 event_date。事件显示在 GUI 中的列表中。我希望当事件未排序时测试失败,而当列表按 event_date ASC 顺序排序时测试通过。
真正的问题是如何定义以下步骤
然后 /^I 应该看到一个包含第一个元素“([^\”]*)”$/ do |element| 的列表 ????????????????????????????????????????????????
结尾
Scenario: Events should be listed in chronological order by event date in ASC order
How do i test this scenario in cucumber?
Events has a name and a event_date. Events is shown in a list in the GUI. I want the test to fail when the events is in a unsorted order and the test to pass when the list is sorted by event_date ASC order.
The real problem is how to define the following step
Then /^I should see a list that has the first element "([^\"]*)"$/ do |element|
???????????????????????????????????????????????
end
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
创建与当前日期类似标题的活动。相隔一日。之后您可以检查第一个元素是较旧的事件还是最新的事件。
create your event with like title the current date. Separate by one day. After you can check if the first element is the older event or youngest.