Browse Source

Fix Firefox 45 tests (click issues, screenshots) (#8533)

tags/8.1.0.alpha1
Henri Sara 7 years ago
parent
commit
4445eae397

+ 1
- 1
tests/screenshots

Subproject commit ce9907a1e9f05abceeb9be656b4d1d8d58f0d5bf
Subproject commit c233d26d0af136183eef3707461e2df0d026ff4e

+ 9
- 0
uitest-common/src/main/java/com/vaadin/tests/tb3/AbstractTB3Test.java View File

} }
} }


protected void clickElement(WebElement element) {
if (BrowserUtil.isFirefox(getDesiredCapabilities())) {
// Workaround for Selenium/TB and Firefox 45 issue
((TestBenchElement) (element)).clickHiddenElement();
} else {
element.click();
}
}

protected boolean isLoadingIndicatorVisible() { protected boolean isLoadingIndicatorVisible() {
WebElement loadingIndicator = findElement( WebElement loadingIndicator = findElement(
By.className("v-loading-indicator")); By.className("v-loading-indicator"));

+ 4
- 3
uitest/src/test/java/com/vaadin/tests/components/combobox/ComboBoxClickIconTest.java View File



$(ComboBoxElement.class).first().openPopup(); $(ComboBoxElement.class).first().openPopup();


getDriver().findElements(By.className("gwt-MenuItem")).get(1).click();
clickElement(
getDriver().findElements(By.className("gwt-MenuItem")).get(1));


getDriver().findElement(By.className("v-filterselect"))
.findElement(By.className("v-icon")).click();
clickElement(getDriver().findElement(By.className("v-filterselect"))
.findElement(By.className("v-icon")));


Assert.assertTrue("Unable to find menu items in combobox popup", Assert.assertTrue("Unable to find menu items in combobox popup",
isElementPresent(By.className("gwt-MenuItem"))); isElementPresent(By.className("gwt-MenuItem")));

+ 3
- 3
uitest/src/test/java/com/vaadin/tests/components/combobox/ComboBoxLargeIconsTest.java View File

compareScreen("icons-16x16-page1"); compareScreen("icons-16x16-page1");
cb.openNextPage(); cb.openNextPage();
compareScreen("icons-16x16-page2"); compareScreen("icons-16x16-page2");
cb.findElement(By.vaadin("#popup/item0")).click();
clickElement(cb.findElement(By.vaadin("#popup/item0")));
compareScreen("icons-16x16-selected-1-3-5-9"); compareScreen("icons-16x16-selected-1-3-5-9");


iconSelect.selectByText("32x32"); iconSelect.selectByText("32x32");
ComboBoxElement pageLength0cb = $(ComboBoxElement.class) ComboBoxElement pageLength0cb = $(ComboBoxElement.class)
.caption("Pagelength 0").first(); .caption("Pagelength 0").first();
pageLength0cb.openPopup(); pageLength0cb.openPopup();
pageLength0cb.findElement(By.vaadin("#popup/item1")).click();
clickElement(pageLength0cb.findElement(By.vaadin("#popup/item1")));


ComboBoxElement cb200px = $(ComboBoxElement.class) ComboBoxElement cb200px = $(ComboBoxElement.class)
.caption("200px wide select with 50 items").first(); .caption("200px wide select with 50 items").first();
cb200px.openPopup(); cb200px.openPopup();
cb200px.findElement(By.vaadin("#popup/item1")).click();
clickElement(cb200px.findElement(By.vaadin("#popup/item1")));


ComboBoxElement cb150px = $(ComboBoxElement.class) ComboBoxElement cb150px = $(ComboBoxElement.class)
.caption("150px wide select with 5 items").first(); .caption("150px wide select with 5 items").first();

+ 8
- 6
uitest/src/test/java/com/vaadin/tests/components/ui/ComboboxSelectedItemTextTest.java View File



// Select an element from the first (to test) combobox. // Select an element from the first (to test) combobox.


comboBox.findElement(By.className("v-filterselect-button")).click();
clickElement(
comboBox.findElement(By.className("v-filterselect-button")));
waitForPopup(comboBox); waitForPopup(comboBox);
WebElement comboBoxPopup = vaadinElement( WebElement comboBoxPopup = vaadinElement(
"/VVerticalLayout[0]/Slot[2]/VVerticalLayout[0]/Slot[" "/VVerticalLayout[0]/Slot[2]/VVerticalLayout[0]/Slot["
+ indexToTest + "]/VComboBox[0]#popup"); + indexToTest + "]/VComboBox[0]#popup");
comboBoxPopup.findElements(By.tagName("td")).get(2).click();
clickElement(comboBoxPopup.findElements(By.tagName("td")).get(2));


// Select an element from the second (to focus) combobox to remove // Select an element from the second (to focus) combobox to remove
// focus from the first combobox // focus from the first combobox


comboBoxFocus.findElement(By.className("v-filterselect-button"))
.click();
clickElement(comboBoxFocus
.findElement(By.className("v-filterselect-button")));
waitForPopup(comboBoxFocus); waitForPopup(comboBoxFocus);
comboBoxPopup = vaadinElement( comboBoxPopup = vaadinElement(
"/VVerticalLayout[0]/Slot[2]/VVerticalLayout[0]/Slot[" "/VVerticalLayout[0]/Slot[2]/VVerticalLayout[0]/Slot["
+ indexToFocus + "]/VComboBox[0]#popup"); + indexToFocus + "]/VComboBox[0]#popup");
comboBoxPopup.findElements(By.tagName("td")).get(2).click();
clickElement(comboBoxPopup.findElements(By.tagName("td")).get(2));


// click the button of the first combobox. This would reveal the // click the button of the first combobox. This would reveal the
// unwanted behaviour. // unwanted behaviour.


comboBox.findElement(By.className("v-filterselect-button")).click();
clickElement(
comboBox.findElement(By.className("v-filterselect-button")));


// sadly, screenshot comparison is the only reasonable way to test a // sadly, screenshot comparison is the only reasonable way to test a
// rendering issue. // rendering issue.

Loading…
Cancel
Save