Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

ActionsOnInvisibleComponentsTest.java 1.3KB

1234567891011121314151617181920212223242526272829303132333435363738
  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. Browser.PHANTOMJS);
  16. }
  17. @Test
  18. public void testShortcutsOnInvisibleDisabledButtons() {
  19. openTestURL();
  20. Assert.assertEquals(LAST_INIT_LOG, getLogRow(0));
  21. invokeShortcut("A");
  22. Assert.assertEquals(LAST_INIT_LOG, getLogRow(0));
  23. invokeShortcut("B");
  24. Assert.assertEquals(LAST_INIT_LOG, getLogRow(0));
  25. invokeShortcut("C");
  26. Assert.assertEquals("4. Click event for enabled button", getLogRow(0));
  27. }
  28. private void invokeShortcut(CharSequence key) {
  29. new Actions(getDriver()).sendKeys(key).perform();
  30. }
  31. }