package com.xiaomai.cases.polar.points;

import com.xiaomai.enums.ApiModule;
import com.xiaomai.enums.LoginAccount;
import com.xiaomai.enums.Terminal;
import com.xiaomai.utils.XMBaseTest;
import com.xiaomai.utils.XMJSONPath;
import org.testng.Assert;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;

import javax.annotation.Resource;

public class TestPointsRule extends XMBaseTest {
    @BeforeMethod
    public void beforeTest(){
        xmAppApi.setApiModule(ApiModule.Polar_Points)
                .setApiName("API_memberPoint_saveRule")
                .setLoginUser(LoginAccount.YJ_PROD)
                .setTerminal(Terminal.B);
        dal.setCase_owner("yangjian")
                .setCase_name(Thread.currentThread().getStackTrace()[1].getFileName().split("\\.")[0]);
        super.beforeTest();
    }

    @Resource(name = "pointsTools")
    PointsTools pointsTools;

    @Test(description = "积分规则编辑/保存")//新开场馆和品牌
    public void testMemberPoint_saveRule(){
        //pointsTools.memberPoint_saveRule("");
        pointsTools.memberPoint_saveRule(xmAppApi.getLoginInfo().getStudioId());
        pointsTools.memberPoint_findRule(xmAppApi.getLoginInfo().getStudioId());
        Assert.assertEquals(XMJSONPath.readPath(dataApi.getApi_response(), "$.result.enableMemberPoint"), "YES", "积分规则未开启");


    }
}
