예제 #1
0
  public void testTypeIntoInputSmall() {
    typeToInputActionWithXHRWaitRequest(number).perform();

    assertEquals(output.getText(), DEFAULT_MIN_VALUE_STR, "Output was not updated.");
    assertEquals(
        slider.advanced().getInput().getIntValue(), DEFAULT_MIN_VALUE, "Input was not updated.");
  }
예제 #2
0
  public void testTypeIntoInputNotNumber() {
    typeToInputActionWithWaitRequest("RF 4", WaitRequestType.NONE).perform();

    assertEquals(output.getText(), "2", "Output should not be updated.");
    assertEquals(
        slider.advanced().getInput().getStringValue(), "2", "Input should not be updated.");
  }
예제 #3
0
  public void testMoveWithSlider() {
    moveWithSliderActionWithWaitRequest(0).perform();
    Graphene.waitGui().until().element(output).text().equalTo("-10");
    assertEquals(slider.advanced().getInput().getStringValue(), "-10", "Input was not updated.");
    assertEquals(output.getText(), "-10", "Output was not updated.");

    moveWithSliderActionWithWaitRequest(35).perform();
    Graphene.waitGui().until().element(output).text().equalTo("-7");
    assertEquals(slider.advanced().getInput().getStringValue(), "-7", "Input was not updated.");
    assertEquals(output.getText(), "-7", "Output was not updated.");

    moveWithSliderActionWithWaitRequest(slider.advanced().getWidth()).perform();
    Graphene.waitGui().until().element(output).text().equalTo("10");
    assertEquals(slider.advanced().getInput().getStringValue(), "10", "Input was not updated.");
    assertEquals(output.getText(), "10", "Output was not updated.");
  }
예제 #4
0
  public void testTypeIntoInputDecimal() {
    typeToInputActionWithXHRWaitRequest(number).perform();

    Double newNumber = new Double(number);
    assertEquals(
        output.getText(), newNumber == 0 ? "0" : newNumber.toString(), "Output was not updated.");
    assertEquals(
        slider.advanced().getInput().getStringValue(),
        newNumber == 0 ? "0" : newNumber.toString(),
        "Input was not updated.");
  }
예제 #5
0
  public void testClickRightArrow() {
    int startValue = slider.advanced().getInput().getIntValue();
    int clicks = 1;

    inputNumberSliderAttributes.set(InputNumberSliderAttributes.showArrows, Boolean.TRUE);

    MetamerPage.waitRequest(slider, WaitRequestType.XHR).increase();

    Graphene.waitGui()
        .until("Output was not updated.")
        .element(output)
        .text()
        .equalTo(String.valueOf(startValue + clicks));
  }