Is it possible to put a condition to TestNG to run the test if that is member of two groups?

前端 未结 3 706
庸人自扰
庸人自扰 2020-12-16 06:38

I know you can define in your xml which groups that you want to run, but I want to know whether it is possible to say run these methods if they are both member of groups A &

3条回答
  •  盖世英雄少女心
    2020-12-16 06:53

    Did you try this?

    
    
           
               
                
           
        
    
        
            
        
    
    

    If that doesn't work, you can "hack" around it by having 3 test methods in your class (with preserve order turned on) and have the first 2 tests set a flag on a condition, and then then 3rd test only runs if both conditions are set.

提交回复
热议问题