我的业务用户喜欢使用 then 句子“它应该被创建”,它由场景的上下文决定。例如:
Given I have gift certificate for "<name>"
When I enter the gift certificate
Then It should be created
或者
Given Customer order return for order "<order_no>"
When I create the customer order return
Then It should be created
在“那么它应该被创建”中,我想检索创建的礼券或客户订单退货以进行比较。但是,它们具有完全不同的 API 和对象。
首先,有没有办法在 Python Behave 中做到这一点而不会得到“Exception AmbiguousStep:”?
如果不是,那么在 BDD 世界中最好的做法是什么,而不用强迫用户不断重复自己说“那么应该创建礼券”或“那么应该创建客户订单退货”?
谢谢。