Giter Site home page Giter Site logo

abcnull / apitest4j Goto Github PK

View Code? Open in Web Editor NEW
25.0 2.0 19.0 29 KB

java+RESTassured+testng for ApiTest 已完成,可进行正常的接口测试,以后有扩展会不断丰富它 ,要注意框架中用企业微信和百度搜索的接口举例,由于百度接口不用 token 即可搜索,所以百度搜索无问题,而企业微信需要 token 信息,我把自己隐私的 token 信息已经清除了,需要各位自己注册企业微信,然后使用自己的 corpid 和自己通讯录的 corpsecret 放在 testng.xml 中的参数中即可正常测试!

Home Page: https://abcnull.blog.csdn.net/article/details/108056050

Java 100.00%
restassured java testng surefire apitest allure2 maven jenkins datadriven log4j

apitest4j's Introduction

show abcnull's data with the help of github-readme-stats

apitest4j's People

Contributors

abcnull avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

apitest4j's Issues

多场景下的参数化如何进行?

我看了企业微信创建部门的 demo。如下代码,应该是只支持创建某一部门,如果我需要测试各个字段在不同类型下部门创建是否成功,应该怎么做呢?
是不是需要重新创建一个createDepartmentRequest 2,然后在body 中编辑一份另外的数据。如果需要测试各种场景,是不是需要重新创建createDepartmentRequest 3、createDepartmentRequest 4、createDepartmentRequest .....?

/**
     * 企业微信创建部门
     *
     * @return Response
     */
    public Response createDepartment() {
        return given().when()
                .contentType("application/json")
                .body(createDepartmentRequest.get("body"))
                .post(hostUrl + createDepartmentRequest.get("api") + "?access_token=" + token)
                .then().log().body()
                .extract().response();
    }
/**
     * 创建部门接口
     */
    public final static Map<String, String> createDepartmentRequest = new HashMap<String, String>() {
        {
            put("api", "/cgi-bin/department/create");
            put("body",
                    "    {\n" +
                            "       \"name\": \"广州研发中心\",\n" +
                            "       \"name_en\": \"RDGZ\",\n" +
                            "       \"parentid\": 1,\n" +
                            "       \"order\": 1,\n" +
                            "       \"id\": 2\n" +
                            "    }");
        }
    };

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.