コード例 #1
0
  @Test(
      description = "Measure the time to load the Calendar, month view, 1 appointment",
      groups = {"performance"})
  public void ZmCalendarApp_02() throws HarnessException {

    // Create an appointment
    String subject = "subject" + ZimbraSeleniumProperties.getUniqueString();
    AppointmentItem.createAppointmentSingleDay(
        app.zGetActiveAccount(),
        Calendar.getInstance(),
        60,
        null,
        subject,
        "content" + ZimbraSeleniumProperties.getUniqueString(),
        "location" + ZimbraSeleniumProperties.getUniqueString(),
        null);

    // Start the perf token
    PerfToken token =
        PerfMetrics.startTimestamp(
            PerfKey.ZmCalendarApp, "Load the calendar app, month view, 1 appointment");

    // Go to calendar
    // app.zPageCalendar.zNavigateTo();
    app.zPageCalendar.zClickAt("css=td[id='zb__App__Calendar_title']", "");

    PerfMetrics.waitTimestamp(token);

    // Wait for the app to load
    app.zPageCalendar.zWaitForActive();
  }
コード例 #2
0
  @Test(
      description = "Measure the time to load the Calendar, month view, 100 appointment",
      groups = {"performance"})
  public void ZmCalendarApp_03() throws HarnessException {

    // What is today?
    Calendar today = Calendar.getInstance();

    // Import 100 appointments using Calendar.ics and REST
    String filename =
        ZimbraSeleniumProperties.getBaseDirectory() + "/data/public/ics/calendar05/Calendar.ics";
    File file = null;

    // Modify the ICS in two ways:
    // 1. Make the current account the organizer
    // 2. Make the dates equal to this month
    file =
        RestUtil.FileUtils.replaceInFile(
            "*****@*****.**", app.zGetActiveAccount().EmailAddress, new File(filename));
    file =
        RestUtil.FileUtils.replaceInFile(
            "201111", (new SimpleDateFormat("yyyyMM")).format(today.getTime()), file);

    RestUtil rest = new RestUtil();
    rest.setAuthentication(app.zGetActiveAccount());
    rest.setPath("/service/home/~/Calendar");
    rest.setQueryParameter("fmt", "ics");
    rest.setUploadFile(file);
    rest.doPost();

    // Start the perf token
    PerfToken token =
        PerfMetrics.startTimestamp(
            PerfKey.ZmCalendarApp, "Load the calendar app, month view, 100 appointment");

    // Go to calendar
    // app.zPageCalendar.zNavigateTo();
    app.zPageCalendar.zClickAt("css=td[id='zb__App__Calendar_title']", "");

    PerfMetrics.waitTimestamp(token);

    // Wait for the app to load
    app.zPageCalendar.zWaitForActive();
  }