|
22 | 22 | import static org.assertj.core.api.Assertions.assertThatExceptionOfType; |
23 | 23 | import static org.junit.Assume.assumeFalse; |
24 | 24 | import static org.openqa.selenium.WaitingConditions.elementValueToEqual; |
25 | | -import static org.openqa.selenium.testing.drivers.Browser.IE; |
| 25 | +import static org.openqa.selenium.testing.TestUtilities.getEffectivePlatform; |
| 26 | +import static org.openqa.selenium.testing.drivers.Browser.CHROME; |
26 | 27 | import static org.openqa.selenium.testing.drivers.Browser.FIREFOX; |
| 28 | +import static org.openqa.selenium.testing.drivers.Browser.IE; |
27 | 29 | import static org.openqa.selenium.testing.drivers.Browser.SAFARI; |
28 | | -import static org.openqa.selenium.testing.TestUtilities.getEffectivePlatform; |
29 | 30 |
|
30 | 31 | import org.junit.Test; |
31 | 32 | import org.openqa.selenium.support.ui.ExpectedConditions; |
|
36 | 37 |
|
37 | 38 | public class TypingTest extends JUnit4TestBase { |
38 | 39 |
|
| 40 | + private static void checkRecordedKeySequence(WebElement element, int expectedKeyCode) { |
| 41 | + assertThat(element.getText().trim()).contains( |
| 42 | + String.format("down: %1$d", expectedKeyCode), |
| 43 | + String.format("up: %1$d", expectedKeyCode)); |
| 44 | + } |
| 45 | + |
| 46 | + private static String getValueText(WebElement el) { |
| 47 | + // Standardize on \n and strip any trailing whitespace. |
| 48 | + return el.getAttribute("value").replace("\r\n", "\n").trim(); |
| 49 | + } |
| 50 | + |
39 | 51 | @Test |
40 | 52 | public void testShouldFireKeyPressEvents() { |
41 | 53 | driver.get(pages.javascriptPage); |
@@ -237,12 +249,6 @@ public void testShouldFireFocusKeyEventsInTheRightOrder() { |
237 | 249 | assertThat(result.getText().trim()).isEqualTo("focus keydown keypress keyup"); |
238 | 250 | } |
239 | 251 |
|
240 | | - private static void checkRecordedKeySequence(WebElement element, int expectedKeyCode) { |
241 | | - assertThat(element.getText().trim()).contains( |
242 | | - String.format("down: %1$d", expectedKeyCode), |
243 | | - String.format("up: %1$d", expectedKeyCode)); |
244 | | - } |
245 | | - |
246 | 252 | @Test |
247 | 253 | public void testShouldReportKeyCodeOfArrowKeys() { |
248 | 254 | assumeFalse(Browser.detect() == Browser.LEGACY_OPERA && |
@@ -422,7 +428,8 @@ public void testSpecialSpaceKeys() { |
422 | 428 | @Test |
423 | 429 | @NotYetImplemented(value = FIREFOX) |
424 | 430 | @NotYetImplemented(value = SAFARI, reason = "Enters dot instead of comma") |
425 | | - public void testNumberpadKeys() { |
| 431 | + @Ignore(value = CHROME, reason = "https://bugs.chromium.org/p/chromedriver/issues/detail?id=3999") |
| 432 | + public void testNumberPadKeys() { |
426 | 433 | driver.get(pages.javascriptPage); |
427 | 434 |
|
428 | 435 | WebElement element = driver.findElement(By.id("keyReporter")); |
@@ -482,6 +489,9 @@ public void testChordControlHomeShiftEndDelete() { |
482 | 489 | assertThat(element.getAttribute("value")).isEqualTo(""); |
483 | 490 | } |
484 | 491 |
|
| 492 | + // control-x control-v here for cut & paste tests, these work on windows |
| 493 | + // and linux, but not on the MAC. |
| 494 | + |
485 | 495 | @Test |
486 | 496 | @NotYetImplemented(value = FIREFOX, reason = "https://github.com/mozilla/geckodriver/issues/646") |
487 | 497 | public void testChordReveseShiftHomeSelectionDeletes() { |
@@ -510,10 +520,8 @@ public void testChordReveseShiftHomeSelectionDeletes() { |
510 | 520 | assertThat(element.getAttribute("value")).isEqualTo(""); |
511 | 521 | } |
512 | 522 |
|
513 | | - // control-x control-v here for cut & paste tests, these work on windows |
514 | | - // and linux, but not on the MAC. |
515 | | - |
516 | 523 | @Test |
| 524 | + @Ignore(value = CHROME, reason = "https://bugs.chromium.org/p/chromedriver/issues/detail?id=3999") |
517 | 525 | @NotYetImplemented(value = FIREFOX, reason = "https://github.com/mozilla/geckodriver/issues/646") |
518 | 526 | public void testChordControlCutAndPaste() { |
519 | 527 | assumeFalse("FIXME: macs don't have HOME keys, would PGUP work?", |
@@ -670,9 +678,4 @@ public void canTypeMultipleNewLineCharactersIntoTextArea() { |
670 | 678 | element.sendKeys("\n\n\n"); |
671 | 679 | shortWait.until(ExpectedConditions.attributeToBe(element, "value", "\n\n\n")); |
672 | 680 | } |
673 | | - |
674 | | - private static String getValueText(WebElement el) { |
675 | | - // Standardize on \n and strip any trailing whitespace. |
676 | | - return el.getAttribute("value").replace("\r\n", "\n").trim(); |
677 | | - } |
678 | 681 | } |
0 commit comments