Can I run a specific testng test group via maven?

前端 未结 3 523
梦毁少年i
梦毁少年i 2020-12-15 03:53

I have several testng test groups, e.g. group1,group2,group3... These are defined in my pom.xml and all get run when I execute \"mvn test\". What do I need to run to only e

相关标签:
3条回答
  • 2020-12-15 04:31

    Try

    mvn test -Dgroups=group3,group2
    
    0 讨论(0)
  • 2020-12-15 04:33

    I came across this question while looking how to disable particular test group and Radadiya's answer confused me a bit.

    To run particular groups use this, as mentioned by Eugene Kuleshov. docs

    mvn test -Dgroups=group1,group2
    

    But to exclude some group, use this (note excluded vs exclude). docs .

    mvn test -DexcludedGroups=group3,group4
    
    0 讨论(0)
  • 2020-12-15 04:50

    You can include and exclude specific group during maven test execution.

    (1) Include Specific Groups

    mvn clean test -DincludeGroups=TestGroup1,TestGroup2
    

    (2) Exclude Specific Groups

    mvn clean test -DexcludeGroups=TestGroup3,TestGroup4
    
    0 讨论(0)
提交回复
热议问题