Priority in TestNG with multiple classes

后端 未结 6 1003
再見小時候
再見小時候 2020-11-27 20:15

I\'m facing with the following problem: I created two classes which include @Tests with priority attribute:

@Test( priority = 1 )
public void testA1() {
             


        
6条回答
  •  难免孤独
    2020-11-27 21:06

    you should change the priority on B test to be like this

        @Test( priority = 4 )
        public void testB1() {
            System.out.println("testB1");
        }
    
        @Test( priority = 5 )
        public void testB2() {
            System.out.println("testB2");
        }
    
        @Test( priority = 6 )
        public void testB3() {
            System.out.println("testB3");
        }
    

    and no changes for XML because it runs as priority

提交回复
热议问题