分组这节,同样的代码,没有分组效果

来源:5-9 组测试中的方法分组测试

萍SUN

2020-01-14

package com.course.testng.groups;

import org.testng.annotations.AfterGroups;
import org.testng.annotations.BeforeGroups;
import org.testng.annotations.Test;

public class GroupsMethod {

    @Test(groups = "server")
    public void test1(){
        System.out.println("这是服务端组的测试方法11111");
    }

    @Test(groups = "server")
    public void test2(){
        System.out.println("这是服务端组的测试方法2222");
    }

    @Test(groups = "client")
    public void test3(){
        System.out.println("这是客户端组的测试方法33333");
    }
    @Test(groups = "client")
    public void test4(){
        System.out.println("这是客户端组的测试方法4444");
    }

    @BeforeGroups("server")
    public void beforeGroupsOnServer(){
        System.out.println("这是服务端组运行之前运行的方法");
    }

    @AfterGroups("server")
    public void afterGroupsOnServer(){
        System.out.println("这是服务端组运行之后运行的方法!!!!!");
    }

    @BeforeGroups("client")
    public void beforeGroupsOnClient(){
        System.out.println("这是客户端组运行之前运行的方法");
    }

    @AfterGroups("client")
    public void afterGroupsOnClient(){
        System.out.println("这是客户端组运行之后运行的方法!!!!!");
    }

}
http://img1.sycdn.imooc.com/szimg/5e1d855c08f0698c19001288.jpg

写回答

2回答

慕移动7412903

2020-03-08

请问下怎么改版本配置,谢谢

0
1
萍SUN
修改成6.10 version org.testng testng 6.10
2020-03-09
共1条回复

萍SUN

提问者

2020-01-16

pom.xml文件里改了版本配置

0
3
慕沐3050262
回复
qq_浅诺_lpEV07
请问如何解决
2021-03-08
共3条回复

Java接口自动化测试实战,搞定理论基础+典型应用场景

打破传统测试用例设计方法,搞懂基于TestNG的接口自动化测试技术

2086 学习 · 920 问题

查看课程