You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

ActionsOnInvisibleComponentsTest.java 1.2KB

12345678910111213141516171819202122232425262728293031323334353637
  1. package com.vaadin.tests.actions;
  2. import java.util.List;
  3. import org.junit.Assert;
  4. import org.junit.Test;
  5. import org.openqa.selenium.interactions.Actions;
  6. import org.openqa.selenium.remote.DesiredCapabilities;
  7. import com.vaadin.testbench.parallel.Browser;
  8. import com.vaadin.tests.tb3.MultiBrowserTest;
  9. public class ActionsOnInvisibleComponentsTest extends MultiBrowserTest {
  10. private static final String LAST_INIT_LOG = "3. 'C' triggers a click on a visible and enabled button";
  11. // This method should be removed once #12785 is fixed
  12. @Override
  13. public List<DesiredCapabilities> getBrowsersToTest() {
  14. return getBrowserCapabilities(Browser.IE9, Browser.IE10, Browser.IE11);
  15. }
  16. @Test
  17. public void testShortcutsOnInvisibleDisabledButtons() {
  18. openTestURL();
  19. Assert.assertEquals(LAST_INIT_LOG, getLogRow(0));
  20. invokeShortcut("A");
  21. Assert.assertEquals(LAST_INIT_LOG, getLogRow(0));
  22. invokeShortcut("B");
  23. Assert.assertEquals(LAST_INIT_LOG, getLogRow(0));
  24. invokeShortcut("C");
  25. Assert.assertEquals("4. Click event for enabled button", getLogRow(0));
  26. }
  27. private void invokeShortcut(CharSequence key) {
  28. new Actions(getDriver()).sendKeys(key).perform();
  29. }
  30. }