Demo entry 6761599

jjj

   

Submitted by anonymous on Sep 28, 2018 at 15:03
Language: Kotlin. Code size: 5.3 kB.

package com.jlc.testcases.other

import com.jlc.apiHandler.base.BaseTest
import com.jlc.apiHandler.feature.enumeration.Constant.Module.OTHER
import com.jlc.apiHandler.feature.enumeration.Constant.ParamsName.*
import com.jlc.apiHandler.feature.enumeration.Constant.RuntimeEnvironment.*
import com.jlc.apiHandler.utils.Armory.now
import com.jlc.feature.extension.*
import io.qameta.allure.*
import org.hamcrest.Matchers.equalTo
import org.testng.annotations.Test

@Epic(OTHER)
@Feature("首页")
class IndexTest: BaseTest() {

    @Test(description = "4.01 获取首页 banner 图" ,groups = [test,pre,ol,rapid])
    @Severity(SeverityLevel.NORMAL)
    @Description("接口名称: register/banner")
    fun getBannerTest(){
        given_()
                .signedParams(mapOf(
                        MOD to "register",
                        ACT to "banner" ,
                        SOURCE to "5" ,
                        TIME to now() ,
                        VER to "3.20"
                )).
        when_()
                .post2json("/ebankApp/reg.html").
        then_()
                .statusCode(200)
                .body("code" , equalTo(0))
    }

    @Test(description = "4.02 各类介绍页链接获取" ,groups = [test,pre,ol])
    @Severity(SeverityLevel.NORMAL)
    @Description("接口名称: register/staticPage")
    fun getIntroductionPageLinkTest(){
        given_()
                .signedParams(mapOf(
                        MOD to "register",
                        ACT to "staticPage",
                        SOURCE to "5" ,
                        TIME to now() ,
                        VER to "3.20"

                )).
        when_()
                .post2json("/ebankApp/reg.html").
        then_()
                .statusCode(200)
                .body("code" , equalTo(0))
    }

    @Test(description = "4.22 综合站pc首页项目展示" ,groups = [test,pre,ol, rapid])
    @Severity(SeverityLevel.NORMAL)
    @Description("接口名称: index/zhzIndexProjects")
    fun zhzIndexProjectsTest(){
        given_()
                .signedParams(mapOf(
                        MOD to "index",
                        ACT to "zhzIndexProjects",
                        TOKEN to user.tokenAndId(),
                        SOURCE to "5" ,
                        TIME to now() ,
                        VER to "3.20"
                )).
        when_()
                .post2json("ebank-app/jinjiaosuo.html").
        then_()
                .statusCode(200)
                .body("code" ,equalTo(0))
    }

    @Test(description = "4.24 综合站app首页项目展示" ,groups = [test,pre,ol])
    @Severity(SeverityLevel.NORMAL)
    @Description("接口名称: index/recommendLoanPlans")
    fun recommendLoanPlansTest(){
        given_()
                .signedParams(mapOf(
                        MOD to "index",
                        ACT to "recommendLoanPlans",
                        SOURCE to "5" ,
                        TIME to now() ,
                        VER to "3.20"
                )).
        when_()
                .post2json("jinjiaosuo.html").
        then_()
                .statusCode(200)
                .body("code" ,equalTo(0))
    }

    @Test(description = "4.11 获取公告列表" ,groups = [test,pre,ol])
    @Severity(SeverityLevel.NORMAL)
    @Description("接口名称: record/getMessageList")
    fun getMessageListTest(){
        given_()
                .signedParams(mapOf(
                        MOD to "record",
                        ACT to "getMessageList",
                        PAGE_SIZE to "10",
                        PAGE to "1",
                        SOURCE to "5" ,
                        TIME to now() ,
                        VER to "3.20"
                )).
        when_()
                .post2json("/ebankApp/record.html").
        then_()
                .statusCode(200)
                .body("code" ,equalTo(0))
    }

    @Test(description = "4.12 获取app启动页面图片" ,groups = [test,pre,ol])
    @Severity(SeverityLevel.NORMAL)
    @Description("接口名称: register/appStartPage")
    fun appStartPageTest(){
        given_()
                .signedParams(mapOf(
                        MOD to "register",
                        ACT to "appStartPage",
                        SOURCE to "5" ,
                        TIME to now() ,
                        VER to "3.20"
                )).
        when_()
                .post2json("ebankApp/reg.html").
        then_()
                .statusCode(200)
                .body("code" ,equalTo(0))
    }


    //@Test(description = "4.23 合作机构申请")
    @Severity(SeverityLevel.NORMAL)
    @Description("接口名称: index/addCooperativeAgency")
    fun addCooperativeAgencyTest(){
        given_()
                .signedParams(mapOf(
                        MOD to "index",
                        ACT to "addCooperativeAgency",
                        TOKEN to user.tokenAndId(),
                        SOURCE to "5" ,
                        TIME to now() ,
                        VER to "3.20"
                )).
        when_()
                .post2json("ebank-app/jinjiaosuo.html").
        then_()
                .statusCode(200)
                .body("code" ,equalTo(0))
    }
}

This snippet took 0.01 seconds to highlight.

Back to the Entry List or Home.

Delete this entry (admin only).