Subproject commit ce9907a1e9f05abceeb9be656b4d1d8d58f0d5bf | |||||
Subproject commit c233d26d0af136183eef3707461e2df0d026ff4e |
} | } | ||||
} | } | ||||
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")); |
$(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"))); |
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(); |
// 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. |