|
@@ -80,62 +80,62 @@ public class LoginPageTest {
|
|
};
|
|
};
|
|
}
|
|
}
|
|
|
|
|
|
- @Test(dataProvider = "图片验证码")
|
|
|
|
- @Description("异常测试用例:【密码登录】验证码为空、错误,登录失败")
|
|
|
|
- @Story("登录")
|
|
|
|
- public void vercodeEmptyLoginFail(String vercode){
|
|
|
|
- String code=LoginPage.getLoginPage().getImageVercode();
|
|
|
|
- HashMap<String, Object> map=new HashMap<>();
|
|
|
|
- map.put("_file", "/apijson/page/loginPage/apiPcpLogin.json");
|
|
|
|
- map.put("username",config.username);
|
|
|
|
- map.put("password",config.password);
|
|
|
|
- map.put("code",vercode);
|
|
|
|
- map.put("key",code);
|
|
|
|
- Response response=LoginPage.getLoginPage().passwordLoginSuccess(map);
|
|
|
|
- assertEquals((int) response.path("code"),400);
|
|
|
|
- assertTrue(response.path("data")==null);
|
|
|
|
- assertEquals(response.path("message"),"输入的验证码不一致");
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- @DataProvider(name = "验证码Key")
|
|
|
|
- public String[][] keyData(){
|
|
|
|
- return new String[][]{
|
|
|
|
- {""},{"1"}
|
|
|
|
- };
|
|
|
|
- }
|
|
|
|
|
|
+// @Test(dataProvider = "图片验证码")
|
|
|
|
+// @Description("异常测试用例:【密码登录】验证码为空、错误,登录失败")
|
|
|
|
+// @Story("登录")
|
|
|
|
+// public void vercodeEmptyLoginFail(String vercode){
|
|
|
|
+// String code=LoginPage.getLoginPage().getImageVercode();
|
|
|
|
+// HashMap<String, Object> map=new HashMap<>();
|
|
|
|
+// map.put("_file", "/apijson/page/loginPage/apiPcpLogin.json");
|
|
|
|
+// map.put("username",config.username);
|
|
|
|
+// map.put("password",config.password);
|
|
|
|
+// map.put("code",vercode);
|
|
|
|
+// map.put("key",code);
|
|
|
|
+// Response response=LoginPage.getLoginPage().passwordLoginSuccess(map);
|
|
|
|
+// assertEquals((int) response.path("code"),400);
|
|
|
|
+// assertTrue(response.path("data")==null);
|
|
|
|
+// assertEquals(response.path("message"),"输入的验证码不一致");
|
|
|
|
+// }
|
|
|
|
|
|
- @Test(dataProvider = "验证码Key")
|
|
|
|
- @Description("异常测试用例:【密码登录】验证码的key为空、错误,登录失败")
|
|
|
|
- @Story("登录")
|
|
|
|
- public void keyEmptyLoginFail(String key){
|
|
|
|
- String code=LoginPage.getLoginPage().getImageVercode();
|
|
|
|
- HashMap<String, Object> map=new HashMap<>();
|
|
|
|
- map.put("_file", "/apijson/page/loginPage/apiPcpLogin.json");
|
|
|
|
- map.put("username",config.username);
|
|
|
|
- map.put("password",config.password);
|
|
|
|
- map.put("code",code.substring(code.length()-4));
|
|
|
|
- map.put("key",key);
|
|
|
|
- Response response=LoginPage.getLoginPage().passwordLoginSuccess(map);
|
|
|
|
- assertEquals((int) response.path("code"),400);
|
|
|
|
- assertTrue(response.path("data")==null);
|
|
|
|
- assertEquals(response.path("message"),"验证码已过期");
|
|
|
|
- }
|
|
|
|
|
|
+// @DataProvider(name = "验证码Key")
|
|
|
|
+// public String[][] keyData(){
|
|
|
|
+// return new String[][]{
|
|
|
|
+// {""},{"1"}
|
|
|
|
+// };
|
|
|
|
+// }
|
|
|
|
+//
|
|
|
|
+// @Test(dataProvider = "验证码Key")
|
|
|
|
+// @Description("异常测试用例:【密码登录】验证码的key为空、错误,登录失败")
|
|
|
|
+// @Story("登录")
|
|
|
|
+// public void keyEmptyLoginFail(String key){
|
|
|
|
+// String code=LoginPage.getLoginPage().getImageVercode();
|
|
|
|
+// HashMap<String, Object> map=new HashMap<>();
|
|
|
|
+// map.put("_file", "/apijson/page/loginPage/apiPcpLogin.json");
|
|
|
|
+// map.put("username",config.username);
|
|
|
|
+// map.put("password",config.password);
|
|
|
|
+// map.put("code",code.substring(code.length()-4));
|
|
|
|
+// map.put("key",key);
|
|
|
|
+// Response response=LoginPage.getLoginPage().passwordLoginSuccess(map);
|
|
|
|
+// assertEquals((int) response.path("code"),400);
|
|
|
|
+// assertTrue(response.path("data")==null);
|
|
|
|
+// assertEquals(response.path("message"),"验证码已过期");
|
|
|
|
+// }
|
|
|
|
|
|
- @Test()
|
|
|
|
- @Description("异常测试用例:【密码登录】所有字段为空,登录失败")
|
|
|
|
- @Story("登录")
|
|
|
|
- public void allEmptyLoginFail(){
|
|
|
|
- HashMap<String, Object> map=new HashMap<>();
|
|
|
|
- map.put("_file", "/apijson/page/loginPage/apiPcpLogin.json");
|
|
|
|
- map.put("username","");
|
|
|
|
- map.put("password","");
|
|
|
|
- map.put("code","");
|
|
|
|
- map.put("key","");
|
|
|
|
- Response response=LoginPage.getLoginPage().passwordLoginSuccess(map);
|
|
|
|
- assertEquals((int) response.path("code"),400);
|
|
|
|
- assertTrue(response.path("data")==null);
|
|
|
|
- assertEquals(response.path("message"),"验证码已过期");
|
|
|
|
- }
|
|
|
|
|
|
+// @Test()
|
|
|
|
+// @Description("异常测试用例:【密码登录】所有字段为空,登录失败")
|
|
|
|
+// @Story("登录")
|
|
|
|
+// public void allEmptyLoginFail(){
|
|
|
|
+// HashMap<String, Object> map=new HashMap<>();
|
|
|
|
+// map.put("_file", "/apijson/page/loginPage/apiPcpLogin.json");
|
|
|
|
+// map.put("username","");
|
|
|
|
+// map.put("password","");
|
|
|
|
+//// map.put("code","");
|
|
|
|
+//// map.put("key","");
|
|
|
|
+// Response response=LoginPage.getLoginPage().passwordLoginSuccess(map);
|
|
|
|
+// assertEquals((int) response.path("code"),400);
|
|
|
|
+// assertTrue(response.path("data")==null);
|
|
|
|
+// assertEquals(response.path("message"),"验证码已过期");
|
|
|
|
+// }
|
|
|
|
|
|
// @Test()
|
|
// @Test()
|
|
// @Description("正常测试用例:【验证码登录】手机号、验证码正确,登录成功")
|
|
// @Description("正常测试用例:【验证码登录】手机号、验证码正确,登录成功")
|
|
@@ -175,39 +175,39 @@ public class LoginPageTest {
|
|
// assertEquals(response.path("message"),"用户不存在或者已禁用");
|
|
// assertEquals(response.path("message"),"用户不存在或者已禁用");
|
|
// }
|
|
// }
|
|
|
|
|
|
- @DataProvider(name = "短信验证码")
|
|
|
|
- public String[][] vercodeMessageData(){
|
|
|
|
- return new String[][]{
|
|
|
|
- {""},{"1"}
|
|
|
|
- };
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
-
|
|
|
|
- @Test(dataProvider = "短信验证码")
|
|
|
|
- @Description("异常测试用例:【验证码登录】验证码为空,登录失败")
|
|
|
|
- @Story("登录")
|
|
|
|
- public void vercodeNullLoginFail(String code){
|
|
|
|
- HashMap<String, Object> map=new HashMap<>();
|
|
|
|
- map.put("_file", "/apijson/page/loginPage/apiPcpVerLogin.json");
|
|
|
|
- map.put("phone",config.username);
|
|
|
|
- map.put("code",code);
|
|
|
|
- Response response=LoginPage.getLoginPage().vercodeLoginSuccess(map);
|
|
|
|
- assertEquals((int) response.path("code"),400);
|
|
|
|
- assertTrue(response.path("data")==null);
|
|
|
|
- assertEquals(response.path("message"),"验证码错误或已过期");
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- @Test
|
|
|
|
- @Description("异常测试用例:【验证码登录】手机号、验证码为空,登录失败")
|
|
|
|
- @Story("登录")
|
|
|
|
- public void allEmptyVercodeLoginFail(){
|
|
|
|
- HashMap<String, Object> map=new HashMap<>();
|
|
|
|
- map.put("_file", "/apijson/page/loginPage/apiPcpVerLogin.json");
|
|
|
|
- map.put("phone","");
|
|
|
|
- map.put("code","");
|
|
|
|
- Response response=LoginPage.getLoginPage().vercodeLoginSuccess(map);
|
|
|
|
- assertEquals((int) response.path("code"),400);
|
|
|
|
- assertTrue(response.path("data")==null);
|
|
|
|
- assertEquals(response.path("message"),"验证码错误或已过期");
|
|
|
|
- }
|
|
|
|
|
|
+// @DataProvider(name = "短信验证码")
|
|
|
|
+// public String[][] vercodeMessageData(){
|
|
|
|
+// return new String[][]{
|
|
|
|
+// {""},{"1"}
|
|
|
|
+// };
|
|
|
|
+// }
|
|
|
|
+//
|
|
|
|
+//
|
|
|
|
+// @Test(dataProvider = "短信验证码")
|
|
|
|
+// @Description("异常测试用例:【验证码登录】验证码为空,登录失败")
|
|
|
|
+// @Story("登录")
|
|
|
|
+// public void vercodeNullLoginFail(String code){
|
|
|
|
+// HashMap<String, Object> map=new HashMap<>();
|
|
|
|
+// map.put("_file", "/apijson/page/loginPage/apiPcpVerLogin.json");
|
|
|
|
+// map.put("phone",config.username);
|
|
|
|
+// map.put("code",code);
|
|
|
|
+// Response response=LoginPage.getLoginPage().vercodeLoginSuccess(map);
|
|
|
|
+// assertEquals((int) response.path("code"),400);
|
|
|
|
+// assertTrue(response.path("data")==null);
|
|
|
|
+// assertEquals(response.path("message"),"验证码错误或已过期");
|
|
|
|
+// }
|
|
|
|
+//
|
|
|
|
+// @Test
|
|
|
|
+// @Description("异常测试用例:【验证码登录】手机号、验证码为空,登录失败")
|
|
|
|
+// @Story("登录")
|
|
|
|
+// public void allEmptyVercodeLoginFail(){
|
|
|
|
+// HashMap<String, Object> map=new HashMap<>();
|
|
|
|
+// map.put("_file", "/apijson/page/loginPage/apiPcpVerLogin.json");
|
|
|
|
+// map.put("phone","");
|
|
|
|
+// map.put("code","");
|
|
|
|
+// Response response=LoginPage.getLoginPage().vercodeLoginSuccess(map);
|
|
|
|
+// assertEquals((int) response.path("code"),400);
|
|
|
|
+// assertTrue(response.path("data")==null);
|
|
|
|
+// assertEquals(response.path("message"),"验证码错误或已过期");
|
|
|
|
+// }
|
|
}
|
|
}
|