Parcourir la source

Fix focus and blur tests for CheckBoxGroup, NativeSelect and RatioButtonGroup

Change-Id: I8454ef0895708eaee0bb2771b28c0a0db2fc76a4
tags/8.0.0.alpha9
Aleksi Hietanen il y a 7 ans
Parent
révision
68f19ab2b0

+ 7
- 5
uitest/src/test/java/com/vaadin/tests/components/checkboxgroup/CheckBoxGroupFocusBlurTest.java Voir le fichier

// click on the second checkbox doesn't fire anything // click on the second checkbox doesn't fire anything
Assert.assertFalse(logContainsText("2.")); Assert.assertFalse(logContainsText("2."));


// click in the middle between the first and the second (inside group).
WebElement first = checkBoxes.get(0);
int middle = (first.getLocation().y + first.getSize().height
+ checkBoxes.get(1).getLocation().y) / 2;
new Actions(getDriver()).moveByOffset(first.getLocation().x, middle)
// move the cursor to the middle of the first element,
// offset to the middle of the two and perform click
new Actions(getDriver()).moveToElement(checkBoxes.get(0))
.moveByOffset(0,
(checkBoxes.get(1).getLocation().y
- checkBoxes.get(0).getLocation().y) / 2)
.click().build().perform(); .click().build().perform();

// no new events // no new events
Assert.assertFalse(logContainsText("2.")); Assert.assertFalse(logContainsText("2."));



+ 1
- 1
uitest/src/test/java/com/vaadin/tests/components/nativeselect/NativeSelectFocusBlurTest.java Voir le fichier

// Focus event is fired // Focus event is fired
Assert.assertTrue(logContainsText("3. Focus Event")); Assert.assertTrue(logContainsText("3. Focus Event"));


options.get(1).sendKeys(Keys.ARROW_UP, Keys.ENTER);
nativeSelect.sendKeys(Keys.ARROW_UP, Keys.ENTER);
// No any new event // No any new event
Assert.assertFalse(logContainsText("4.")); Assert.assertFalse(logContainsText("4."));
} }

+ 6
- 5
uitest/src/test/java/com/vaadin/tests/components/radiobuttongroup/RadioButtonGroupFocusBlurTest.java Voir le fichier

// click on the second radio button doesn't fire anything // click on the second radio button doesn't fire anything
Assert.assertFalse(logContainsText("2.")); Assert.assertFalse(logContainsText("2."));


// click in the middle between the first and the second (inside group).
WebElement first = radioButtons.get(0);
int middle = (first.getLocation().y + first.getSize().height
+ radioButtons.get(1).getLocation().y) / 2;
new Actions(getDriver()).moveByOffset(first.getLocation().x, middle)
// move the cursor to the middle of the first element,
// offset to the middle of the two and perform click
new Actions(getDriver()).moveToElement(radioButtons.get(0))
.moveByOffset(0,
(radioButtons.get(1).getLocation().y
- radioButtons.get(0).getLocation().y) / 2)
.click().build().perform(); .click().build().perform();
// no new events // no new events
Assert.assertFalse(logContainsText("2.")); Assert.assertFalse(logContainsText("2."));

Chargement…
Annuler
Enregistrer