Cucumber CRUD 编辑和预览页面
我应该如何执行以下步骤:
Given I should have Post with title "Hi" and text "Hello there"
And I should be on the show page for Post with ... some data
Then I click edit button
And I should be on edit page #of the some earlier created object
首先,我可以以某种方式保存在前面的步骤中创建的实体,而不是重复标题和文本(但是,在某些情况下我无法确定它)?也许没有必要这样做,足以写出像“我看到文本“标题””这样的东西? 我发现一些开发人员不通过 bdd 人员进行测试,例如路由(在我的例子中)、验证等。你能给我什么建议?
如果需要进行此路由测试,我如何解析该字符串,因为它是典型的CRUD,也许它已经做了很多次,但我找不到它。
How should I do step like:
Given I should have Post with title "Hi" and text "Hello there"
And I should be on the show page for Post with ... some data
Then I click edit button
And I should be on edit page #of the some earlier created object
First, can I somehow save an Entity that was created in previous steps, instead of repeating Title and text (however, I can't know it definitely in some cases)? And perhaps there is no need to do it, enough to write smth like "I see text "title""?
I saw that some developers doesn't test through bdd staff like routing (in my case), validation and whatever. What can you advise to me?
And if there is a need to do this routing test how can i parse that string, cause it's a typical crud, perhaps it has done many times, but i can't find it.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您的问题很难理解,但要部分回答:您可以使用实例变量在步骤之间共享状态,例如
Your question is quite difficult to follow, but to answer it in part: You can share state between steps using instance variables, e.g.