From 73a43f2bec76e9f2757e3ad6598b096dec4dd5da Mon Sep 17 00:00:00 2001 From: Artur Signell Date: Wed, 19 Mar 2014 16:21:03 +0200 Subject: Make test work in IE. Disable Firefox which doesn't work Change-Id: I79c0f8bc2a1e394b4ad2159a41ae426c058348ce --- .../tests/components/table/SelectAllRowsTest.java | 27 ++++++++++++++-------- 1 file changed, 17 insertions(+), 10 deletions(-) (limited to 'uitest') diff --git a/uitest/src/com/vaadin/tests/components/table/SelectAllRowsTest.java b/uitest/src/com/vaadin/tests/components/table/SelectAllRowsTest.java index 664b36fa75..2e27675b25 100644 --- a/uitest/src/com/vaadin/tests/components/table/SelectAllRowsTest.java +++ b/uitest/src/com/vaadin/tests/components/table/SelectAllRowsTest.java @@ -21,7 +21,7 @@ import static com.vaadin.tests.components.table.SelectAllRows.TABLE; import static com.vaadin.tests.components.table.SelectAllRows.TOTAL_NUMBER_OF_ROWS; import static org.junit.Assert.assertEquals; -import java.util.Arrays; +import java.util.ArrayList; import java.util.List; import org.junit.Test; @@ -37,12 +37,20 @@ public class SelectAllRowsTest extends MultiBrowserTest { private final static String TABLE_ROW = "v-table-row"; + @Override + protected DesiredCapabilities getDesiredCapabilities() { + DesiredCapabilities cap = super.getDesiredCapabilities(); + cap.setCapability("requireWindowFocus", true); + return cap; + } + @Override public List getBrowsersToTest() { - // Pressing Shift modifier key does not work with TestBench and IE - // (#8621) - return Arrays.asList(Browser.FIREFOX.getDesiredCapabilities(), - Browser.CHROME.getDesiredCapabilities()); + // Pressing Shift modifier key does not work with Firefox + ArrayList browsers = new ArrayList( + super.getBrowsersToTest()); + browsers.remove(Browser.FIREFOX.getDesiredCapabilities()); + return browsers; } @Test @@ -66,15 +74,14 @@ public class SelectAllRowsTest extends MultiBrowserTest { private void selectAllRowsInTable() { clickFirstRow(); scrollTableToBottom(); - new Actions(getDriver()).keyDown(Keys.SHIFT).perform(); - clickLastRow(); - new Actions(getDriver()).keyUp(Keys.SHIFT).perform(); + new Actions(getDriver()).keyDown(Keys.SHIFT).click(getLastRow()) + .keyUp(Keys.SHIFT).perform(); } - private void clickLastRow() { + private WebElement getLastRow() { List rows = allVisibleTableRows(); WebElement lastRow = rows.get(rows.size() - 1); - lastRow.click(); + return lastRow; } private void clickFirstRow() { -- cgit v1.2.3