]> source.dussan.org Git - vaadin-framework.git/commitdiff
Make Vaadin TB3/4 tests work and run on PhantomJS (#13291)
authorTeemu Suo-Anttila <teemusa@vaadin.com>
Wed, 14 May 2014 13:31:28 +0000 (16:31 +0300)
committerVaadin Code Review <review@vaadin.com>
Thu, 15 May 2014 10:01:08 +0000 (10:01 +0000)
Change-Id: I0d1747d41b3b9e0a32d995a5cea9081292c8c2c6

19 files changed:
uitest/src/com/vaadin/tests/VerifyBrowserVersionTest.java
uitest/src/com/vaadin/tests/actions/ActionsOnInvisibleComponentsTest.java
uitest/src/com/vaadin/tests/components/combobox/ComboBoxSetNullWhenNewItemsAllowedTest.java
uitest/src/com/vaadin/tests/components/datefield/DateFieldTestTest.java
uitest/src/com/vaadin/tests/components/table/CtrlShiftMultiselectTest.java
uitest/src/com/vaadin/tests/components/table/EmptyTableTest.java
uitest/src/com/vaadin/tests/components/table/SelectAllRowsTest.java
uitest/src/com/vaadin/tests/components/tabsheet/TabSheetFocusedTabTest.java
uitest/src/com/vaadin/tests/components/tabsheet/TabsheetScrollingTest.java
uitest/src/com/vaadin/tests/components/ui/TextAreaEventPropagation.java
uitest/src/com/vaadin/tests/components/ui/TextAreaEventPropagationTest.java
uitest/src/com/vaadin/tests/fonticon/FontIcons.java
uitest/src/com/vaadin/tests/fonticon/FontIconsTest.java
uitest/src/com/vaadin/tests/push/PushConfigurationStreamingTest.java
uitest/src/com/vaadin/tests/push/PushConfigurationWebSocketTest.java
uitest/src/com/vaadin/tests/push/PushErrorHandlingTest.java
uitest/src/com/vaadin/tests/tb3/AbstractTB3Test.java
uitest/src/com/vaadin/tests/tb3/MultiBrowserTest.java
uitest/src/com/vaadin/tests/tb3/WebsocketTest.java

index 501233dad083b031664493616eb8d1128817e97e..53317bd581f93c5f4fa3cffaa6761a64738c5eb3 100644 (file)
@@ -47,6 +47,9 @@ public class VerifyBrowserVersionTest extends MultiBrowserTest {
         expectedUserAgent
                 .put(Browser.CHROME.getDesiredCapabilities(),
                         "Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/33.0.1750.117 Safari/537.36");
+        expectedUserAgent
+                .put(Browser.PHANTOMJS.getDesiredCapabilities(),
+                        "Mozilla/5.0 (Windows NT 6.1) AppleWebKit/534.34 (KHTML, like Gecko) PhantomJS/1.9.7 Safari/534.34");
 
     }
 
index 1d08ee5edea2c4ca4c4e10ea07278774798c025d..8dfcf52b7584cb7da88613cd1dc7e7c5c6a4eb91 100644 (file)
@@ -4,26 +4,22 @@ import java.util.List;
 
 import org.junit.Assert;
 import org.junit.Test;
-import org.openqa.selenium.WebElement;
+import org.openqa.selenium.interactions.Actions;
 import org.openqa.selenium.remote.DesiredCapabilities;
 
 import com.vaadin.tests.tb3.MultiBrowserTest;
 
 public class ActionsOnInvisibleComponentsTest extends MultiBrowserTest {
-
     private static final String LAST_INIT_LOG = "3. 'C' triggers a click on a visible and enabled button";
 
     // This method should be removed once #12785 is fixed
     @Override
     public List<DesiredCapabilities> getBrowsersToTest() {
         List<DesiredCapabilities> browsers = super.getBrowsersToTest();
-        // sendKeys does nothing on these browsers
+        // Send Keys does not function correctly on these browsers.
+        browsers.remove(Browser.CHROME.getDesiredCapabilities());
         browsers.remove(Browser.FIREFOX.getDesiredCapabilities());
         browsers.remove(Browser.IE8.getDesiredCapabilities());
-        browsers.remove(Browser.OPERA.getDesiredCapabilities());
-
-        // Causes 'cannot focus element'
-        browsers.remove(Browser.CHROME.getDesiredCapabilities());
         return browsers;
     }
 
@@ -40,7 +36,6 @@ public class ActionsOnInvisibleComponentsTest extends MultiBrowserTest {
     }
 
     private void invokeShortcut(CharSequence key) {
-        WebElement shortcutTarget = vaadinElementById("test-root");
-        shortcutTarget.sendKeys(key);
+        new Actions(getDriver()).sendKeys(key).perform();
     }
 }
index cfd5f46af1faf5e17dca37c524e6c2ac606034ca..54d355ab0ab92ade6f8a457950b448c4dae16493 100644 (file)
@@ -20,9 +20,11 @@ import static org.junit.Assert.assertEquals;
 import org.junit.Test;
 import org.openqa.selenium.Keys;
 import org.openqa.selenium.WebElement;
+import org.openqa.selenium.interactions.Actions;
 
 import com.vaadin.testbench.By;
 import com.vaadin.testbench.commands.TestBenchElementCommands;
+import com.vaadin.testbench.elements.ComboBoxElement;
 import com.vaadin.tests.tb3.MultiBrowserTest;
 
 /**
@@ -35,21 +37,18 @@ public class ComboBoxSetNullWhenNewItemsAllowedTest extends MultiBrowserTest {
             throws InterruptedException {
         setDebug(true);
         openTestURL();
-        Thread.sleep(1000);
 
-        WebElement element = findElement();
+        WebElement element = $(ComboBoxElement.class).first().findElement(
+                By.vaadin("#textbox"));
         ((TestBenchElementCommands) element).click(8, 7);
         element.clear();
         element.sendKeys("New value");
         assertEquals("New value", element.getAttribute("value"));
-        element.sendKeys(Keys.RETURN);
+        if (BrowserUtil.isPhantomJS(getDesiredCapabilities())) {
+            new Actions(getDriver()).sendKeys(Keys.ENTER).perform();
+        } else {
+            element.sendKeys(Keys.RETURN);
+        }
         assertEquals("", element.getAttribute("value"));
     }
-
-    private WebElement findElement() {
-        return getDriver()
-                .findElement(
-                        By.vaadin("runcomvaadintestscomponentscomboboxComboBoxSetNullWhenNewItemsAllowed::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VFilterSelect[0]#textbox"));
-    }
-
 }
index 108b7030e7264c151cc6a33b1eb8e77ba4f0e4dd..5f659d389b97fd79f2c8702725f1714fa34b054c 100644 (file)
@@ -19,10 +19,10 @@ import org.junit.Assert;
 import org.junit.Test;
 import org.openqa.selenium.By;
 import org.openqa.selenium.Dimension;
-import org.openqa.selenium.NoSuchElementException;
 import org.openqa.selenium.WebElement;
 import org.openqa.selenium.interactions.Actions;
 
+import com.vaadin.testbench.elements.NotificationElement;
 import com.vaadin.tests.tb3.MultiBrowserTest;
 
 public class DateFieldTestTest extends MultiBrowserTest {
@@ -44,12 +44,8 @@ public class DateFieldTestTest extends MultiBrowserTest {
     }
 
     private void assertNoErrorNotification() {
-        try {
-            getDriver().findElement(
-                    By.xpath("//div[contains(@class, 'v-Notification') ]"));
-            Assert.fail("Error notification shown!");
-        } catch (NoSuchElementException e) {
-            // As expected
+        if (isElementPresent(NotificationElement.class)) {
+            Assert.fail("Notification was present");
         }
     }
 
index 1c84533a4233038f6a51128320a9d9a93a4f9635..255a798594e88ea847ea767a998491bbce65ffb6 100644 (file)
@@ -32,7 +32,9 @@ public class CtrlShiftMultiselectTest extends MultiBrowserTest {
     @Override
     public List<DesiredCapabilities> getBrowsersToTest() {
         List<DesiredCapabilities> browsers = super.getBrowsersToTest();
+        // Shift + click doesn't select all rows correctly on these browsers
         browsers.remove(Browser.FIREFOX.getDesiredCapabilities());
+        browsers.remove(Browser.PHANTOMJS.getDesiredCapabilities());
 
         return browsers;
     }
index 30e783f824cdba20851e6f9ffa3646dd6bafc472..2332815ed6ad5966aad4b0582a482219f98094b0 100644 (file)
@@ -17,9 +17,8 @@ package com.vaadin.tests.components.table;
 
 import org.junit.Assert;
 import org.junit.Test;
-import org.openqa.selenium.By;
-import org.openqa.selenium.NoSuchElementException;
 
+import com.vaadin.testbench.elements.NotificationElement;
 import com.vaadin.tests.tb3.MultiBrowserTest;
 
 public class EmptyTableTest extends MultiBrowserTest {
@@ -33,12 +32,9 @@ public class EmptyTableTest extends MultiBrowserTest {
     }
 
     private void ensureNoErrors() {
-        try {
-            getDriver().findElement(By.className("v-Notification"));
-        } catch (NoSuchElementException e) {
-            return;
+        if (isElementPresent(NotificationElement.class)) {
+            Assert.fail("Error notification was shown!");
         }
-        Assert.fail("Error notification was shown!");
     }
 
 }
index 524b8a484fcafb80c8f20fc167d610dc6042de59..0fc09adf40a06720f42cd522b2ff5fffd6246698 100644 (file)
@@ -47,10 +47,11 @@ public class SelectAllRowsTest extends MultiBrowserTest {
 
     @Override
     public List<DesiredCapabilities> getBrowsersToTest() {
-        // Pressing Shift modifier key does not work with Firefox
+        // Pressing Shift modifier key does not work with Firefox and PhantomJS
         ArrayList<DesiredCapabilities> browsers = new ArrayList<DesiredCapabilities>(
                 super.getBrowsersToTest());
         browsers.remove(Browser.FIREFOX.getDesiredCapabilities());
+        browsers.remove(Browser.PHANTOMJS.getDesiredCapabilities());
         return browsers;
     }
 
index 9085a76375a03d73477df4d2fbae798e138f7aeb..12ae03080b8e4ef895e2827a0a2621036c2a280d 100644 (file)
@@ -18,16 +18,28 @@ package com.vaadin.tests.components.tabsheet;
 import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertTrue;
 
+import java.util.List;
+
 import org.junit.Test;
 import org.openqa.selenium.Keys;
 import org.openqa.selenium.WebElement;
 import org.openqa.selenium.interactions.Actions;
+import org.openqa.selenium.remote.DesiredCapabilities;
 
 import com.vaadin.testbench.By;
 import com.vaadin.tests.tb3.MultiBrowserTest;
 
 public class TabSheetFocusedTabTest extends MultiBrowserTest {
 
+    @Override
+    public List<DesiredCapabilities> getBrowsersToTest() {
+        List<DesiredCapabilities> browsers = super.getBrowsersToTest();
+        // PhantomJS doesn't send Focus / Blur events when clicking or
+        // navigating with keyboard
+        browsers.remove(Browser.PHANTOMJS.getDesiredCapabilities());
+        return browsers;
+    }
+
     @Override
     protected Class<?> getUIClass() {
         return TabsheetScrolling.class;
@@ -41,7 +53,7 @@ public class TabSheetFocusedTabTest extends MultiBrowserTest {
 
         assertTrue(isFocused(getTab(1)));
 
-        new Actions(getDriver()).sendKeys(Keys.RIGHT).perform();
+        new Actions(getDriver()).sendKeys(Keys.ARROW_RIGHT).perform();
 
         assertFalse(isFocused(getTab(1)));
         assertTrue(isFocused(getTab(3)));
@@ -65,6 +77,7 @@ public class TabSheetFocusedTabTest extends MultiBrowserTest {
     }
 
     private boolean isFocused(WebElement tab) {
+
         return tab.getAttribute("class").contains("v-tabsheet-tabitem-focus");
     }
 
index 4738c48d7e7db10e7b6cc6c9684e62a628fbee7c..1da42bb1ceb2674df6509132352574a0eb1a96e3 100644 (file)
@@ -22,6 +22,7 @@ import org.openqa.selenium.WebElement;
 import org.openqa.selenium.interactions.Actions;
 
 import com.vaadin.testbench.By;
+import com.vaadin.testbench.elements.ButtonElement;
 import com.vaadin.tests.tb3.MultiBrowserTest;
 
 public class TabsheetScrollingTest extends MultiBrowserTest {
@@ -38,19 +39,11 @@ public class TabsheetScrollingTest extends MultiBrowserTest {
     }
 
     private WebElement getTab(int index) {
-        return getDriver().findElement(
-                By.vaadin("/VVerticalLayout[0]/Slot[1]"
-                        + "/VVerticalLayout[0]/Slot[0]/VTabsheet[0]"
-                        + "/domChild[0]/domChild[0]/domChild[0]"
-                        + "/domChild[0]/domChild[" + index + "]"));
-
+        return getDriver().findElement(By.vaadin("//TabSheet#tab[1]"));
     }
 
     private String getHideButtonText() {
-        WebElement buttonCaption = getDriver().findElement(
-                By.vaadin("/VVerticalLayout[0]/Slot[1]/VVerticalLayout[0]"
-                        + "/Slot[0]/VTabsheet[0]/VTabsheetPanel[0]"
-                        + "/VButton[0]/domChild[0]/domChild[0]"));
+        ButtonElement buttonCaption = $(ButtonElement.class).first();
         return buttonCaption.getText();
     }
 
index 31eeac02dad47acf363bbd6a3f6a0b4861ea408b..4235f5a989c2626412b54d64af5600bed5e631ad 100644 (file)
@@ -48,10 +48,10 @@ public class TextAreaEventPropagation extends AbstractTestUIWithLog {
         FormLayout form = new FormLayout();
         TextArea textArea = new TextArea("Text input");
         TextField textField = new TextField("Text field input");
-        enterButtonPressed = new Label("Enter Label");
-        enterButtonPressed.setCaption(NO_BUTTON_PRESSED);
-        escapeButtonPressed = new Label("Escape Label");
-        escapeButtonPressed.setCaption(NO_BUTTON_PRESSED);
+        enterButtonPressed = new Label(NO_BUTTON_PRESSED);
+        enterButtonPressed.setCaption("Enter Label");
+        escapeButtonPressed = new Label(NO_BUTTON_PRESSED);
+        escapeButtonPressed.setCaption("Escape Label");
 
         Button enterButton = new Button("Enter");
         enterButton.setClickShortcut(KeyCode.ENTER);
@@ -60,7 +60,7 @@ public class TextAreaEventPropagation extends AbstractTestUIWithLog {
             @Override
             public void buttonClick(ClickEvent event) {
 
-                enterButtonPressed.setCaption(BUTTON_PRESSED);
+                enterButtonPressed.setValue(BUTTON_PRESSED);
             }
         });
 
@@ -71,7 +71,7 @@ public class TextAreaEventPropagation extends AbstractTestUIWithLog {
             @Override
             public void buttonClick(ClickEvent event) {
 
-                escapeButtonPressed.setCaption(BUTTON_PRESSED);
+                escapeButtonPressed.setValue(BUTTON_PRESSED);
             }
         });
 
index 11e0c52d27730ec722ae51ccb63cecd32fe40e2d..b1c38df46009d321814bdd0df8fbe8bb829db1cc 100644 (file)
@@ -18,11 +18,13 @@ package com.vaadin.tests.components.ui;
 import static org.junit.Assert.assertEquals;
 
 import org.junit.Test;
-import org.openqa.selenium.By;
 import org.openqa.selenium.Keys;
 import org.openqa.selenium.WebElement;
 import org.openqa.selenium.interactions.Actions;
 
+import com.vaadin.testbench.elements.LabelElement;
+import com.vaadin.testbench.elements.TextAreaElement;
+import com.vaadin.testbench.elements.TextFieldElement;
 import com.vaadin.tests.tb3.MultiBrowserTest;
 
 /**
@@ -35,7 +37,7 @@ public class TextAreaEventPropagationTest extends MultiBrowserTest {
     @Test
     public void testTextAreaEnterEventPropagation() throws InterruptedException {
         openTestURL();
-        WebElement textArea = vaadinElement("//TextArea[0]");
+        WebElement textArea = $(TextAreaElement.class).first();
         Actions builder = new Actions(driver);
         builder.click(textArea);
         builder.sendKeys(textArea, "first line asdf");
@@ -43,11 +45,11 @@ public class TextAreaEventPropagationTest extends MultiBrowserTest {
         builder.sendKeys(textArea, "second line jkl;");
         builder.perform();
 
-        WebElement enterLabel = driver.findElement(By.id("gwt-uid-8"));
-        String text = enterLabel.getText();
+        String text = $(LabelElement.class).caption("Enter Label").first()
+                .getText();
         assertEquals(TextAreaEventPropagation.NO_BUTTON_PRESSED, text);
 
-        WebElement textField = vaadinElement("//TextField[0]");
+        WebElement textField = $(TextFieldElement.class).first();
         Actions builder2 = new Actions(driver);
         builder2.click(textField);
 
@@ -56,7 +58,7 @@ public class TextAreaEventPropagationTest extends MultiBrowserTest {
 
         builder2.perform();
 
-        text = enterLabel.getText();
+        text = $(LabelElement.class).caption("Enter Label").first().getText();
 
         assertEquals(TextAreaEventPropagation.BUTTON_PRESSED, text);
 
@@ -66,7 +68,7 @@ public class TextAreaEventPropagationTest extends MultiBrowserTest {
     public void testTextAreaEscapeEventPropagation()
             throws InterruptedException {
         openTestURL();
-        WebElement textArea = vaadinElement("//TextArea[0]");
+        WebElement textArea = $(TextAreaElement.class).first();
         Actions builder = new Actions(driver);
         builder.click(textArea);
         builder.sendKeys(textArea, "first line asdf");
@@ -75,11 +77,10 @@ public class TextAreaEventPropagationTest extends MultiBrowserTest {
         builder.sendKeys(Keys.ESCAPE);
         builder.perform();
 
-        WebElement enterLabel = driver.findElement(By.id("gwt-uid-8"));
-        String text = enterLabel.getText();
+        String text = $(LabelElement.class).caption("Enter Label").first()
+                .getText();
         assertEquals(TextAreaEventPropagation.NO_BUTTON_PRESSED, text);
-        WebElement escapeLabel = driver.findElement(By.id("gwt-uid-10"));
-        text = escapeLabel.getText();
+        text = $(LabelElement.class).caption("Escape Label").first().getText();
         assertEquals(TextAreaEventPropagation.BUTTON_PRESSED, text);
 
     }
@@ -88,7 +89,7 @@ public class TextAreaEventPropagationTest extends MultiBrowserTest {
     public void testTextFieldEscapeEventPropagation()
             throws InterruptedException {
         openTestURL();
-        WebElement textArea = vaadinElement("//TextArea[0]");
+        WebElement textArea = $(TextAreaElement.class).first();
         Actions builder = new Actions(driver);
         builder.click(textArea);
         builder.sendKeys(textArea, "first line asdf");
@@ -96,12 +97,11 @@ public class TextAreaEventPropagationTest extends MultiBrowserTest {
         builder.sendKeys(textArea, "second line jkl;");
         builder.perform();
 
-        WebElement enterLabel = driver.findElement(By.id("gwt-uid-8"));
-        String text = enterLabel.getText();
+        String text = $(LabelElement.class).caption("Enter Label").first()
+                .getText();
         assertEquals(TextAreaEventPropagation.NO_BUTTON_PRESSED, text);
-        WebElement escapeLabel = driver.findElement(By.id("gwt-uid-10"));
 
-        WebElement textField = vaadinElement("//TextField[0]");
+        WebElement textField = $(TextFieldElement.class).first();
         Actions builder2 = new Actions(driver);
         builder2.click(textField);
 
@@ -111,13 +111,10 @@ public class TextAreaEventPropagationTest extends MultiBrowserTest {
 
         builder2.perform();
 
-        text = enterLabel.getText();
+        text = $(LabelElement.class).caption("Enter Label").first().getText();
         assertEquals(TextAreaEventPropagation.BUTTON_PRESSED, text);
-
-        text = escapeLabel.getText();
-
+        text = $(LabelElement.class).caption("Escape Label").first().getText();
         assertEquals(TextAreaEventPropagation.BUTTON_PRESSED, text);
 
     }
-
 }
index bce4a79986af2264fb8e8b99299acf73da7d8def..e9d2b91e95e9520383960d9fc71d7a66aaa20485 100644 (file)
@@ -57,11 +57,6 @@ import com.vaadin.ui.TwinColSelect;
 import com.vaadin.ui.Upload;
 import com.vaadin.ui.VerticalLayout;
 
-/**
- * 
- * @since
- * @author Vaadin Ltd
- */
 public class FontIcons extends AbstractTestUI {
 
     @Override
@@ -105,7 +100,7 @@ public class FontIcons extends AbstractTestUI {
         Notification n = new Notification("Hey there!");
         n.setIcon(icon);
         n.setPosition(Position.BOTTOM_CENTER);
-        n.setDelayMsec(-1);
+        n.setDelayMsec(300000);
         n.show(Page.getCurrent());
 
         // grid of compoents
index bc08071cef932181a33e026a6813c50d4d08c02b..61a38bf552dae5e571a012ed42d7d33371637182 100644 (file)
@@ -21,11 +21,6 @@ import org.junit.Test;
 
 import com.vaadin.tests.tb3.MultiBrowserTest;
 
-/**
- * 
- * @since
- * @author Vaadin Ltd
- */
 public class FontIconsTest extends MultiBrowserTest {
 
     @Test
index 0443307b2f557622e4968622ab3e79e09ae51e8a..8dc960c9ac27a4e33c08ce51525cf7b5fe2e4975 100644 (file)
@@ -38,6 +38,8 @@ public class PushConfigurationStreamingTest extends PushConfigurationTest {
 
     @Test
     public void testStreaming() throws InterruptedException {
+        openDebugLogTab();
+
         new Select(getTransportSelect()).selectByVisibleText("STREAMING");
         new Select(getPushModeSelect()).selectByVisibleText("AUTOMATIC");
 
index 2a36059ccb38ce8d2917ed67a154793ec10ada0b..c9a813fac085bd62c9d9c327a77d1d24482c9a1c 100644 (file)
@@ -33,6 +33,7 @@ public class PushConfigurationWebSocketTest extends PushConfigurationTest {
         List<DesiredCapabilities> browsers = super.getBrowsersToTest();
         browsers.remove(Browser.IE8.getDesiredCapabilities());
         browsers.remove(Browser.IE9.getDesiredCapabilities());
+        browsers.remove(Browser.PHANTOMJS.getDesiredCapabilities());
 
         return browsers;
     }
index c31b1675862c3deda5b3e845c27ee019b4a4f729..1f6e181c89a0a81a31526f7faf191327b1a8ac52 100644 (file)
@@ -20,6 +20,7 @@ import org.junit.Test;
 import org.openqa.selenium.By;
 import org.openqa.selenium.WebElement;
 
+import com.vaadin.testbench.elements.LabelElement;
 import com.vaadin.tests.annotations.TestCategory;
 import com.vaadin.tests.tb3.MultiBrowserTest;
 
@@ -31,11 +32,15 @@ public class PushErrorHandlingTest extends MultiBrowserTest {
         setPush(true);
         openTestURL();
         vaadinElementById("npeButton").click();
+        int idx = 1;
+        if (BrowserUtil.isPhantomJS(getDesiredCapabilities())) {
+            // PhantomJS sends an extra event when page gets loaded.
+            // This results as an extra error label.
+            ++idx;
+        }
         Assert.assertEquals(
                 "An error! Unable to invoke method click in com.vaadin.shared.ui.button.ButtonServerRpc",
-                vaadinElement(
-                        "/VVerticalLayout[0]/Slot[1]/VVerticalLayout[0]/Slot[2]/VLabel[0]")
-                        .getText());
+                $(LabelElement.class).get(idx).getText());
 
         WebElement table = vaadinElementById("testtable");
         WebElement row = table.findElement(By
index 0a0e49898182490acfe13080857d52b5bd999158..7be55ff298bf4102abe18340bd95c422f0f9046a 100644 (file)
@@ -956,10 +956,14 @@ public abstract class AbstractTB3Test extends TestBenchTestCase {
     }
 
     public void hitButton(String id) {
-        WebDriverBackedSelenium selenium = new WebDriverBackedSelenium(driver,
-                driver.getCurrentUrl());
+        if (BrowserUtil.isPhantomJS(getDesiredCapabilities())) {
+            driver.findElement(By.id(id)).click();
+        } else {
+            WebDriverBackedSelenium selenium = new WebDriverBackedSelenium(
+                    driver, driver.getCurrentUrl());
 
-        selenium.keyPress("id=" + id, "\\13");
+            selenium.keyPress("id=" + id, "\\13");
+        }
     }
 
     protected void openDebugLogTab() {
index 13c34d475abb2abefd0dfc818266d23c0de5b588..74073af2179d30793c862343034dd54c26d61a7b 100644 (file)
@@ -66,6 +66,7 @@ public abstract class MultiBrowserTest extends PrivateTB3Configuration {
         // Uncomment once we have the capability to run on Safari 6
         // allBrowsers.add(SAFARI);
         allBrowsers.add(Browser.CHROME.getDesiredCapabilities());
+        allBrowsers.add(Browser.PHANTOMJS.getDesiredCapabilities());
         // Re-enable this when it is possible to run on a modern Opera version
         // allBrowsers.add(Browser.OPERA.getDesiredCapabilities());
     }
index d466c391319e354fe9bfb891705a96d009ae21b0..778c8b91138c4e39bfef7977fdd4cc7cb5bf27db 100644 (file)
@@ -41,6 +41,7 @@ public abstract class WebsocketTest extends PrivateTB3Configuration {
         websocketBrowsers.addAll(MultiBrowserTest.getAllBrowsers());
         websocketBrowsers.remove(Browser.IE8.getDesiredCapabilities());
         websocketBrowsers.remove(Browser.IE9.getDesiredCapabilities());
+        websocketBrowsers.remove(Browser.PHANTOMJS.getDesiredCapabilities());
     }
 
     /**