Skip to content

Commit 409c389

Browse files
committed
1 parent d90b608 commit 409c389

1 file changed

Lines changed: 20 additions & 17 deletions

File tree

java/test/org/openqa/selenium/TypingTest.java

Lines changed: 20 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,11 @@
2222
import static org.assertj.core.api.Assertions.assertThatExceptionOfType;
2323
import static org.junit.Assume.assumeFalse;
2424
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;
2627
import static org.openqa.selenium.testing.drivers.Browser.FIREFOX;
28+
import static org.openqa.selenium.testing.drivers.Browser.IE;
2729
import static org.openqa.selenium.testing.drivers.Browser.SAFARI;
28-
import static org.openqa.selenium.testing.TestUtilities.getEffectivePlatform;
2930

3031
import org.junit.Test;
3132
import org.openqa.selenium.support.ui.ExpectedConditions;
@@ -36,6 +37,17 @@
3637

3738
public class TypingTest extends JUnit4TestBase {
3839

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+
3951
@Test
4052
public void testShouldFireKeyPressEvents() {
4153
driver.get(pages.javascriptPage);
@@ -237,12 +249,6 @@ public void testShouldFireFocusKeyEventsInTheRightOrder() {
237249
assertThat(result.getText().trim()).isEqualTo("focus keydown keypress keyup");
238250
}
239251

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-
246252
@Test
247253
public void testShouldReportKeyCodeOfArrowKeys() {
248254
assumeFalse(Browser.detect() == Browser.LEGACY_OPERA &&
@@ -422,7 +428,8 @@ public void testSpecialSpaceKeys() {
422428
@Test
423429
@NotYetImplemented(value = FIREFOX)
424430
@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() {
426433
driver.get(pages.javascriptPage);
427434

428435
WebElement element = driver.findElement(By.id("keyReporter"));
@@ -482,6 +489,9 @@ public void testChordControlHomeShiftEndDelete() {
482489
assertThat(element.getAttribute("value")).isEqualTo("");
483490
}
484491

492+
// control-x control-v here for cut & paste tests, these work on windows
493+
// and linux, but not on the MAC.
494+
485495
@Test
486496
@NotYetImplemented(value = FIREFOX, reason = "https://github.com/mozilla/geckodriver/issues/646")
487497
public void testChordReveseShiftHomeSelectionDeletes() {
@@ -510,10 +520,8 @@ public void testChordReveseShiftHomeSelectionDeletes() {
510520
assertThat(element.getAttribute("value")).isEqualTo("");
511521
}
512522

513-
// control-x control-v here for cut & paste tests, these work on windows
514-
// and linux, but not on the MAC.
515-
516523
@Test
524+
@Ignore(value = CHROME, reason = "https://bugs.chromium.org/p/chromedriver/issues/detail?id=3999")
517525
@NotYetImplemented(value = FIREFOX, reason = "https://github.com/mozilla/geckodriver/issues/646")
518526
public void testChordControlCutAndPaste() {
519527
assumeFalse("FIXME: macs don't have HOME keys, would PGUP work?",
@@ -670,9 +678,4 @@ public void canTypeMultipleNewLineCharactersIntoTextArea() {
670678
element.sendKeys("\n\n\n");
671679
shortWait.until(ExpectedConditions.attributeToBe(element, "value", "\n\n\n"));
672680
}
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-
}
678681
}

0 commit comments

Comments
 (0)