Cucumber 场景:应按 ASC 顺序中的日期按时间顺序列出

发布于 2024-09-29 03:23:03 字数 292 浏览 0 评论 0原文

场景:事件应按 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

っ左 2024-10-06 03:23:03

创建与当前日期类似标题的活动。相隔一日。之后您可以检查第一个元素是较旧的事件还是最新的事件。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文