如何在 MSpec 中对测试进行分组?
你能帮我解决我的问题吗?
我正在做一个项目。对于测试,我使用 MSpec。 是否可以分组测试。所以当我运行测试运行程序时,他们应该按组进行测试 即正确的方法:
1)注册用户时,我提供不同的密码,确认密码
- 应返回错误消息
2)注册用户时,我提供所有需要的信息 » 用户应该注册 » 用户应该被重定向到主页
3)当获取标签树时,我得到标签树,
- 我们应该看到标签树
但在我的情况下,它的工作原理如下:
1)注册用户时,我提供不同的密码,确认密码
- 应该返回错误消息
3 )当获取标签树时,我得到标签树,
- 我们应该看到标签树
2)注册用户时,我提供所有需要的信息
- 用户应该注册
- 用户应该重定向到主页
Could you help me please with my problem.
I am working on a project. For tests I use MSpec.
Is it possible to group test. So when I run test runner they should be tested by groups
i.e. for proper way:
1) When registering user, I provide different password and confirmation password
- should return error message
2) When registering user, I provide all needed information
» user should be registered
» user should be redirected to home page
3) When getting tags tree, I get tags tree
- we should see tags tree
But in my case it works like:
1) When registering user, I provide different password and confirmation password
- should return error message
3) When getting tags tree, I get tags tree
- we should see tags tree
2) When registering user, I provide all needed information
- user should be registered
- user should be redirected to home page
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
目前唯一对上下文进行分组的位置是在 HTML 报告中。您需要使用
[Subject]
属性,并为需要分组的上下文提供相同的文本或类型名称。在一个不相关的注释中,我会以不同的方式命名您的上下文/规范:
The only place contexts are grouped right now is in the HTML report. You need to use the
[Subject]
attribute and provide the same text or type name for contexts that need to be grouped.On an unrelated note, I would name your contexts/specifications differently: