public void testHuaTai_nologinUnderWriting() throws Exception {
    System.out.println("华泰-----------------------------免登录投保");
    // 用户相关信息
    UserDTO user = (new UserSet()).setXYZ_nologin();
    String payPwd = user.getPayPwd();
    int loginId = user.getLoginId();
    // 产品相关信息
    String[] products = (new AllProductSet()).setHuaTai();
    PayResultDTO[] payResults = new PayResultDTO[products.length];
    // CheckAfterPay check = new CheckAfterPay();

    Ins_Front insF = new Ins_Front();
    int start = 0;
    for (int i = start; i < products.length; i++) {
      System.out.println(i + 1);
      String proName = products[i];
      // 前台购买保险产品
      payResults[i] = insF.pay_YJX(selenium, proName, payPwd, 4, true, loginId);
      System.err.println(payResults[i].getFlag());
      if (payResults[i].getFlag().equalsIgnoreCase("noProduct")) start++;
      else {
        selenium.close();
        selenium.selectWindow(null);
      }
    }
    // 购买后查询投保单状态
    // Thread.sleep(50000);
    // if (!check.checkAppStatus(payResults, start)) {
    // String report = "未全部承保,请检查!!!";
    // selenium.click("link=" + report);
    // }
  }
コード例 #2
0
  public void testThirdPayYJX() throws Exception {
    // 用户相关信息
    UserDTO user = (new UserSet()).setNormalUser();
    String username = user.getUsername();
    String password = user.getPassword();
    String payPwd = user.getPayPwd();
    int loginId = user.getLoginId();
    BigDecimal acc = user.getAcc(); // 账户最低余额:0-普通账户,-5000-vip账户
    BigDecimal before_pay = null; // 支付前账户余额
    BigDecimal after_pay = null; // 支付后账户余额

    // 产品相关信息
    ProductDTO[] products = new ProductDTO[2];
    products[0] = (new ProductSet()).setYJX();
    products[1] = (new ProductSet()).setYJX_Coupon();

    // 登录
    Ins_Front insF = new Ins_Front();
    insF.loginFront(selenium, username, password);

    for (int i = 0; i < products.length; i++) {
      System.out.println(i + 1);
      String proName = products[i].getProName();
      String proType = products[i].getProductType();
      int coupon = products[i].getPCoupon(); // 支付时是否可以使用优惠券:0-不可以,1-可以

      // 前台购买保险产品,购买前查询账户余额
      before_pay = (new CommSql()).getAccBall(loginId, acc);
      PayResultDTO payResult = insF.pay_YJX(selenium, proName, payPwd, 4, true, loginId);
      Thread.sleep(30000);
      after_pay = (new CommSql()).getAccBall(loginId, acc);
      System.out.println("购买前账户余额:" + before_pay);
      System.out.println("购买后账户余额:" + after_pay);
      // 支付完成后判断订单、投保单状态及账户余额的正确性
      CheckAfterPay check = new CheckAfterPay();
      check.checkAfterThirdPay(selenium, before_pay, after_pay, payResult, coupon, proType);
    }
  }