|
|
@@ -17,10 +17,12 @@ package com.vaadin.tests.components.grid; |
|
|
|
|
|
|
|
import static org.junit.Assert.assertEquals; |
|
|
|
import static org.junit.Assert.assertFalse; |
|
|
|
import static org.junit.Assert.assertNotEquals; |
|
|
|
import static org.junit.Assert.assertTrue; |
|
|
|
|
|
|
|
import org.junit.Test; |
|
|
|
import org.openqa.selenium.WebElement; |
|
|
|
import org.openqa.selenium.interactions.Actions; |
|
|
|
|
|
|
|
import com.vaadin.testbench.By; |
|
|
|
import com.vaadin.testbench.elements.ButtonElement; |
|
|
@@ -59,6 +61,28 @@ public class WidgetRenderersTest extends MultiBrowserTest { |
|
|
|
assertEquals("Clicked!", button.getText()); |
|
|
|
} |
|
|
|
|
|
|
|
@Test |
|
|
|
public void testButtonRendererAfterCellBeingFocused() { |
|
|
|
openTestURL(); |
|
|
|
|
|
|
|
GridCellElement buttonCell = getGridCell(0, 1); |
|
|
|
assertFalse("cell should not be focused before focusing", |
|
|
|
buttonCell.isFocused()); |
|
|
|
|
|
|
|
// avoid clicking on the button |
|
|
|
buttonCell.click(150, 5); |
|
|
|
assertTrue("cell should be focused after focusing", |
|
|
|
buttonCell.isFocused()); |
|
|
|
|
|
|
|
WebElement button = buttonCell.findElement(By.className("gwt-Button")); |
|
|
|
assertNotEquals("Button should not be clicked before click", |
|
|
|
"Clicked!", button.getText()); |
|
|
|
|
|
|
|
new Actions(getDriver()).moveToElement(button).click().perform(); |
|
|
|
assertEquals("Button should be clicked after click", "Clicked!", |
|
|
|
button.getText()); |
|
|
|
} |
|
|
|
|
|
|
|
@Test |
|
|
|
public void testImageRenderer() { |
|
|
|
openTestURL(); |