可以使用多个健身装置
是否可以在一个测试表(可编写脚本的即)中使用多个健身固定装置类,如下所示?
|script|FixtureClassOne,FixtureClassTwo|
|AMethodInFixtureClassOne|2|
|AMethodInFixtureClassTwo|2|
Is it possible to use multiple fitnesse fixture classes in one testtable (a scriptable i.e.) as in something like the following?
|script|FixtureClassOne,FixtureClassTwo|
|AMethodInFixtureClassOne|2|
|AMethodInFixtureClassTwo|2|
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这是可能的。您应该将夹具作为库加载。例如:
不再需要在“脚本”标识符之后提供固定装置。
您必须注意,如果装置共享非唯一的方法名称,您就会遇到麻烦
This is possible. You should load the fixture as a library. E.g.:
No need to provide a fixture after the 'script' identifier anymore.
You do have to be aware that if the fixtures share non-unique method names you get into trouble
目标:让多个 Fixtures 与单个 HTML 测试用例关联
如何:当您使用 Fitness HTML 测试用例时,您可能至少有一个与其关联的 Fixture,我们将其称为默认 Fixture。
但是为了访问另一个固定装置(其中执行控制传递给另一个固定装置),请在默认固定装置类中编写一个方法:
从测试用例中,将项目的完全指定位置传递给
run()< /代码> 方法。当
run()
方法将固定装置返回到 HTML 测试用例时,它会通过新的固定装置传递其执行。Objective: To have Multiple Fixtures associated with a single HTML Test Case
How: As you are working with fitnesses HTML Test case, you probably have at least a single fixture associated with it, which we will call default Fixture.
But in order to access another fixture (where control of execution passes to the other fixture), write a method in the default fixture class:
From the Test case, pass the fully specified location with the project to the
run()
method. When therun()
method returns the fixture to the HTML test case, it passes its execution via the new Fixture.