Beispiel #1
0
  private void ascendingDescendingSortingOnColumn(int column, String firstCharOfRowWhenDescending) {

    // ascending
    guardXhr(selenium).click(unsortedLink.format(column));

    JQueryLocator td = firstRowSomeColumn.format(column);
    String checkedValue = selenium.getText(td);

    assertEquals(
        String.valueOf(checkedValue.charAt(0)),
        "A",
        "Rows should be sorted in an ascending order, by column " + td.getRawLocator());

    // descending
    guardXhr(selenium).click(ascendingLink);

    checkedValue = selenium.getText(td);

    assertEquals(
        String.valueOf(checkedValue.charAt(0)),
        firstCharOfRowWhenDescending,
        "Rows should be sorted in an descending order, by column " + td.getRawLocator());
  }
  @Test
  public void testSelectWithMouse() {
    guardNoRequest(selenium).mouseDown(button);
    selenium.mouseUp(button);
    assertTrue(selenium.isVisible(popup), "Popup should be displayed.");

    for (int i = 0; i < 50; i++) {
      assertTrue(
          selenium.isVisible(options.format(i)), "Select option " + i + " should be displayed.");
    }

    String[] selectOptions = {"Alabama", "Hawaii", "Massachusetts", "New Mexico", "South Dakota"};
    for (int i = 0; i < 50; i += 10) {
      assertEquals(
          selenium.getText(options.format(i)), selectOptions[i / 10], "Select option nr. " + i);
    }

    guardNoRequest(selenium).click(options.format(10));
    guardXhr(selenium).fireEvent(input, Event.BLUR);
    assertTrue(selenium.belongsClass(options.format(10), "rf-sel-sel"));

    waitGui.failWith("Bean was not updated").until(textEquals.locator(output).text("Hawaii"));
    phaseInfo.assertListener(PhaseId.PROCESS_VALIDATIONS, "value changed: null -> Hawaii");
  }