@Test(dependsOnMethods = "testAppServiceBilling")
    public void testHistoryBilling() {
        // 上一个月
        Calendar calendar = Calendar.getInstance();
        calendar.add(Calendar.MONTH, -1);
        String lastMonth = new SimpleDateFormat("yyyy-MM").format(calendar.getTime());
        // 需要测试的历史月份账单统计
        double his_m_bill = 0.00;
        String xp = String.format(
                "//table[@id='billingListTable']/tbody/tr/td[1][starts-with(text(), '%s')]", lastMonth);
        if (be.isElementPresent(xp, 2000)) {
            his_m_bill = Double.parseDouble(be.getText(xp));
        }
        // 滚动条到页面底部
        executeJS(be, getCommonStr("scroll_bottom"));
        executeJS(be, String.format(getCustom(filekey, "input_date_js"), lastMonth));
        be.pause(500);
        be.click("//button[@id='billingQueryBtn']");
        RemoteWebDriver driver = be.getBrowserCore();
        if (be.isElementPresent("//table[@id='billDetailTable']", 5000)) {
            int allrows = driver.findElementsByXPath("//table[@id='billDetailTable']/tbody/tr").size();
            double cal_total = 0.00;
            double page_total = 0.00;
            for (int i = 1; i <= allrows; i++) {
                int each_rd_num = driver.findElementsByXPath(
                        String.format("//table[@id='billDetailTable']/tbody/tr[%s]/td", i)).size();
                if (each_rd_num > 3) {
                    double day = Double.parseDouble(be.getText(String.format(
                            "//table[@id=\"billDetailTable\"]/tbody/tr[%s]/td[last()-2]", i)));
                    double dayprice = Double.parseDouble(be.getText(String.format(
                            "//table[@id=\"billDetailTable\"]/tbody/tr[%s]/td[last()-1]", i)));
                    double smalltotal = Double.parseDouble(be.getText(String.format(
                            "//table[@id=\"billDetailTable\"]/tbody/tr[%s]/td[last()]", i)));
                    // logger.info("day * dayprice = " + round(mul(day, dayprice), 2));
                    // logger.info("smalltotal = " + smalltotal);
                    assertThat(compare(round(mul(day, dayprice), 2), smalltotal), is(0));
                    cal_total = add(cal_total, smalltotal);
                } else if (each_rd_num == 3) {
                    page_total = Double.parseDouble(be.getText(String.format(
                            "//table[@id='billDetailTable']/tbody/tr[%s]/td[last()]/strong", i)));
                }
            }
            cal_total = round(cal_total, 2);
            System.out.println("history_bill: page_total=" + page_total);
            System.out.println("history_bill: cal_total=" + cal_total);
            assertThat(compare(page_total, cal_total), is(0));
            if (his_m_bill > 0) {
                assertThat(compare(his_m_bill, cal_total), is(0));
            }
        }
    }