-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
多场景下的参数化如何进行? #1
Comments
你好,没必要创建多个createDepartmentRequest方法,因为首先是多场景测这个功能,也就是说测试用例是多个,createDepartmentRequest可以公用一个,不过测试数据你要写多个,因此你只用自己加数据就行,然后可以结合testng多参数运行case即可 |
public class DemoTest {
@DateProvider(name = "xxx")
public Object[][] fun() {
return new Object[][] {
{"参数列表1", 0, 1},
{"参数列表2", 2, 3}
};
}
@Test(dataProvider = "xxx")
public void TestCreateDepartment(String param1, int param2, int param3) {
}
} |
你的代码里没有找到这种方式,所以我以为createDepartmentRequest需要创建多个方法。 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
我看了企业微信创建部门的 demo。如下代码,应该是只支持创建某一部门,如果我需要测试各个字段在不同类型下部门创建是否成功,应该怎么做呢?
是不是需要重新创建一个createDepartmentRequest 2,然后在body 中编辑一份另外的数据。如果需要测试各种场景,是不是需要重新创建createDepartmentRequest 3、createDepartmentRequest 4、createDepartmentRequest .....?
The text was updated successfully, but these errors were encountered: