Commit c32c385a by fangyuan

add env 变量设置

parent 1f5834e5
...@@ -146,10 +146,12 @@ public class BaseTest extends AbstractTestNGSpringContextTests { ...@@ -146,10 +146,12 @@ public class BaseTest extends AbstractTestNGSpringContextTests {
/** /**
* 默认执行线上环境 * 默认执行线上环境
*/ */
String env = "prod"; // 本地执行时使用
if (xmAppApi.getTerminal().equals("M")){ // String env = "prod";
env="rc"; // 防止多个工程运行时,环境变量名冲突
} // 服务器集成测试配置
String env = System.getenv("live_env");
logger.info(env);
host = prop.getProperty(env); host = prop.getProperty(env);
......
...@@ -45,7 +45,7 @@ public class CommonLogin { ...@@ -45,7 +45,7 @@ public class CommonLogin {
JSONObject object = JSON.parseObject(parameters).getJSONObject(loginUser); //获取name在parameter.json文件中的信息 JSONObject object = JSON.parseObject(parameters).getJSONObject(loginUser); //获取name在parameter.json文件中的信息
Assert.assertNotNull(object, "找不到用户登录信息,请检查parameter.json 文件是否已有保存登录账号信息!"); Assert.assertNotNull(object, "找不到用户登录信息,请检查parameter.json 文件是否已有保存登录账号信息!");
if (!object.isEmpty()) { if (!object.isEmpty()) {
JSONObject account = object.getJSONObject(env); JSONObject account = object.getJSONObject("prod");
String accountNo = account.getString("accountNo"); String accountNo = account.getString("accountNo");
String uid = account.getString("uid"); String uid = account.getString("uid");
String userType = account.getString("userType"); String userType = account.getString("userType");
......
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