Commit 7903729d authored by 赵然's avatar 赵然

zr

parent 9bfa6ec4
package http.cases.NewActivityTest;
import base.Config;
import base.DuibaLog;
import http.service.Activity.NewActivityService;
import http.service.hd.DeveloperService;
import io.restassured.response.Response;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.testng.AbstractTestNGSpringContextTests;
import org.testng.Assert;
import org.testng.annotations.DataProvider;
import org.testng.annotations.Test;
import utils.MatcherString;
import java.lang.reflect.Method;
/**
* Created by zhaoran on 2018/11/02
*/
@ContextConfiguration(classes = Config.class)
public class 开发者不可见测试_DuibaTest extends AbstractTestNGSpringContextTests {
@Autowired
NewActivityService newActivityService;
@Autowired
DeveloperService developerService;
private static DuibaLog logger = DuibaLog.getLogger();
@Test(description = "手机端活动应正常打开")
public void 页面访问测试() throws Exception {
//访问活动界面
Response response = newActivityService.index("35374");
//判断结果
Assert.assertEquals(MatcherString.getString(response.asString(),"<title>(.*?)</title>\n",1),"【自动化】开发者不可见","活动页打开异常!");
logger.info("活动页面打开成功");
}
@Test(description = "开发者端活动应不可见")
public void 开发者活动不可见() throws Exception {
Response response =developerService.list2("【自动化】开发者不可见");
Assert.assertEquals(response.asString().contains("【自动化】开发者不可见"), false, "校验活动title失败");
logger.info("校验title成功");
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment