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 913B

12345678910111213141516171819202122232425262728
  1. package com.vaadin.tests.actions;
  2. import static org.junit.Assert.assertEquals;
  3. import org.junit.Test;
  4. import org.openqa.selenium.interactions.Actions;
  5. import com.vaadin.tests.tb3.MultiBrowserTest;
  6. public class ActionsOnInvisibleComponentsTest extends MultiBrowserTest {
  7. private static final String LAST_INIT_LOG = "3. 'C' triggers a click on a visible and enabled button";
  8. @Test
  9. public void testShortcutsOnInvisibleDisabledButtons() {
  10. openTestURL();
  11. assertEquals(LAST_INIT_LOG, getLogRow(0));
  12. invokeShortcut("a");
  13. assertEquals(LAST_INIT_LOG, getLogRow(0));
  14. invokeShortcut("b");
  15. assertEquals(LAST_INIT_LOG, getLogRow(0));
  16. invokeShortcut("c");
  17. assertEquals("4. Click event for enabled button", getLogRow(0));
  18. }
  19. private void invokeShortcut(CharSequence key) {
  20. new Actions(getDriver()).sendKeys(key).perform();
  21. }
  22. }