有没有办法我只能宣布这些组一次?

时间:2018-05-09 14:18:32

标签: java selenium testng

我正在使用TestNG& amp;硒

我不得不将这些群组列在&以确保执行这些方法:

@BeforeSuite(groups = { "all", "simple", "smoketest", "login", "layers", "networks", "basemaps", "jobs",
        "inspections", "defects", "projects", "teams", "routes", "search", "schedules", "gateway", "permissions",
        "mesh", "designer", "workflow", "reports", "streetlighting", "collections", "wip", "deletes", "views",
        "create", "edit" })

再次:

@BeforeTest(groups = { "all", "simple", "smoketest", "login", "layers", "networks", "basemaps", "jobs",
        "inspections", "defects", "projects", "teams", "routes", "search", "schedules", "gateway", "permissions",
        "mesh", "designer", "workflow", "reports", "streetlighting", "collections", "wip", "deletes", "views",
        "create", "edit" })

有没有办法只能将所有这些组声明一次,因为这是错误的来源?

1 个答案:

答案 0 :(得分:2)

您可以在testng.xml文件中创建。有关详细信息,请参阅此处 - http://testng.org/doc/documentation-main.html#groups-of-groups